Mesos, Marathon-lb, Docker, Nginx

  • Category: 電腦相關
  • Last Updated: Tuesday, 18 July 2017 11:03
  • Published: Wednesday, 07 June 2017 11:08
  • Written by sam

Mesos, Marathon-lb, Docker, Nginx

For test Nginx LB use Marathon-lb

I use three Nginx and three Marathon-lb to test lb

Depoly them with marathon and docker image

root@mesos-m1:~# curl -X POST http://10.0.252.235:8080/v2/apps -d @nginx -H "Content-Type: application/json"
root@mesos-m1:~# curl -X POST http://10.0.252.235:8080/v2/apps -d @marathonlb -H "Content-Type: application/json"

And test it, when i request same ip address, result is different.

 photo 2017-06-07 10.36.01_zpsgt8wowpf.png  photo 2017-06-07 10.35.52_zpspdjdvio7.png  photo 2017-06-07 10.36.08_zpsumn0m0td.png

Marathon-lb is identify with lalels. Like "haproxy_group=docker-haproxy", marathon-lb will pass match labels group to backend nginx server.

Also you can use web browser 

http://10.0.252.237:9090/_haproxy_getconfig . ---> modify it with your ip

frontend httpd_10000
  bind *:10000
  mode http
  use_backend httpd_10000

Use http://10.0.252.237:10000/ to test