AliyunContainerService / redis-cluster

HA Redis Cluster with Sentinel by Docker Compose
Apache License 2.0
458 stars 203 forks source link

how to cancel bind 127.0.0.1 #14

Open hisenyuan opened 6 years ago

ScottAlone commented 6 years ago
  1. configure ports you what to expose
    master:
    image: redis:3
    ports:
    - "7001:6379"
    slave:
    image: redis:3
    command: redis-server --slaveof redis-master 6379
    links:
    - master:redis-master
    ports:
    - "7002:6379"
    sentinel:
    build: sentinel
    environment:
    - SENTINEL_DOWN_AFTER=5000
    - SENTINEL_FAILOVER=5000
    - SENTINEL_QUORUM 1
    links:
    - master:redis-master
    - slave
    ports:
    - "7003:26379"

what were modified:

  1. check your firewall/iptables, be sure you have exposed the port 7001-7003 configured above

ps: if you what to scale the number of salves or sentinels, add more instance in the docker-compose.yml

reference: https://redis.io/topics/sentinel