Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
a8704343
Commit
a8704343
authored
Oct 30, 2014
by
Carson Gee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HAProxy check user to prevent `max_connect_error` exceptions
parent
378a68e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
playbooks/roles/haproxy/defaults/main.yml
+1
-1
playbooks/roles/mariadb/defaults/main.yml
+7
-0
playbooks/roles/mariadb/tasks/cluster.yml
+8
-2
No files found.
playbooks/roles/haproxy/defaults/main.yml
View file @
a8704343
...
...
@@ -63,7 +63,7 @@ haproxy_applications:
balance roundrobin
option tcplog
option tcpka
option mysql-check
option mysql-check
user haproxy
server galera1 192.168.33.100:3306 check weight 1
server galera2 192.168.33.110:3306 check weight 1
server galera3 192.168.33.120:3306 check weight 1
...
...
playbooks/roles/mariadb/defaults/main.yml
View file @
a8704343
...
...
@@ -19,6 +19,13 @@ MARIADB_CLUSTERED: no
MARIADB_CLUSTER_USER_ADMIN
:
"
mariadb_clu_root"
MARIADB_CLUSTER_PASSWORD_ADMIN
:
"
password"
MARIADB_HOST_PRIV
:
'
%'
MARIADB_HAPROXY_USER
:
'
haproxy'
MARIADB_HAPROXY_HOSTS
:
-
'
192.168.33.100'
-
'
192.168.33.110'
-
'
192.168.33.120'
MARIADB_LISTEN_ALL
:
false
MARIADB_DATABASES
:
...
...
playbooks/roles/mariadb/tasks/cluster.yml
View file @
a8704343
...
...
@@ -48,4 +48,11 @@
when
:
not mariadb_bootstrap.stat.exists
-
name
:
touch bootstrap file to confirm we are fully up
file
:
path="/etc/mysql/ansible_cluster_started" state=touch
\ No newline at end of file
file
:
path="/etc/mysql/ansible_cluster_started" state=touch
# This is needed for mysql-check in haproxy or other mysql monitor
# scripts to prevent haproxy checks exceeding `max_connect_errors`.
-
name
:
create haproxy monitor user
command
:
>
mysql -e "INSERT INTO mysql.user (Host,User) values ('{{ item }}','{{ MARIADB_HAPROXY_USER }}'); FLUSH PRIVILEGES;"
with_items
:
MARIADB_HAPROXY_HOSTS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment