1

I'm working on a Mesos cluster with 3 mesos-master nodes (ip 105,106,107) and 3 mesos-slave nodes (ip 109,110,111). Apache Marathon v0.8.0 is installed on the 3 master nodes and Docker v1.5 on the 3 slave nodes.

I found a Mesos + Docker tutorial on the Mesosphere youtube channel and there they deployed a Nginx webserver through the Marathon api, I followed the video and it worked, Nginx was deployed in a Docker container and I was able to scale up the app to more instances then I have slave nodes.

Now I'm trying to install HAproxy for load balancing on the nodes. I followed this tutorial on the Mesosphere website for HAproxy-Marathon-Bridge installation. HAproxy is now via the cronjob able to find the instances that are running.

The problem is, after installation of Marathon bridge i'm not able to scale up my instances more than I have nodes available, even if there is just one instance of Nginx running on every slave. Also the Ngingx index.html is available at my 105:80 server (the elected leader) and 107:80. I dont know why that's the case. Because I thought Haproxy and Marathon bridge always redirected the traffic to port 80 of the elected leader.

HAproxy and HAproxy Marathon Bridge are installed on every master and every slave node. Do I uninstall the HAproxy and HAproxy Marathon Bridge on the masters and put one HAproxy machine in front of those 3?

Rico
  • 58,485
  • 12
  • 111
  • 141
Gijs
  • 885
  • 2
  • 13
  • 22
  • Hey Gijs, if NGINX is really required for you can proxy_pass request to haproxyip:5000 and at haproxy you can define server backend to route your request. I would suggest you to install NGINX on a separate machine and you can install HAPROXY on NGINX as HAPROXY would work only as load balancer. If you require sample configuration I can provide you that – Pulkit Apr 22 '15 at 06:06
  • @Pulkit, it seems that it wasn't a haproxy config error but the server didn't had enough memory. Never thought of it because first it did work, but after days of testing whitout a reboot my memory was probable full of junk and there was not enough free for deployment of 2 instance. Marathon also doesn't give an error if a problem like this occurs, it's just stuck in deployment face. But i'm still struggeling with the configuration of haproxy so the sample configuration would really come in handy. – Gijs Apr 29 '15 at 08:21
  • Could you post a new question for that because I think it wont be appropriate to answer that here. – Pulkit Apr 29 '15 at 22:33

1 Answers1

2

It's not the problem with the Haproxy, uninstall Haproxy on all mesos nodes (Master/Slave) and install it on one node.

Follow the process in this link: https://mesosphere.github.io/marathon/docs/service-discovery-load-balancing.html

Once you install Haproxy marathon bridge, you can access your marathon apps with URLS like

Haproxy servername:Service-port of-Marathon-App

Haproxy doesn't do any thing with the auto-scaling part

Rico
  • 58,485
  • 12
  • 111
  • 141
Rajiv Reddy
  • 153
  • 1
  • 9