microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.81k stars 5.37k forks source link

Sentinel and IPv6 #469

Open danrange opened 8 years ago

danrange commented 8 years ago

Hello, I have 5 Windows Servers (in a production environment) each running a Redis server and a Sentinel (v2.8.2400). One Redis is a Master and the rest Slaves. The Sentinels all point to the master with quorum 3. Servers have IPv4 static addresses but also IPv6 (set to automatically obtain addresses). All configuration files use IPv4 addresses.

My problem is that the Sentinels are registering a large number of slaves, with apparently bogus IPv6 addresses. When I try to perform a failover test the elected sentinel aborts because it cannot find a suitable slave to promote.

When I query a Sentinel with sentinel slaves mymaster it gives me the following IPs:

fe80::38f5:1201:0:0
fe80::300:0:0:0
fe80::1800:0:0:0
fe80::1000:0:0:0
fe80::7262:9dc7:58f2:0
fe80::900:0:0:0
fe80::1200:0:0:0
fe80::50b6:31a2:ff07:0
fe80::600:0:0:0
fe80::1400:0:0:0
192.168.10.229
fe80::3a14:500:3ea0:0
fe80::800:0:0:0
fe80::38f5:1e01:0:0
fe80::7665:722e:6578:6500
fe80::20b4:31a2:ff07:0
fe80::
fe80::b00:0:0:0

(The one IPv4 address above is where I have disabled IPv6 on a server - have not tried a failover with this). None of these addresses (apart from the IPv4) correspond to the 5 servers, and don't/no longer exist on the network. When I query the master about its slaves it gives me:

#Replication
role:master
connected_slaves:4
slave0:ip=fe80::38f5:1201:0:0,port=6380,state=online,offset=13499174582,lag=1
slave1:ip=fe80::38f5:1201:0:0,port=6380,state=online,offset=13499176408,lag=0
slave2:ip=fe80::38f5:1201:0:0,port=6380,state=online,offset=13499174582,lag=1
slave3:ip=192.168.10.229,port=6380,state=online,offset=13499176408,lag=0

Why are slave0/1/2 all the same address? The Slaves themselves are replicating okay, but an info replication shows me that they are using local DNS names.

# Replication
role:slave
master_host:web5
master_port:6380
master_link_status:up
master_last_io_seconds_ago:0
master_sync_in_progress:0

So several questions really - Why are the sentinels picking up all these IPv6 addressed? Why are they not picking up the actual IPv6 addresses of the 5 servers? And is there a way to configure Redis/Sentinel not to use IPv6?

Thanks.

enricogior commented 8 years ago

Hi @danrange the bogus IPv6 address shown by the sentinel slaves mymaster command were valid address at same point in your network? As far as I know there isn't a way to configure the service not to use IPv6. To understand what is going on it would help to know the output of the ipconfig command on each server to check all the IPs exposed.