Excluding 127.0.0.1 in bind list solves "#duplicate of" but why?

44 views
Skip to first unread message

Oliver Clancy

unread,
Nov 3, 2015, 11:32:44 AM11/3/15
to Redis DB
Basically I was getting the problems described issue2309 and (part of the question ) here to do with a flood of  "#duplicate of" in my log files.

I distilled the problem down to this:

All redis instances are 2.8.19 (I know there are later builds but no release notes allude to a fix for this feature)
2 machines: 

Machine A:
NIC A1: 172.16.52.162
NIC A2: 172.16.51.162

Sentinel A1 - port 26379 - config: sentinel monitor mymaster 172.16.51.162 6379 2
Sentinel A2 - port 26380 - config: sentinel monitor mymaster 172.16.51.162 6379 2

Instance A - 6379 (master)

Machine B:
NIC B1: 172.16.52.163
NIC B2: 172.16.51.163

Sentinel B1 - port 26379 - config: sentinel monitor mymaster 172.16.51.162 6379 2
Sentinel B2 - port 26380 - config: sentinel monitor mymaster 172.16.51.162 6379 2

Instance B - 6379 (slave of 172.16.51.162:6379)

(Please remember this is a distillation of setup to reproduce the logging effect - not our solution)

In the default bind scenario we see continual "#duplicate of" messages in all the sentinel logs.

Solution 1: 
Bind Sentinel A1 to NIC A1, Sentinel A2 to NIC A2, Sentinel B1 to NIC B1, Sentinel B2 to NIC B2

This stops the flood of "#duplicate messages" in all the logs. Unbinding e.g. Sentinel A1 from NIC A1 will produce "#duplicate of " messages stating that 172.16.51.162 26379 and 172.16.52.162 26379 are duplicates.

Inference: The sentinel broadcast/discovery protocol doesn't take into account multiple NICs (?) i.e. Sentinel A1 can be seen via two interfaces but are assumed as duplicate but in fact there is only one instance.

However, I tried the folowing

Solution 2:
Change all Sentinel bindings to bind all interfaces EXCEPT localhost (127.0.0.1) across all machines e.g. for Sentinel A1 config has :- bind 172.16.51.162 172.16.52.162 

This also cured the problem of the flood of "#duplicate of" messages. This disproves my inference from solution 1 above.

Ultimately my question is: why does excluding localhost from the bind list stop sentinels that are available via 2 NICS being seen as duplicates?


Thanks very much in advance.

Gergely Lukácsy

unread,
Jun 24, 2016, 9:21:06 AM6/24/16
to Redis DB
This behaviour can be observed in 3.0.4 too.
Reply all
Reply to author
Forward
0 new messages