jwilder / docker-register

Service registration for docker containers
197 stars 74 forks source link

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

Open 0xgeert opened 9 years ago

0xgeert commented 9 years ago

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?

jwilder commented 9 years ago

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.

0xgeert commented 9 years ago

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:

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

On Sun, Nov 9, 2014 at 11:47 PM, Jason Wilder notifications@github.com 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 .