mdevilliers / redishappy

Redis Sentinel high availabillity daemon
Apache License 2.0
114 stars 23 forks source link

IPv6 with Redis #50

Closed quulah closed 8 years ago

quulah commented 8 years ago

I have Redis and Sentinels running on IPv6.

When configuring redishappy-consul, I set "[::1]" for the Sentinel and Consul addresses, which seems to work.

After that though, I start getting this error:

ERROR: 2016/06/15 08:06:05 manager.go:83: Error starting monitor fdf1:a315:9433:8014:f816:3eff:fe1a:288c:26379 : dial tcp: too many colons in address fdf1:a315:9433:8014:f816:3eff:fe1a:288c:26379
ERROR: 2016/06/15 08:06:05 pubsubclient.go:18: PubSubClient Error connecting to fdf1:a315:9433:8014:f816:3eff:fef9:96c3:26379 : dial tcp: too many colons in address fdf1:a315:9433:8014:f816:3eff:fef9:96c3:26379
quulah commented 8 years ago

I'm not a Go guy, but might be GetLocation() that is causing the problem.

It returns %s:%s host and port. Which is then used at least here to set the uri.

mdevilliers commented 8 years ago

Okay - it looks like when using IPV6 the socket libraries in Golang expect your url/port to kinda look like this - see https://golang.org/src/net/ipsock.go#L107

[fdf1:a315:9433:8014:f816:3eff:fe1a:288c:26379]

Notice the enclosing "[" and "]"

If you could try this branch - https://github.com/mdevilliers/redishappy/tree/ipv6-bug and report back that would be awesome?

quulah commented 8 years ago

Thanks, seems to be working.

I made a quick hack earlier that added the missing []'s to the IPv6 address, but that looks a lot cleaner.

mdevilliers commented 8 years ago

Thanks for getting back to me - I'll merge.