Search code examples
dockerkarafmesosmarathonfusefabric

Apache Mesos + Docker + Karaf Cellar Cluster


I'm having a Mesos Cluster up and running (1 Master and 2 Slaves) with Marathon. I use docker as the container in Mesos/Marathon. I have a Karaf docker that will be launched in Marathon as a Cluster. I'm planning to use Cellar of Fabric as Karaf's Clustering Solution. My problems are

  1. Since I use random port mapping in Marathon, I didn't have an idea how to get Hazel-cast's auto discovery to work. with random docker instances on random slaves. Any suggestions or solutions/ approach

  2. Can this be easily achieved using fuse fabric instead of Cellar - I'm completely blind on this. Please provide some links/insights to follow for Karaf

Thanks in advance


Solution

  • To answer bullet #2

    fabric8 v2 is architecture on cloud technology such as Kubernetes and Docker. This makes Fuse Fabric fit much better with tomorrows technology stacks instead of being tied to Java and OSGi.

    A bit more background about this change is blogged by Rob Davies at

    So with a docker based model, and a cloud infrastructure such as Mesos/Kubernetes then let them handle the clustering et all. And keep your apps (as docker images) simpler. You do not need to use Karaf Cellar / Fuse Fabric v1 etc. They do clustering from the inside co-located with your apps. Where as kubernetes does that from the outside, totally separated.

    And btw for #1 then kubernetes services rocks. James Strachan wrote a blog entry recently about kubernetes for developers

    If using kubernetes services then you can lookup the IP and port number for your hazelcast cluster simply by using the OS environment variables.

    Okay maybe this was a bit of ramble. But I suggest to check out kubernetes / fabric8 / docker et all - and avoid Java clustering such as Karaf Cellar or Fuse Fabric v1 if you are building a new platform today.