diff --git a/README.md b/README.md index d3c815d..846dbf9 100644 --- a/README.md +++ b/README.md @@ -117,9 +117,9 @@ To import a SQL backup which is stored for example in the folder `/tmp` in the h Where `` and `` are the database username and password set earlier and `` 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 @@ -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 diff --git a/circle.yml b/circle.yml index 360ad77..eb6d365 100644 --- a/circle.yml +++ b/circle.yml @@ -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" \ No newline at end of file + - 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"