Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 830
Shan Avatar asked Feb 20 '26 02:02

Shan


2 Answers

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.

  • http://fabric8.io/

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

  • http://rajdavies.blogspot.se/2014/11/fabric8-version-20-released-next.html

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

  • https://medium.com/fabric8-io/kubernetes-for-developers-2a9c7202fcd3

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.

like image 146
Claus Ibsen Avatar answered Feb 21 '26 17:02

Claus Ibsen


Many have had success using HAProxy along with Marathon's service ports for cluster-wide discoverability. See https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html

You could also try mesos-dns for DNS-based service discovery, which works even without Marathon. See http://mesosphere.github.io/mesos-dns/

like image 24
Adam Avatar answered Feb 21 '26 15:02

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!