From 7fcff78e5cb472b389fe09f31e988d05c1e161e7 Mon Sep 17 00:00:00 2001 From: elouizbadr Date: Wed, 10 May 2017 14:29:52 +0100 Subject: [PATCH 1/4] Add HAProxy support ! 1- Added "xinetd" as a dependency to install and start X Internet Services on Debian jessie. 2- Added following line to install Percona MySQL Server Check service to work with HAProxy configuration. --- pxc-57/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pxc-57/Dockerfile b/pxc-57/Dockerfile index f2fb3ab43..f81f0de89 100644 --- a/pxc-57/Dockerfile +++ b/pxc-57/Dockerfile @@ -5,9 +5,15 @@ RUN groupadd -r mysql && useradd -r -g mysql mysql RUN apt-get update && apt-get install -y --no-install-recommends \ apt-transport-https ca-certificates \ - pwgen wget \ + pwgen wget xinetd \ && rm -rf /var/lib/apt/lists/* +# [elouizbadr] : +# 1- Added "xinetd" on line 8 to install X Internet Services. +# 2- Added following line to install MySQLCheck service to work with HAProxy configuration. +RUN echo "mysqlchk 9200/tcp" >> /etc/services && service xinetd restart +#################################################################################################### + RUN wget https://repo.percona.com/apt/percona-release_0.1-4.jessie_all.deb \ && dpkg -i percona-release_0.1-4.jessie_all.deb From 03b61043edaa235384d7aabca0db946af6c540b9 Mon Sep 17 00:00:00 2001 From: elouizbadr Date: Wed, 10 May 2017 14:34:30 +0100 Subject: [PATCH 2/4] Add HAProxy support ! Create required ClusterCheck script's user account on Percona MySQL server to work with HAProxy. --- pxc-57/entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pxc-57/entrypoint.sh b/pxc-57/entrypoint.sh index 7f43b5bff..64abd0139 100755 --- a/pxc-57/entrypoint.sh +++ b/pxc-57/entrypoint.sh @@ -64,6 +64,9 @@ fi GRANT REPLICATION CLIENT ON *.* TO monitor@'%' IDENTIFIED BY 'monitor'; GRANT PROCESS ON *.* TO monitor@localhost IDENTIFIED BY 'monitor'; DROP DATABASE IF EXISTS test ; + -- [elouizbadr] : + -- Add CLusterCheck script username/password to work with HAProxy + GRANT PROCESS ON *.* TO clustercheckuser@'%' IDENTIFIED BY 'clustercheckpassword!'; FLUSH PRIVILEGES ; EOSQL if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then From 520cd295bbac5b06c0e105ecb6aed73567682a78 Mon Sep 17 00:00:00 2001 From: elouizbadr Date: Wed, 10 May 2017 15:43:43 +0100 Subject: [PATCH 3/4] Fix "service xinetd restart" start problem ! Start "xinetd" service using its init script located at "/etc/init.d/xinetd". --- pxc-57/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxc-57/Dockerfile b/pxc-57/Dockerfile index f81f0de89..51856ec7b 100644 --- a/pxc-57/Dockerfile +++ b/pxc-57/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # [elouizbadr] : # 1- Added "xinetd" on line 8 to install X Internet Services. # 2- Added following line to install MySQLCheck service to work with HAProxy configuration. -RUN echo "mysqlchk 9200/tcp" >> /etc/services && service xinetd restart +RUN echo "mysqlchk 9200/tcp" >> /etc/services && /etc/init.d/xinetd start #################################################################################################### RUN wget https://repo.percona.com/apt/percona-release_0.1-4.jessie_all.deb \ From 11f3e52efa6ac269c83bb3506b2acefe01cf2691 Mon Sep 17 00:00:00 2001 From: ELOUIZ BADR Date: Wed, 10 May 2017 16:35:25 +0100 Subject: [PATCH 4/4] Fix "xinetd" service start bug! --- pxc-57/Dockerfile | 2 +- pxc-57/entrypoint.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pxc-57/Dockerfile b/pxc-57/Dockerfile index 51856ec7b..570d8223d 100644 --- a/pxc-57/Dockerfile +++ b/pxc-57/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # [elouizbadr] : # 1- Added "xinetd" on line 8 to install X Internet Services. # 2- Added following line to install MySQLCheck service to work with HAProxy configuration. -RUN echo "mysqlchk 9200/tcp" >> /etc/services && /etc/init.d/xinetd start +RUN echo "mysqlchk 9200/tcp" >> /etc/services #################################################################################################### RUN wget https://repo.percona.com/apt/percona-release_0.1-4.jessie_all.deb \ diff --git a/pxc-57/entrypoint.sh b/pxc-57/entrypoint.sh index 64abd0139..036442cef 100755 --- a/pxc-57/entrypoint.sh +++ b/pxc-57/entrypoint.sh @@ -156,6 +156,9 @@ set -e fi +# [elouizbadr] : Launch xinetd service for HAProxy +/etc/init.d/xinetd start + #--log-error=${DATADIR}error.log exec mysqld --user=mysql --wsrep_cluster_name=$CLUSTER_NAME --wsrep_cluster_address="gcomm://$cluster_join" --wsrep_sst_method=xtrabackup-v2 --wsrep_sst_auth="xtrabackup:$XTRABACKUP_PASSWORD" --wsrep_node_address="$ipaddr" $CMDARG