主库 docker run -itd --name=Master --hostname=Master -e MySQL_Role=Master -e MYSQL_ROOT_PASSWORD=password -e REPLICATION_USER=repluser -e REPLICATION_PASSWORD=88888888 -e MasterIP=192.168.10.19 -e Slave1IP=192.168.10.20 -e MySQLPort=3307 -p 3307:3306 -v /data/mysql3307/:/var/lib/mysql yy666666/mysql-replication:5.7 从库 docker run -itd --name=Slave1 --hostname=Slave1 -e MySQL_Role=Slave1 -e MYSQL_ROOT_PASSWORD=password -e REPLICATION_USER=repluser -e REPLICATION_PASSWORD=88888888 -e MasterIP=192.168.10.19 -e Slave1IP=192.168.10.20 -e MySQLPort=3307 -p 3307:3306 -v /data/mysql3307/:/var/lib/mysql yy666666/mysql-replication:5.7
docker-compose.yaml 主库 MasterNode: hostname: Master environment: MySQL_Role: Master MYSQL_ROOT_PASSWORD: password REPLICATION_USER: repluser REPLICATION_PASSWORD: '88888888' MasterIP: 192.168.10.19 Slave1IP: 192.168.10.20 MySQLPort: 3307 tty: true image: yy666666/mysql-replication:5.7 ports:
docker-compose.yaml 从库 Slave1Node: hostname: Slave1 environment: MySQL_Role: Slave1 MYSQL_ROOT_PASSWORD: password REPLICATION_USER: repluser REPLICATION_PASSWORD: '88888888' MasterIP: 192.168.10.19 Slave1IP: 192.168.10.20 MySQLPort: 3307 tty: true image: yy666666/mysql-replication:5.7 ports:
Content type
Image
Digest
Size
118.4 MB
Last updated
over 7 years ago
docker pull yy666666/mysql-replication:5.7