GROUPReplicate2: docker-compose.yml

File docker-compose.yml, 1.1 KB (added by krit, 2 years ago)
Line 
1version: "3.3"
2
3services:
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
47networks:
48  mysqlnet:
49
50volumes:
51  mysql_master:
52  mysql_replica: