0

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?

1
  • Hey, did you solve that problem ? Commented Feb 9, 2018 at 16:32

1 Answer 1

0

From the redis cluster docs:

cluster-config-file : Note that despite the name of this option, this is not an user editable configuration file, but the file where a Redis Cluster node automatically persists the cluster configuration (the state, basically) every time there is a change, in order to be able to re-read it at startup.

Are you sharing the volume where this is saved across the cluster? That would seem to be the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.