You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker-compose up -d
docker-compose exec mysql1 mysqlsh -f /init.js
Test access to the cluster
# test access to read/write instance, should be always mysql1
docker-compose exec router mysql -h 127.0.0.1 -P 6446 -e 'SELECT @@hostname'# test access to read only instance, should be round robin of mysql2 and mysql3
docker-compose exec router mysql -h 127.0.0.1 -P 6447 -e 'SELECT @@hostname'
Try dropping a read only node
# kill a read only node
docker-compose kill mysql3
# the log should show that:# - 'Member with address mysql3:3306 has become unreachable.# - 'Members removed from the group: mysql3:3306'
docker-compose logs -f --tail 10 mysql2
# read only access is now provided by mysql3 solely
docker-compose exec router mysql -h 127.0.0.1 -P 6447 -e 'SELECT @@hostname'# restore the node
docker-compose up -d mysql3
# the log should show that:# - 'The member with address mysql3:3306 was declared online within the replication group.'
docker-compose logs -f --tail 10 mysql2
Try dropping the primary node
# kill the primary node
docker-compose kill mysql1
# the log should show that:# - 'Member with address mysql1:3306 has become unreachable.# - either mysql2 or mysql3 becomes the new primary
docker-compose logs -f --tail 10 mysql2
# read/write access is now provided by mysql2
docker-compose exec router mysql -h 127.0.0.1 -P 6446 -e 'SELECT @@hostname'# restore the node
docker-compose up -d mysql1
# the log should show that:# - 'The member with address mysql1:3306 was declared online within the replication group.'
docker-compose logs -f --tail 10 mysql2
# read only access should be round robin of mysql1 and mysql3
docker-compose exec router mysql -h 127.0.0.1 -P 6447 -e 'SELECT @@hostname'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters