mysql - 容器在HOST网络中运行时如何配置marathon-lb?

标签 mysql docker marathon

我的马拉松 json 在下面

{
  "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": {}
    }
  ]
}

我发现 haproxy(在 192.168.30.142 View the screenshot 运行)配置是:

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

mysql 容器在 192.168.30.144 View the screenshot 运行,所以我想要的是:

server 192_168_30_144_3306 192.168.30.144:3306

那么我应该怎么做才能解决它呢? 谢谢!

最佳答案

我想我找到了答案 http://mesosphere.github.io/marathon/docs/host-port.html

Mesos 代理不提供所有端口

我说得对吗?

关于mysql - 容器在HOST网络中运行时如何配置marathon-lb?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43089497/

相关文章:

php - 两文件 PHP 联系表

MySQL - ...重复键不更新

python - 如何为Docker容器分配更多内存?

mysql - Apache Mesos、MESOS-DNS、MARATHON 和 Docker

rest - 如何使用Apache Marathon REST API扩展Docker实例?

mesos - mesos 仪表板上的“优惠”选项卡

php - 请求大量 Twitter API 数据、服务或操作方法?

MySql语句根据中间表中的列进行选择

azure - Docker 构建失败并出现 "Service failed to build: COPY failed: no such file or directory"错误

mongodb - confluentinc/kafka-connect-datagen:latest'返回了非零代码:7