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

Redis-proxy startup fails when a redis cluster node is down #110

Open
hac3ru opened this issue Oct 7, 2022 · 2 comments
Open

Redis-proxy startup fails when a redis cluster node is down #110

hac3ru opened this issue Oct 7, 2022 · 2 comments

Comments

@hac3ru
Copy link

hac3ru commented Oct 7, 2022

Hello,

First, let me start by saying that I've been waiting for this product for quite some time, as it makes all our lives easier!
I've got the following setup:
Running 6 redis instances containers (for simplicity), using docker-compose with network_mode: host (for simplicity).
I've started redis-cluster-proxy using
command: -p 6379 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006

Everything is well, until one of the nodes are down and I try to start up redis-cluster-proxy.
How to reproduce:
Build a container with redis-cluster-proxy from github, branch 1.0, using the Dockerfile provided by bsergean on Issue #23 (#23) by running
docker build -t redis-proxy .

Use the following docker-compose.yml file:


services:
  proxy:
    image: redis-proxy
    container_name: proxy
    network_mode: host
    command: -p 6379 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006

  r1:
    image: redis:7.0.2-alpine
    container_name: r1
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7001

  r2:
    image: redis:7.0.2-alpine
    container_name: r2
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7002

  r3:
    image: redis:7.0.2-alpine
    container_name: r3
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7003

  r4:
    image: redis:7.0.2-alpine
    container_name: r4
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7004

  r5:
    image: redis:7.0.2-alpine
    container_name: r5
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7005

  r6:
    image: redis:7.0.2-alpine
    container_name: r6
    volumes:
      - ./redis.conf:/etc/redis/redis.conf
    network_mode: host
    command: /etc/redis/redis.conf --port 7006

Create the actual cluster using
redis-cli --port 7001 --cluster create --cluster-replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006

Start the proxy using docker restart proxy and inspect the logs docker logs proxy. Everything should be fine.
Stop one instance: docker stop r1

Restart the proxy: docker restart proxy and inspect the logs docker logs proxy.

This error shows up:

[2022-10-07 06:27:55.919/M] Redis Cluster Proxy v0.9.102
[2022-10-07 06:27:55.919/M] Commit: (00000000/0)
[2022-10-07 06:27:55.919/M] PID: 1
[2022-10-07 06:27:55.919/M] OS: Linux 5.4.0-126-generic x86_64
[2022-10-07 06:27:55.919/M] Bits: 64
[2022-10-07 06:27:55.919/M] Log level: info
[2022-10-07 06:27:55.919/M] Connections pool size: 10 (respawn 2 every 50ms if below 10)
[2022-10-07 06:27:55.920/M] Listening on *:6379
[2022-10-07 06:27:55.920/M] Starting 8 threads...
[2022-10-07 06:27:55.920/M] Fetching cluster configuration...
[2022-10-07 06:27:55.920/M] Could not connect to Redis at 127.0.0.1:7001: Connection refused
Could not connect to Redis at 127.0.0.1:7001: Connection refused
[2022-10-07 06:27:55.921/M] ERROR: Failed to fetch cluster configuration!
[2022-10-07 06:27:55.922/M] FATAL: failed to create thread 0.
@hac3ru hac3ru changed the title Redis-proxy startup fails when the redis cluster node is down Redis-proxy startup fails when a redis cluster node is down Oct 10, 2022
@codifierr
Copy link

Any update on this?
We are also facing the same.

@thanghp2711
Copy link

I'm facing this issue too, any solutions?

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

3 participants