docker-register icon indicating copy to clipboard operation
docker-register copied to clipboard

Correct that Redis, etc. is not supported since no http health-endpoint available?

Open 0xgeert opened this issue 11 years ago • 2 comments
trafficstars

Probably pretty naive question, but I've read up today on service discovery stuff and am impressed with the ease of the Smartstack approach. (I like it above consul for instance).

I wanted to start setting-up Smartstack (which still sadly uses Zookeeper, although Etcd integration is near finished hopefully) on a CoreOS environment, when I discovered your blog introducing docker-register + docker+discover.

Just to get my head around this: things like Redis which don't expose a health-endpoint can't currently be checked with docker-register. Is that true? As a workaround, I was thinking of having a very small sidekick node app which only exposes a /health endpoint and only returns OK when Redis is up (and is the current master). Would that work?

0xgeert avatar Nov 09 '14 21:11 0xgeert

docker-register will register any service that exposes a port currently. docker-discover will setup a proxy to that port as well. The haproxy config is currently defaulting to a http proxy but it could easily just proxy TCP instead. The health checks in docker-discover are just basic HAProxy tcp connection checks. It's not calling /health as Smartstack does at the moment.

Redis could technically work but because it's stateful you may get some unexpected results depending on how you are using it. For example, if you had a master/slave setup and both were discoverable by docker-register and docker-discover, they would end up being load balanced so some writes would succeed and some would fail. Also, things like pubsub might not work as expected through a proxy if it's load balancing across multiple servers.

There currently isn't any support for a master/slave type setups at the moment though.

jwilder avatar Nov 09 '14 22:11 jwilder

Ok makes sense. Are you open for feature requests to solve some of these issues?

The following would go a long way towards more supported services I guess:

  • support for TCP
  • more intelligent / custom health checks. I.e.: the Smartstack guys suggest having a healthcheck that only reports 200: ok in case of Redis Master.

Hand't thought about pubsub issues. That could be a problem yes

On Sun, Nov 9, 2014 at 11:47 PM, Jason Wilder [email protected] wrote:

docker-register will register any service that exposes a port currently. docker-discover will setup a proxy to that port as well. The haproxy config is currently defaulting to a http proxy but it could easily just proxy TCP instead. The health checks in docker-discover are just basic HAProxy tcp connection checks. It's not calling /health as Smartstack does at the moment.

Redis could technically work but because it's stateful you may get some unexpected results depending on how you are using it. For example, if you had a master/slave setup and both were discoverable by docker-register and docker-discover, they would end up being load balanced so some writes would succeed and some would fail. Also, things like pubsub might not work as expected through a proxy if it's load balancing across multiple servers.

There currently isn't any support for a master/slave type setups at the moment though.

— Reply to this email directly or view it on GitHub https://github.com/jwilder/docker-register/issues/4#issuecomment-62323674 .

0xgeert avatar Nov 10 '14 09:11 0xgeert