Environment - host os: centos8 - docker: 20.10.5 - alpine image: 3.17 - redis 7.0.8

Describe the bug - i tried to create a cluster with three redis nodes in a single pc; - the three nodes bind the same ip(127.0.0.2) and different ports(6371,6372,6373); - when i tried to create a cluster, redis-cli output "Waiting for the cluster to join" and stuck ...

To reproduce - in centos8, create alpine container and attach it

docker run -ti --rm alpine:3.17 /bin/sh
  • in alpine container, install redis with apk, and create redis db dir and log dir
apk update
apk add redis
mkdir /var/lib/redis/637{1..3}
mkdir /var/log/redis/637{1..3}
  • create three redis conf files, here is redis-6371.conf
protected-mode no
maxmemory-policy volatile-random
cluster-enabled yes
port 6371
bind 127.0.0.2
requirepass 12345678
masterauth 12345678
maxmemory 256MB
daemonize yes
dir /var/lib/redis/6371
cluster-config-file /var/lib/redis/6371/nodes.conf
logfile /var/log/redis/6371/redis.log
unixsocket /run/redis/redis-6371.sock
  • here is redis-6372.conf
protected-mode no
maxmemory-policy volatile-random
cluster-enabled yes
port 6372
bind 127.0.0.2
requirepass 12345678
masterauth 12345678
maxmemory 256MB
daemonize yes
dir /var/lib/redis/6372
cluster-config-file /var/lib/redis/6372/nodes.conf
logfile /var/log/redis/6372/redis.log
unixsocket /run/redis/redis-6372.sock
  • here is redis-6373.conf
protected-mode no
maxmemory-policy volatile-random
cluster-enabled yes
port 6373
bind 127.0.0.2
requirepass 12345678
masterauth 12345678
maxmemory 256MB
daemonize yes
dir /var/lib/redis/6373
cluster-config-file /var/lib/redis/6373/nodes.conf
logfile /var/log/redis/6373/redis.log
unixsocket /run/redis/redis-6373.sock
  • start three redis nodes
redis-server redis-6371.conf
redis-server redis-6372.conf
redis-server redis-6373.conf
  • try to create redis cluster with thess three nodes, redis-cli stucked ...
redis-cli -a 12345678 --no-auth-warning --cluster-yes --cluster create 127.0.0.2:6371 127.0.0.2:6372 127.0.0.2:6373
  • here is the output of redis-cli
>>> Performing hash slots allocation on 3 nodes...
Master[0] -> Slots 0 - 5460
Master[1] -> Slots 5461 - 10922
Master[2] -> Slots 10923 - 16383
M: c1949afba2c551e3396665f4a8bc1e284278233f 127.0.0.2:6371
   slots:[0-5460] (5461 slots) master
M: 1c3095daffaa4b7af90f132f3af0a00e9c9c7665 127.0.0.2:6372
   slots:[5461-10922] (5462 slots) master
M: 7455513abb3c6ff85f0945a27f548fbd00918aa7 127.0.0.2:6373
   slots:[10923-16383] (5461 slots) master
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join
......(endless dots)

other - 127.0.0.2 and other lo ips work normally in old redis release(6.,5.).