docker-compose.yml 如下,其实就是官网的配置 services: mgr2: image: greatsql/greatsql container_name: mgr2 hostname: mgr2 networks: mgr_net: ipv4_address: 172.18.0.2 restart: unless-stopped environment: TZ: Asia/Shanghai MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_INIT_MGR: 1 MYSQL_MGR_LOCAL: '172.18.0.2:33061' MYSQL_MGR_SEEDS: '172.18.0.2:33061,172.18.0.3:33061,172.18.0.4:33061' MYSQL_MGR_START_AS_PRIMARY: 1 MYSQL_MGR_MULTI_PRIMARY: 1 MYSQL_MGR_ARBITRATOR: 0 mgr3: image: greatsql/greatsql container_name: mgr3 hostname: mgr3 networks: mgr_net: ipv4_address: 172.18.0.3 restart: unless-stopped depends_on: - "mgr2" environment: TZ: Asia/Shanghai MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_INIT_MGR: 1 MYSQL_MGR_LOCAL: '172.18.0.3:33061' MYSQL_MGR_SEEDS: '172.18.0.2:33061,172.18.0.3:33061,172.18.0.4:33061' MYSQL_MGR_START_AS_PRIMARY: 0 MYSQL_MGR_MULTI_PRIMARY: 1 MYSQL_MGR_ARBITRATOR: 0 mgr4: image: greatsql/greatsql container_name: mgr4 hostname: mgr4 networks: mgr_net: ipv4_address: 172.18.0.4 restart: unless-stopped depends_on: - "mgr3" environment: TZ: Asia/Shanghai MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_INIT_MGR: 1 MYSQL_MGR_LOCAL: '172.18.0.4:33061' MYSQL_MGR_SEEDS: '172.18.0.2:33061,172.18.0.3:33061,172.18.0.4:33061' MYSQL_MGR_START_AS_PRIMARY: 0 MYSQL_MGR_MULTI_PRIMARY: 1 MYSQL_MGR_ARBITRATOR: 0 networks: mgr_net: ipam: config: - subnet: 172.18.0.0/24 然后启动 docker-compose up -d mysql select * from performance_schema.replication_group_members; 如下图所示: 有一个 MEMBER 离线,另外两个不在这里,想问下原因 服务器: |
yejr
2024-12-24 17:02:27
| ||
JasonPan
2024-12-24 17:11:20
| ||
yejr
2024-12-25 08:46:08
| ||
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com