我需要一些帮助。如何将 docker-compose 上的Percona XtraDB 集群引导为第一个节点?
我有这个my.cnf文件
wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
wsrep_cluster_name=pxc-cluster
wsrep_cluster_address=gcomm://192.168.56.15,192.168.56.20,192.168.56.25
wsrep_node_name=pxc1
wsrep_node_address=192.168.56.15
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth=xtrabackup:1q2w3e4r
pxc_strict_mode=ENFORCING
!include /etc/mysql/node.cnf
和docker-compose.yml
version: '2'
services:
percona-xtradb-cluster:
container_name: pxc_node
image: 'percona/percona-xtradb-cluster:5.7'
environment:
- MYSQL_ROOT_PASSWORD=root
- CLUSTER_NAME=pxc-cluster
- XTRABACKUP_PASSWORD=1q2w3e4r
ports:
- 3306:3306
- 4567:4567
- 4568:4568
- 4444:4444
volumes:
- /etc/percona.d/my.cnf:/etc/my.cnf
运行sudo docker-compose up -d