Closed mrwormo closed 1 year ago
Can you include the exact reproduction steps?
Sure.
docker volume create mariadb && docker network create netdb
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
de5df03fb922 bridge bridge local
37dbdfd63c64 host host local
eef2aedf9116 netdb bridge local
galera.cnf
is in .conf/
subfoldergalera.cnf
and docker-compose.yml
on the first node
[mysqld]
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
log_slave_updates=ON
log_bin=galera-bin
wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="galera_cluster"
wsrep_sst_method=rsync
wsrep_node_address="10.10.1.28" wsrep_node_name="node1"
version: '3.0' services:
mariadb:
image: mariadb:10.3
container_name: mariadb
hostname: mariadb
command: --wsrep_cluster_address=gcomm://
ports:
- 3306:3306
- 4444:4444
- 4567:4567
- 4568:4568
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PWD}
- TZ=Europe/Paris
volumes:
- ./conf:/etc/mysql/conf.d
- mariadb:/var/lib/mysql
networks:
- netdb
phpmyadmin: image: phpmyadmin:latest container_name: phpmyadmin hostname: phpmyadmin environment:
networks: netdb: external: true
volumes: mariadb: external: true
5. Here are `galera.cnf` and `docker-compose.yml` on the second node
[mysqld] binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 bind-address=0.0.0.0 log_slave_updates=ON log_bin=galera-bin
wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="galera_cluster"
wsrep_sst_method=rsync
wsrep_node_address="10.10.1.16" wsrep_node_name="node2"
version: '3.0' services:
mariadb:
image: mariadb:10.3
container_name: mariadb
hostname: mariadb
command: --wsrep_cluster_address=gcomm://10.10.1.28,10.10.1.16
ports:
- 3306:3306
- 4444:4444
- 4567:4567
- 4568:4568
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PWD}
- TZ=Europe/Paris
volumes:
- ./conf:/etc/mysql/conf.d
- mariadb:/var/lib/mysql
#network_mode: host
networks:
- netdb
phpmyadmin: image: phpmyadmin:latest container_name: phpmyadmin hostname: phpmyadmin environment:
networks: netdb: external: true
volumes: mariadb: external: true
6. Then, `docker-compose up -d` on the first node
7. Once i see the following line in docker logs, i launch docker-compose on the second node :
`[Note] WSREP: Synchronized with group, ready for connections`
I did a test by launching the same stack but on the same server with only one docker-compose : everything works perfectly.
Any idea what could go wrong ?
@mrwormo I also had a similar bind error when running under docker. To fix it I had to run docker with the --network host
option. Here's where I found the answer: https://mariadb.com/kb/en/ist-replication-failing-on-2-node-galera-mariadb-setup/
Hello to all,
I can't running a working Galera Cluster (2 nodes - 2 servers) with MariaDb.10.4+ but all is running fine with MariaDb.10.3.
The first node bootstrap the cluster without errors.
Here is the end of the docker log from the second node :
Any help will be appreciated. Thx by advance.