I have the below cassandra-compose.yml file which I am trying to deploy on a docker swarm with the below command.
docker stack deploy --compose-file=cassandra-compose.yml cassandra-service
Issue:-
The Service is getting created but no replicas are running.When I inspected the issue, I found that because the mounted folder ie. ~/user/cassandraBackup is not present and that is why the container isn't started.
I tried to run it using docker-compose and it got executed successfully. Can somebody tell me how to run it using stack-deploy
Cassandra-compose.yml:-
version: '3.1'
services:
multinode:
image: cassandra:3.9
deploy:
replicas: 2
volumes:
- ~/user/cassandraBackup/:/var/lib/cassandra/data
ports:
- 7000:7000
- 7001:7001
- 7199:7199
- 9042:9042
- 9160:9160