Skip to content
This repository was archived by the owner on Nov 29, 2020. It is now read-only.

Commit edabfb0

Browse files
committed
add tests: repliation
1 parent 2006fb6 commit edabfb0

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ To import a SQL backup which is stored for example in the folder `/tmp` in the h
117117
Where `<user>` and `<pass>` are the database username and password set earlier and `<dump.sql>` is the name of the SQL file to be imported.
118118

119119

120-
Relication - Master/Slave
120+
Replication - Master/Slave
121121
-------------------------
122-
To use MySQL replication, please set environment variable `REPLICATION_MASTER`/`REPLICATION_SLAVE` to `ture`. Also, on master side, you may want to specify `REPLICATION_USER` and `REPLICATION_PASS` for the account to perform replicaiton, the default value is `replica:replica`
122+
To use MySQL replication, please set environment variable `REPLICATION_MASTER`/`REPLICATION_SLAVE` to `ture`. Also, on master side, you may want to specify `REPLICATION_USER` and `REPLICATION_PASS` for the account to perform replication, the default value is `replica:replica`
123123

124124
Examples:
125125
- Master MySQL
@@ -137,7 +137,7 @@ Environment variables
137137
`MYSQL_USER`: Set a specific username for the admin account (default 'admin')
138138
`MYSQL_PASS`: Set a specific password for the admin account.
139139

140-
Compatibiliity Issues
140+
Compatibility Issues
141141
--------------------
142142

143143
- Volume created by MySQL 5.6 cannot be used in MySQL 5.5 Images or MariaDB images

circle.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ dependencies:
77
- docker build -t mysql-5.6 5.6/
88
test:
99
override:
10+
# test mysql 5.5
1011
- docker run -d -p 13306:3306 -e MYSQL_USER="user" -e MYSQL_PASS="test" mysql-5.5; sleep 20
11-
- mysqladmin -uuser -ptest ping -h127.0.0.1 -P13306 | grep -c "mysqld is alive"
12+
- mysqladmin -uuser -ptest -h127.0.0.1 -P13306 ping | grep -c "mysqld is alive"
13+
# test mysql 5.6
1214
- docker run -d -p 13307:3306 -e MYSQL_USER="user" -e MYSQL_PASS="test" mysql-5.6; sleep 20
13-
- mysqladmin -uuser -ptest ping -h127.0.0.1 -P13307 | grep -c "mysqld is alive"
15+
- mysqladmin -uuser -ptest -h127.0.0.1 -P13307 ping | grep -c "mysqld is alive"
16+
# test replication 5.5
17+
- docker run -d -e MYSQL_USER=user -e MYSQL_PASS=test -e REPLICATION_MASTER=true -e REPLICATION_USER=repl -e REPLICATION_PASS=repl -p 13308:3306 --name mysql55master mysql-5.5; sleep 20
18+
- docker run -d -e MYSQL_USER=user -e MYSQL_PASS=test -e REPLICATION_SLAVE=true -p 13309:3306 --link mysql55master:mysql mysql-5.5; sleep 20
19+
- docker logs mysql55master | grep "repl:repl"
20+
- mysql -uuser -ptest -h127.0.0.1 -P13308 -e "show master status\G;" | grep "mysql-bin.*"
21+
- mysql -uuser -ptest -h127.0.0.1 -P13309 -e "show slave status\G;" | grep 'Slave_IO_Running.*Yes'
22+
# test replication 5.6
23+
- docker run -d -e MYSQL_USER=user -e MYSQL_PASS=test -e REPLICATION_MASTER=true -e REPLICATION_USER=repl -e REPLICATION_PASS=repl -p 13310:3306 --name mysql56master mysql-5.6; sleep 20
24+
- docker run -d -e MYSQL_USER=user -e MYSQL_PASS=test -e REPLICATION_SLAVE=true -p 13311:3306 --link mysql56master:mysql mysql-5.6; sleep 20
25+
- docker logs mysql56master | grep "repl:repl"
26+
- mysql -uuser -ptest -h127.0.0.1 -P13310 -e "show master status\G;" | grep "mysql-bin.*"
27+
- mysql -uuser -ptest -h127.0.0.1 -P13311 -e "show slave status\G;" | grep "Slave_IO_Running.*Yes'

0 commit comments

Comments
 (0)