I am new to docker, so probably I am not doing right. But I would like to ask your thought.
I am just trying to create a simple mysql service on docker swarm 1.12.1 with volume.
I am using mysql image pulled from docker hub.
docker service create --name second-mysql --replicas 2 -p 3306:3306 --env MYSQL_ROOT_PASSWORD=mypwd -mount type=bind,source=/storage/mysql1/datadir,target=/var/lib/mysql mysql
services were created, however second replica is failing saying “task:non-zero exit(1)” when I did docker service ps first-mysql. I looked at syslog, and “fatal task error” … If I created mysql service without volume, both services are working. What am I doing wrong? I really appreciate it.
$ docker service ps second-mysql
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
8vf3djjn5b0bqb3chzg972ri7 second-mysql.1 mysql MSLNXUB001 Running Running about an hour ago
3plr69b4camd7fv7brc1at0n8 second-mysql.2 mysql MSLNXUB001 Running Running 38 seconds ago
cbyejbkvhegk85ly5nn2f2e6f _ second-mysql.2 mysql MSLNXUB001 Shutdown Failed 44 seconds ago "task: non-zero exit (1)"
8zapo4jah6lwr9b0si529crkv _ second-mysql.2 mysql MSLNXUB001 Shutdown Failed 2 minutes ago "task: non-zero exit (1)"
6gcm82bsgqg28oel587m1qxdu _ second-mysql.2 mysql MSLNXUB001 Shutdown Failed 4 minutes ago "task: non-zero exit (1)"
brq2k6o7mgmpoz3q6rkey8npn _ second-mysql.2 mysql MSLNXUB001 Shutdown Failed 6 minutes ago “task: non-zero exit (1)”
Thanks,