I am a newbie to Docker swarm. I was trying to deploy redis cluster on Docker swarm with compose file. I want the redis cluster use port 6380 so I configured the port and made it mount the redis configure file in compose file.
But when I ran docker stack deploy --compose-file docker-compose.yml node
, I got an erro states that "Sorry, the cluster configuration file redis-node.conf is already used by a different Redis Cluster node. Please make sure that different nodes use different cluster configuration files."
Here is my docker-compose.yml
version: "3"
services:
redis-node:
image: redis:3.2
ports:
- 6380
deploy:
replicas: 6
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
volumes:
- /var/docker/redis/node:/data
command:
redis-server --port 6380 --logfile redis-node.log --appendonly yes --appendfilename redis-node.aof --appendfsync everysec --cluster-enabled yes --cluster-config-file redis-node.conf
restart: always
How can I deploy redis cluster mounted with redis.conf in Docker swarm mode?