AliyunContainerService / redis-cluster

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

Unable to connect on port 26379 port. #9

Open santosh2812 opened 7 years ago

santosh2812 commented 7 years ago

Hi, I have configured the redis sentinel on Docker but am not able to understand how to do below points -

  1. How to expose the port 26379 by using sentinel announce-ip (my system Ip) to connect from out side.
  2. As we will get the master Information from The sentinels - which one I have 3.
  3. Do we need to wright the logic to connect with the master in our application (MVC C#) to connect with the Details got form the point no 2. or How.
  4. Do we need to expose the Slaves also. how. attaching my docker file and sentinel conf file and sentinel Entry file. redis-Sentinel.zip Please have a look - have tried all the way but unable to achieve. Thanks
xiaoluozai commented 6 years ago

Update the docker-compose.yml like this: master: image: redis:3 ports:

Dureaghin commented 5 years ago

If you scale: docker-compose scale slave=2 sentinel=3

ERROR: for redis-cluster_sentinel_3 Cannot start service sentinel: b'driver failed programming external connectivity on endpoint redis-cluster_sentinel_3 (b34a2fc5ae555fb9e64ee5e5007a7d1eb7946a6a1ce80a865555213ad667f237): Bind for 0.0.0.0:26379 failed: port is already allocated' ERROR: Cannot start service sentinel: b'driver failed programming external connectivity on endpoint redis-cluster_sentinel_2 (3d86aadc0c397001bd3b24e31b644892938e4c5be89d6bda3757962fa025d659): Bind for 0.0.0.0:26379 failed: port is already allocated'

pubudu-genesiis commented 3 years ago

I'm getting the same error as Dureaghin

pubudu-genesiis commented 3 years ago

version: "2" services: redis-master: image: redis:5.0.4-alpine ports: [192.168.99.100:6379:6379] command:

  • redis-server redis-slave: image: redis:5.0.4-alpine ports: [192.168.99.100:63792:6379] command:
  • redis-server
  • --slaveof redis-master 6379 links:
  • redis-master depends_on:
  • redis-master redis-sentinel: build: sentinel ports: [26379:26379] environment:
  • SENTINEL_DOWN_AFTER=5000
  • SENTINEL_FAILOVER=5000 links:
  • redis-master depends_on:
  • redis-slave