Skip to content

Commit 790fcc6

Browse files
committed
Minor changes after testing
1 parent 13baf2c commit 790fcc6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

mariadb/vote/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Start the Viz:
2727

2828
$ cd common/viz
2929
$ source scripts/setup.sh
30-
$ scripts/up.sh swarm-0
30+
$ docker stack deploy viz -c docker-compose.stack.yml
3131
$ echo "$(docker-machine ip swarm-0) viz.myapp.com" | sudo tee -a /etc/hosts
3232

3333
The app will be available at http://viz.myapp.com:3000

mariadb/vote/prod/galera/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ To start app in production:
88
$ cd prod/galera
99
$ source ../scripts/setup.sh
1010
$ docker network create -d overlay --attachable myapp_back
11-
$ docker secret create mariadb_root_password mariadb_password.txt
1211
$ docker stack deploy myapp -c docker-compose.stack.yml
1312
$ docker-compose -f schema.yml up
1413

@@ -66,3 +65,10 @@ You can log onto the MariaDB and look at data
6665
+--------------------+-------+
6766
1 row in set (0.00 sec)
6867

68+
## Running demo - Part Four: MaxScale routing tier in production
69+
70+
$ docker stack scale myapp_maxscale=4
71+
72+
You can use maxadmin to view request routing
73+
74+
$ docker $(docker-machine config swarm-2) exec -it 63bb00e678b4 maxadmin show services

mariadb/vote/prod/galera/docker-compose.stack.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ services:
1919
networks:
2020
- front
2121
- back
22-
depends_on:
23-
- web
2422
volumes:
2523
- /var/run/docker.sock:/var/run/docker.sock
2624
ports:
@@ -51,13 +49,11 @@ services:
5149

5250
mariadb_cluster:
5351
image: alvinr/mariadb-galera-swarm
54-
# image: colinmollenhour/mariadb-galera-swarm
5552
environment:
5653
MYSQL_ROOT_PASSWORD_FILE: "/run/secrets/mariadb_root_password"
5754
XTRABACKUP_PASSWORD_FILE: "/run/secrets/xtrabackup_password"
5855
CLUSTER_NAME: "prod-vote"
5956
NODE_ADDRESS: "eth0"
60-
CLIENT_NODE_ADDR: "10.0.0.%"
6157
MYSQL_USER: "app"
6258
MYSQL_DATABASE: "test"
6359
MYSQL_PASSWORD_FILE: "/run/secrets/app_password"
@@ -78,13 +74,11 @@ services:
7874

7975
mariadb_cluster_node:
8076
image: alvinr/mariadb-galera-swarm
81-
# image: colinmollenhour/mariadb-galera-swarm
8277
environment:
8378
MYSQL_ROOT_PASSWORD_FILE: "/run/secrets/mariadb_root_password"
8479
XTRABACKUP_PASSWORD_FILE: "/run/secrets/xtrabackup_password"
8580
CLUSTER_NAME: "prod-vote"
8681
NODE_ADDRESS: "eth0"
87-
CLIENT_NODE_ADDR: "10.0.0.%"
8882
MYSQL_USER: "app"
8983
MYSQL_DATABASE: "test"
9084
MYSQL_PASSWORD_FILE: "/run/secrets/app_password"
@@ -109,15 +103,15 @@ services:
109103
DB_SERVICE_NAMES: "myapp_mariadb_cluster myapp_mariadb_cluster_node"
110104
DB_TARGET_COUNT: "3"
111105
ENABLE_ROOT_USER: "false"
112-
# MAX_USER: "root"
113-
# MAX_PASS_FILE: "/run/secrets/mariadb_root_password"
114106
MAX_USER: "app"
115107
MAX_PASS_FILE: "/run/secrets/app_password"
116108
labels:
117109
com.mariadb.cluster: "myapp-maxscale"
118110
networks:
119111
- back
120112
deploy:
121-
replicas: 1
113+
replicas: 2
114+
placement:
115+
constraints: [engine.labels.com.mariadb.cluster != myapp-maxscale]
122116
secrets:
123117
- app_password

0 commit comments

Comments
 (0)