DCOs as the bottom support platform for running Docker, our workload is reduced a lot, but because of the large number of Docker, even with the overlay network, but IP address AH port number AH so much, we can be good.
Right, this time marathon-lb appeared, the approximate process is as follows:
1. We run Docker, hit a random port A, and tell ZK which Port B we want to have to be accessed by someone else.
2. MARATHON-LB will go to ZK to find this port B, and then as a load balancer device for others to access LB's B port directed to the actual Appdocker B port
3. Then the IP address is which to come, marathon-lb after running, will be in ZK to register, domain name Marathon-lb-internal.marathon.mesos or other domain name, good, of course, the resolution needs to put the local nslookup Server points to DCOs master. configuration json for APP Docker
{"id": "nginx-internal", "container": {"type": "Docker", "Docker": {"image": "nginx:1.9.14", "N
Etwork ":" BRIDGE "," portmappings ": [{" Hostport ": 0," containerport ": +," Serviceport ": 10001}], "Forcepullimage": true}, "instances": 1, "CPUs": 0.1, "mem": +, "healthchecks": [{"Protocol": "HTTP", "path": "/", "PortIndex": 0, "timeoutseconds": Ten, "Graceperiodseconds": Ten, "Inter
Valseconds ": 2," Maxconsecutivefailures ": Ten}]," labels ": {" Haproxy_group ":" Internal "}} # inside the outer-nginx { "id": "nginx-everywhere", "container": {"type": "Docker", "Docker": {"image": "nginx:1.7.7", "NE
Twork ":" BRIDGE "," portmappings ": [{" Hostport ": 0," containerport ": +," Serviceport ": 10002}], "Forcepullimage": true}, "instances": 1, "CPUs": 0.1, "mem": +, "healthchecks": [{"Protocol": "HTTP", "path": "/"," PortIndex ": 0," timeoutseconds ": Ten," Graceperiodseconds ": Ten," Intervalseconds ": 2," Ma Xconsecutivefailures ": Ten}", "labels": {"Haproxy_group": "External,internal"}}
JSON for Marathon-lb-internal
# do a internal marathon-lb
{"
marathon-lb": {
"name": "Marathon-lb-internal",
"Haproxy-group": " Internal ",
" Bind-http-https ": false,
" role ":" "
}
}
dcos Package install--options=options.json Marathon-lb
Test
Curl http://marathon-lb-internal.marathon.mesos:10001/
Marathon-lb-internal's management address Marathon-lb-internal.marathon.mesos:9090/haproxy?stats