Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crossz opened this issue Sep 17, 2016 · 4 comments
Closed

Comments

@crossz
Copy link

crossz commented Sep 17, 2016

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?

@crossz
Copy link
Author

crossz commented Sep 17, 2016

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

@crossz crossz closed this as completed Sep 17, 2016
@denverdino
Copy link
Collaborator

nice!

@crossz
Copy link
Author

crossz commented Sep 17, 2016

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

@crossz
Copy link
Author

crossz commented Sep 17, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants