wuxibin89 / redis-go-cluster

redis cluster client implementation in Go
Apache License 2.0
488 stars 145 forks source link

Add options to support multiple redis instances behind the same hostname #21

Open msoedov opened 6 years ago

msoedov commented 6 years ago

Hi,

We have a use case when we running N ( where N could be 10, 20 ....) redis servers with dynamic ip addresses and dns based service discovery. So we have a hostname like redis-privatenet.com which resolves to N servers.

My proposal is the following:

1) Resolve hostname to list of ip addresses initially 2) Re -resolve that hostname on connection failure to one of the nodes 3) Re -resolve the hostname periodically (with ~30 sec inteterval) to discover recently joined redis nodes.

I am ready to make a patch just wanted to discuss the approach here first.

Any thoughts?