1

I want to establish a Galera Cluster with three nodes, all on different hosts. The first one starts normally and the cluster is ready, but only native installations of MariaDB can join it, Docker containers don't. It is strange that native nodes can join whereas my containers just seem to ignore it.

Logs of the first node: http://txt.do/dzjy7

Logs of the second node: http://txt.do/dzjyy

The first node is started with:

sudo docker run \
--name mariadb-0 \
-d \
-v mysql.conf.d:/etc/mysql/conf.d \
-v mysql:/var/lib/mysql \
-e MYSQL_INITDB_SKIP_TZINFO=yes \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
-p 3306:3306 \
-p 4567:4567/udp \
-p 4567-4568:4567-4568 \
-p 4444:4444 \
mariadb:latest \
--wsrep-new-cluster \
--wsrep_node_address=$(ip -4 addr ls eth0 | awk '/inet / {print $2}' | cut -d"/" -f1)

Additional nodes are started the almost the same way:

sudo docker run \
--name mariadb-0 \
-d \
-v mysql.conf.d:/etc/mysql/conf.d \
-v mysql:/var/lib/mysql \
-e MYSQL_INITDB_SKIP_TZINFO=yes \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
-p 3306:3306 \
-p 4567:4567/udp \
-p 4567-4568:4567-4568 \
-p 4444:4444 \
mariadb:latest \
--wsrep_node_address=$(ip -4 addr ls eth0 | awk '/inet / {print $2}' | cut -d"/" -f1)

Every node uses this config file server.conf:

[server]
bind-address=0.0.0.0
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
innodb_locks_unsafe_for_binlog=1
query_cache_size=0
query_cache_type=0

[galera]
wsrep_on=ON
wsrep_provider="/usr/lib/galera/libgalera_smm.so"
wsrep_cluster_address="gcomm://XXX.XXX.XXX.XXX,YYYY.YYYY.YYYY.YYYY,ZZZZ.ZZZZ.ZZZZ.ZZZZ"
wsrep-sst-method=rsync

0 Answers0