mdevilliers / redishappy

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

redis topology is empty #25

Closed lesaux closed 9 years ago

lesaux commented 9 years ago

Hello, I've compiled redishappy with the provided vagrant config, and set up the redis cluster with the provided docker config, but it seems redishappy is not able to get a list of redis backends from sentinel. I'm thinking the "Details{}" below should show more.

INFO: 2014/12/17 20:20:41 engine.go:57: hosting json endpoint. TRACE: 2014/12/17 20:20:41 sentinels.go:74: Sentinel added : {"host":"192.168.0.68","port":26377} INFO: 2014/12/17 20:20:41 monitor.go:128: Subscription Message : Channel : +switch-master : 1 INFO: 2014/12/17 20:20:42 haproxy_flipperclient.go:107: Details {} INFO: 2014/12/17 20:20:42 haproxy_flipperclient.go:129: Updating config file. New file hash : b6bb280e8df0cb66f7a71ed32883bf7a == Old file hash 86d36ac42fd7fc0d1a8bb3fca1d75494 TRACE: 2014/12/17 20:20:42 sentinels.go:108: Sentinel ping : {"host":"192.168.0.68","port":26377} TRACE: 2014/12/17 20:20:42 sentinels.go:109: Sentinel state : {"sentinels":{"192.168.0.68:26377":{"sentinelLocation":"192.168.0.68:26377","lastUpdated":"2014-12-17T20:20:41.00495322Z","clusters":null,"state":3}}}. INFO: 2014/12/17 20:20:42 haproxy_flipperclient.go:100: HAProxy reload completed.

In can telnet to sentinel and get a proper reply to "SENTINEL masters"

Also the api shows no topology. curl http://localhost:8000/api/topology [{"externalPort":6379,"name":"testing","ip":"","port":0}]

Any idea what I could be doing wrong?

mdevilliers commented 9 years ago

Hey,

I'm not too sure - I've added a bit more debugging and tweaked the logging messages so that if you pull the master branch and rebuild we should get the details object properly logged.

I've just updated the vagrant file to include the docker shell scripts, docker and the docker images - so that is an option for testing if you want. The files from https://github.com/mdevilliers/docker-rediscluster are checked out to ~/docker-rediscluster.

If you could try again and add your log I would really appreciate it.

Thanks for you time,

Mark

lesaux commented 9 years ago

Thanks a lot it works now. I was probably missing some deps while building the binary (i'm saying this because the compilation output seems a lot longer then when I compiled yesterday).

I still got some errors while running vagrant up (nevertheless redishappy-haproxy worked fine) But I still had a look and fixed them.

1) ==> default: package code.google.com/p/go.tools/cmd/cover: Get https://code.google.com/p/go/source/checkout?repo=tools: dial tcp: i/o timeout ==> default: package code.google.com/p/go.tools/cmd/vet: Get https://code.google.com/p/go/source/checkout?repo=tools: dial tcp: i/o timeout ==> default: package code.google.com/p/go.tools/cmd/goimports: Get https://code.google.com/p/go/source/checkout?repo=tools: dial tcp: i/o timeout

==> default: build/ci.sh: line 14: goimports: command not found

so instead I used: go get golang.org/x/tools/cmd/cover go get golang.org/x/tools/cmd/vet go get golang.org/x/tools/cmd/goimports

2) chown: cannot access ‘/home/vagrant/go’ so I added mkdir -p /home/vagrant/go before the chown command.

I then installed the deb package. For some reason on my machine the suffix is _amd64, not _all.

Finally edited /etc/redishappy-haproxy/config.json to use the docker nat for a redis sentinel, started redishappy-haproxy service and it works! (haproxy.cfg was updated correctly).

Thanks a lot for this project. I will take a look at building an rpm package as well, since I will need a package for either os families.

mdevilliers commented 9 years ago

Coolio,

I've adjusted the Vagrant files according to your observations. Thanks for those - I really appreciate the time you have spent on this.

If you wanted to do an rpm package that would be awesome! The deb packages have been done by Gary at Aeriandi where we are starting the process of rolling out multiple HA redis clusters.

If you have any other feedback, observations or experiences using redishappy please don't hesitate to get in touch.

Thanks again,

Mark