My json for marathon is below
{
"id": "/storage/mysql",
"cmd": null,
"cpus": 1,
"mem": 512,
"disk": 0,
"instances": 1,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "reg.xxxxx.cn/library/mysql:5.7",
"network": "HOST",
"portMappings": [],
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"env": {
"MYSQL_ROOT_PASSWORD": "123456"
},
"labels": {
"HAPROXY_GROUP": "internal"
},
"portDefinitions": [
{
"port": 3306,
"protocol": "tcp",
"labels": {}
}
]
}
I find the haproxy (run at 192.168.30.142 View the screenshot) config is :
frontend storage_mysql_3306
bind *:3306
mode tcp
use_backend storage_mysql_3306
backend storage_mysql_3306
balance roundrobin
mode tcp
server 192_168_30_144_31695 192.168.30.144:31695
the mysql container is run at 192.168.30.144 View the screenshot, so what i want is :
server 192_168_30_144_3306 192.168.30.144:3306
so what should i do to slove it? thanks!