1 | version: "3.3" |
---|
2 | |
---|
3 | services: |
---|
4 | master: |
---|
5 | hostname: 'node1' |
---|
6 | image: mysqlubuntu:latest |
---|
7 | environment: |
---|
8 | # - MYSQL_ROOT_PASSWORD=password |
---|
9 | # - MYSQL_USER=testuser |
---|
10 | # - MYSQL_PASSWORD=password |
---|
11 | # - MYSQL_DATABASE=testdb |
---|
12 | # - REPLICATION_USER=repl_user |
---|
13 | # - REPLICATION_PASSWORD=repl_pass |
---|
14 | volumes: |
---|
15 | - mysql_master:/var/lib/mysql |
---|
16 | ports: |
---|
17 | - "3306" |
---|
18 | networks: |
---|
19 | - mysqlnet |
---|
20 | deploy: |
---|
21 | placement: |
---|
22 | constraints: |
---|
23 | - node.role == manager |
---|
24 | replica: |
---|
25 | #image: actency/docker-mysql-replication:5.7 |
---|
26 | image: ktmysql:v1 |
---|
27 | environment: |
---|
28 | - MYSQL_ROOT_PASSWORD=password |
---|
29 | - MYSQL_USER=testuser |
---|
30 | - MYSQL_PASSWORD=password |
---|
31 | - MYSQL_DATABASE=testdb |
---|
32 | - REPLICATION_USER=repl_user |
---|
33 | - REPLICATION_PASSWORD=repl_pass |
---|
34 | - MASTER_HOST=master |
---|
35 | - MASTER_PORT=3306 |
---|
36 | volumes: |
---|
37 | - mysql_replica:/var/lib/mysql |
---|
38 | ports: |
---|
39 | - "3306" |
---|
40 | networks: |
---|
41 | - mysqlnet |
---|
42 | deploy: |
---|
43 | replicas: 2 |
---|
44 | placement: |
---|
45 | constraints: |
---|
46 | - node.role == manager |
---|
47 | networks: |
---|
48 | mysqlnet: |
---|
49 | |
---|
50 | volumes: |
---|
51 | mysql_master: |
---|
52 | mysql_replica: |
---|