AliyunContainerService/redis-cluster

howto make "redis-server --slaveof" work for redis node with protected mode

crossz opened this issue · 4 comments

If I use 'redis-server --requirepass XXX' or attach my redis.conf with requirepass directive, I could not make the command of 'redis-server --slaveof' work within the slave container.

do you know how to fix this?

Figure it out.

redis-cli -h slave -a master-password config set masterauth master-password 
redis-cli -h slave -a masterpassword slaveof redis-master 6379

nice!

but it seems can not do failover correctly after the redis-master recovered.......

OK. fix it.

I put the --slaveof into the entrypoint.sh within sentinel.

while the "command" of docker-compose.yml should be like following:

master:
  image: redis:3
  command: redis-server --requirepass PW --masterauth PW
slave:
  image: redis:3
  command: redis-server --requirepass PW --masterauth PW
  links:
    - master:redis-master
sentinel:
  build: sentinel
  environment:
    - SENTINEL_DOWN_AFTER=5000
    - SENTINEL_FAILOVER=5000
    - REQUIREPASS=PW
  links:
    - master:redis-master
    - slave