marathon-lb
{ "id": "marathon-lb", "instances": 1, "constraints": [["hostname", "UNIQUE"]], "container": { "type": "DOCKER", "docker": { "image": "docker.io/mesosphere/marathon-lb", "privileged": true, "network": "HOST" } }, "args": ["sse", "-m","http://192.168.9.61:8080","--group", "external"] }
指定在某台机器运行
{ "id": "marathon-lb", "instances": 1, "constraints": [["hostname", "CLUSTER", "192.168.9.61"]], "container": { "type": "DOCKER", "docker": { "image": "docker.io/mesosphere/marathon-lb", "privileged": true, "network": "HOST" } }, "args": ["sse", "-m","http://192.168.9.61:8080","--group", "external"] }
弹性伸缩
{ "id": "/marathon-lb-autoscale", "cmd": null, "cpus": 1, "mem": 128, "disk": 0, "instances": 1, "acceptedResourceRoles": [ "*" ], "container": { "type": "DOCKER", "volumes": [], "docker": { "image": "brndnmtthws/marathon-lb-autoscale", "network": "HOST", "portMappings": [], "privileged": false, "parameters": [], "forcePullImage": true } }, "portDefinitions": [ { "port": 10001, "protocol": "tcp", "name": "default", "labels": {} } ], "args": [ "--marathon", "http://192.168.9.61:8080", "--haproxy", "http://192.168.9.61:9090", "--target-rps", "100", "--apps", "tomcat6_10005" ] }
验证
{
"id": "siege",
"args":[
"-d1",
"-r1000",
"-c100",
],
"cpus": 0.5,
"mem": 16.0,
"instances": 1,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "siege:latest",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
}
}
"upgradeStrategy":{ "minimumHealthCapacity": 0, "maximumOverCapacity": 0 }
/_haproxy_health_check
haproxy查询
http://192.168.9.62:9090/_haproxy_getconfig http://192.168.9.62:9090/haproxy?stats