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

Commit

Permalink
add tests: repliation
Browse files Browse the repository at this point in the history
  • Loading branch information
tifayuki committed Sep 11, 2014
1 parent 2006fb6 commit edabfb0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ To import a SQL backup which is stored for example in the folder `/tmp` in the h
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.


Relication - Master/Slave
Replication - Master/Slave
-------------------------
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`
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`

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

Compatibiliity Issues
Compatibility Issues
--------------------

- Volume created by MySQL 5.6 cannot be used in MySQL 5.5 Images or MariaDB images
18 changes: 16 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ dependencies:
- docker build -t mysql-5.6 5.6/
test:
override:
# test mysql 5.5
- docker run -d -p 13306:3306 -e MYSQL_USER="user" -e MYSQL_PASS="test" mysql-5.5; sleep 20
- mysqladmin -uuser -ptest ping -h127.0.0.1 -P13306 | grep -c "mysqld is alive"
- mysqladmin -uuser -ptest -h127.0.0.1 -P13306 ping | grep -c "mysqld is alive"
# test mysql 5.6
- docker run -d -p 13307:3306 -e MYSQL_USER="user" -e MYSQL_PASS="test" mysql-5.6; sleep 20
- mysqladmin -uuser -ptest ping -h127.0.0.1 -P13307 | grep -c "mysqld is alive"
- mysqladmin -uuser -ptest -h127.0.0.1 -P13307 ping | grep -c "mysqld is alive"
# test replication 5.5
- 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
- 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
- docker logs mysql55master | grep "repl:repl"
- mysql -uuser -ptest -h127.0.0.1 -P13308 -e "show master status\G;" | grep "mysql-bin.*"
- mysql -uuser -ptest -h127.0.0.1 -P13309 -e "show slave status\G;" | grep 'Slave_IO_Running.*Yes'
# test replication 5.6
- 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
- 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
- docker logs mysql56master | grep "repl:repl"
- mysql -uuser -ptest -h127.0.0.1 -P13310 -e "show master status\G;" | grep "mysql-bin.*"
- mysql -uuser -ptest -h127.0.0.1 -P13311 -e "show slave status\G;" | grep "Slave_IO_Running.*Yes'

0 comments on commit edabfb0

Please sign in to comment.