1

I am trying to link 2 docker containers using mesos/marathon framework. As I understand there is no way to use the docker link feature in mesos/martahon. So the way to go forward is to use service discovery. Since zookeeper is already used my question is how to use zookeeper for service discovery so that 1 container can talk to another one.

ashishjain
  • 1,243
  • 1
  • 11
  • 12

2 Answers2

1

For service discovery on Mesos/Marathon, you can use a proxy server (see https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html) or a DNS server that derives settings from Mesos automatically (see https://github.com/mesosphere/mesos-dns).

Chrisinba
  • 26
  • 1
  • Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Feb 21 '15 at 17:09
  • thanks for pointing out mesos-dns..however I am stuck with another issue. How can you use mesos-dns to lookup a hostname port of a service from one docker container to another docker container both running on the same host. – ashishjain Feb 23 '15 at 08:01
  • @user1507003 you can access another docker container using the hostname `..mesos` (if you defined `mesos` as the mesos-dns domain). Example if your docker container is running in Marathon: `myapp.marathon.mesos`. It doesn't matter if the containers run on the same host or not. – Céline Aussourd Apr 08 '15 at 09:22
0

Although possible I would reconsider using Zookeeper as a centralized KV store for your configuration and services information. You could try to implement a daemon to ask and save data in zookeeper in order to configure your container's config files and live patching, but it's a complex solution (there are examples of this approach in this post from Pinterest, or in Hadoop's ZKFailoverController daemon). From my point of view there are more suited solutions as Consul or etcd, with implementations of the daemons as kelseyhightower/confd or consul-template.

Javier Cortejoso
  • 8,851
  • 3
  • 26
  • 27