docker swarm mysql service, when scaled not working

twitter logo ・1 min read

I simply created one swarm node (master). Wrote a docker-compose with multiple service one of them is mysql. Now, when I scale mysql container I get connection issue. The mysql has a volume defines as

  - ./mysql:/var/lib/mysql
twitter logo DISCUSS (1)
markdown guide

Mysql is not a nosql db with their “easy” scaling out... You cannot run multiple instances on one data folder, this wound’t work - locking, caching and data consistency cannot be maintaned that way. Mysql uses classic master/slave replication process and it is not that simple. You need to explicitly configure this and then writes to master are automatically mirrored to slaves. There are currently more modes of replications. Use google and look for terms like mysql replication

Classic DEV Post from Mar 28

JavaScript One-Liners That Make Me Excited

A collection of smart and zany solutions to some common, and quite uncommon, problems.

taragurung profile image
Software engineer trying to make the software delivery pipeline better with DEVOPS.