-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into develop
- Loading branch information
Showing
13 changed files
with
233 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '2' | ||
services: | ||
maxscale: | ||
depends_on: | ||
- db | ||
ports: | ||
- 4006:4006 | ||
- 4007:4007 | ||
- 4008:4008 | ||
build: | ||
context: . | ||
dockerfile: maxscale/Dockerfile | ||
args: | ||
MAXSCALE_VERSION: $MAXSCALE_VERSION | ||
db: | ||
image: $DB | ||
command: --max-allowed-packet=$PACKET --innodb-log-file-size=$INNODB_LOG_FILE_SIZE --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 | ||
ports: | ||
- 3305:3306 | ||
volumes: | ||
- $SSLCERT:/etc/sslcert | ||
- $ENTRYPOINT:/docker-entrypoint-initdb.d | ||
environment: | ||
MYSQL_DATABASE: testj | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
FROM asosso/maxscale:1.4.3 | ||
FROM centos:7 | ||
|
||
# bring system up2date | ||
#RUN yum update -y | ||
RUN yum -y install MariaDB-client | ||
ARG MAXSCALE_VERSION | ||
ENV MAXSCALE_VERSION ${MAXSCALE_VERSION:-2.1.4} | ||
|
||
# We copy our config creator script to the container | ||
COPY maxscale/docker-entrypoint.sh / | ||
COPY maxscale/cmd.sh /usr/bin/ | ||
COPY maxscale/mariadb.repo /etc/yum.repos.d/ | ||
|
||
RUN rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB \ | ||
&& yum -y install https://downloads.mariadb.com/MaxScale/$MAXSCALE_VERSION/centos/7/x86_64/maxscale-$MAXSCALE_VERSION-1.centos.7.x86_64.rpm \ | ||
&& yum -y update | ||
|
||
RUN yum -y install maxscale-$MAXSCALE_VERSION MariaDB-client \ | ||
&& yum clean all \ | ||
&& rm -rf /tmp/* | ||
|
||
COPY maxscale/docker-entrypoint.sh / | ||
RUN chmod 777 /etc/maxscale.cnf | ||
COPY maxscale/maxscale.cnf /etc/ | ||
RUN chmod 777 /docker-entrypoint.sh | ||
RUN chmod 777 /usr/bin/cmd.sh | ||
|
||
# We expose our set Listener Ports | ||
EXPOSE 4006 4007 | ||
|
||
# We define the config creator as entrypoint | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
EXPOSE 4006 4007 4008 | ||
|
||
# We startup MaxScale as default command | ||
CMD ["/usr/bin/cmd.sh"] | ||
ENTRYPOINT ["/docker-entrypoint.sh"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,35 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
config_file="/etc/maxscale.cnf" | ||
echo 'creating configuration done' | ||
|
||
# We start config file creation | ||
sleep 15 | ||
|
||
cat <<EOF > $config_file | ||
################################################################################################# | ||
# wait for db availability for 60s | ||
################################################################################################# | ||
mysql=( mysql --protocol=tcp -ubob -hdb --port=3306 ) | ||
for i in {60..0}; do | ||
if echo 'use test2' | "${mysql[@]}" &> /dev/null; then | ||
break | ||
fi | ||
echo 'DB init process in progress...' | ||
sleep 1 | ||
done | ||
|
||
echo 'use test2' | "${mysql[@]}" | ||
if [ "$i" = 0 ]; then | ||
echo 'DB init process failed.' | ||
exit 1 | ||
fi | ||
|
||
[maxscale] | ||
threads=2 | ||
log_messages=1 | ||
log_trace=1 | ||
log_debug=1 | ||
echo 'maxscale launching ...' | ||
|
||
[db] | ||
type=server | ||
address=db | ||
port=3306 | ||
protocol=MySQLBackend | ||
authenticator_options=skip_authentication=true | ||
router_options=master | ||
tail -n 500 /etc/maxscale.cnf | ||
|
||
[Galera Monitor] | ||
type=monitor | ||
module=mysqlmon | ||
servers=db | ||
user=boby | ||
passwd=hey | ||
monitor_interval=1000 | ||
/usr/bin/maxscale --nodaemon | ||
|
||
[qla] | ||
type=filter | ||
module=qlafilter | ||
options=/tmp/QueryLog | ||
[fetch] | ||
type=filter | ||
module=regexfilter | ||
match=fetch | ||
replace=select | ||
[hint] | ||
type=filter | ||
module=hintfilter | ||
[Write Connection Router] | ||
type=service | ||
router=readconnroute | ||
servers=db | ||
user=boby | ||
passwd=hey | ||
router_options=master | ||
localhost_match_wildcard_host=1 | ||
version_string=10.2.99-MariaDB-maxscale | ||
[Read Connection Router] | ||
type=service | ||
router=readconnroute | ||
servers=db | ||
user=boby | ||
passwd=hey | ||
router_options=synced | ||
localhost_match_wildcard_host=1 | ||
version_string=10.2.99-MariaDB-maxscale | ||
[RW Split Router] | ||
type=service | ||
router=readwritesplit | ||
servers=db | ||
user=boby | ||
passwd=hey | ||
max_slave_connections=100% | ||
localhost_match_wildcard_host=1 | ||
router_options=disable_sescmd_history=true | ||
version_string=10.2.99-MariaDB-maxscale | ||
[CLI] | ||
type=service | ||
router=cli | ||
[RW Split Listener] | ||
type=listener | ||
service=RW Split Router | ||
protocol=MySQLClient | ||
port=4006 | ||
socket=/var/lib/maxscale/rwsplit.sock | ||
[Write Connection Listener] | ||
type=listener | ||
service=Write Connection Router | ||
protocol=MySQLClient | ||
port=4007 | ||
socket=/var/lib/maxscale/writeconn.sock | ||
[Read Connection Listener] | ||
type=listener | ||
service=Read Connection Router | ||
protocol=MySQLClient | ||
port=4008 | ||
socket=/var/lib/maxscale/readconn.sock | ||
[CLI Listener] | ||
type=listener | ||
service=CLI | ||
protocol=maxscaled | ||
socket=/tmp/maxadmin.sock | ||
EOF | ||
|
||
echo 'creating configuration' | ||
exec "$@" | ||
cd /var/log/maxscale | ||
ls -lrt | ||
tail -n 500 /var/log/maxscale/maxscale.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# MariaDB 10.2 CentOS repository list - created 2017-06-05 08:06 UTC | ||
# http://downloads.mariadb.org/mariadb/repositories/ | ||
[mariadb] | ||
name = MariaDB | ||
baseurl = http://yum.mariadb.org/10.2/centos7-amd64 | ||
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | ||
gpgcheck=1 |
Oops, something went wrong.