a helper for running InnoDB Cluster on docker
- examples/ # examples to run
- image/ # Dockerfile and image builder
% (cd image && make install)
% docker images | grep innodb-cluster | less -S
innodb-cluster 0.8.4 01743be6054c
innodb-cluster latest 01743be6054c
- build configs
- start containers
- setup cluster
- run mysql-router
- use cluster via router
In this example, we will use following ports on local server.
- 9001 - 9003 : for MySQL Servers
- 9011 - 9014 : for MySQL Router
Please edit docker-compose.yml
and Makefile
as you like.
cd examples/local/
make build
This generates files in v/900*/conf/*
.
MySQL server containers mount each directories.
If you need to add special settings, edit those configs before starting containers.
docker-compose up -d
docker-compose logs
Please wait a few sec until following message appears.
mysql-9003 | MySQL init process done. Ready for start up.
Now, we have three MySQL instances on port 9001, 9002, 9003 and also have ic
user on each nodes.
The operation will be shown by following command.
% make cluster
Run mysqlrouter bootstrap on router
container.
The operation will be shown by following command.
% make router
% make usage
Here, assumed that our IP Address of the docker host is 192.168.237.128
.
- router for primary node(read,write) : 9011
- back server : 9001 (it should be)
The operation will be shown by following command.
% mysql -h 192.168.237.128 -P 9011 -uic -proot
mysql> select @@port;
+--------+
| @@port |
+--------+
| 9001 |
+--------+
- router for secondary node(read-only) : 9012
- back server : 9002 or 9003
% mysql -h 192.168.237.128 -P 9012 -uic -proot
mysql> select @@port;
+--------+
| @@port |
+--------+
| 9003 |
+--------+
/etc/init.d/mysql: line 63: /lib/apparmor/profile-load: No such file or directory
I'd like to resolve this error.