docker - Marathon/Mesos - deploy application using the same host port for both UDP and TCP
问题描述
I tried to deploy an application using Marathon/Mesos. It has 2 server ports, 1 UDP and 1 TCP. I want to use the same port numbers for UDP and TCP. But it will not deploy it unless I use different ports. Any ideas?
"portMappings": [
{
"containerPort": 443,
"hostPort": 4300,
"servicePort": 10004,
"protocol": "tcp",
"labels": {}
},
{
"containerPort": 162,
"hostPort": 4300,
"servicePort": 10005,
"protocol": "udp",
"labels": {}
}
]
I'm seeing the following error:
2019-03-19T23:17:19.646760+00:00 controller marathon-services[4511]: [2019-03-19 23:17:19,645] INFO Acknowledge status update for task myserver-0.24a323d4-4a3d-11e9-83a5-054546b43537: TASK_ERROR (Resource 'ports:[4300-4300, 4300-4300]' is invalid: Invalid ranges resource: overlapping ranges) (mesosphere.marathon.core.task.update.impl.TaskStatusUpdateProcessorImpl$$EnhancerByGuice$$53f09936:ForkJoinPool-2-worker-31)
解决方案
其他人似乎也遇到过这个问题。Marathon 试图两次分配同一个端口。解决方案在此 github 问题的评论中给出
为您的场景重写:
您需要通过添加 start 参数将资源端口添加到 mesos 从端口范围--resources-port=[4300-4300,31000-32000]
。
让我知道这是否适合你。
推荐阅读
- java - HERE-API,JAVA:从批处理应用程序中的目录读取失败,jar:未找到授权
- python - 如何使用 python 异步发送和接收 websocket 消息
- python - If not (variable) 和 if (variable) == false 有什么区别?
- sql - 将 ON DELETE CASCADE 添加到同一个表中的 2 个外键
- reactjs - Chart.js 2.9.4 - 使用来自 CDN 的包时出错 - “图表未定义”
- stata - 以下 Stata 代码是什么意思 (x/max=.)?
- microsoft-graph-api - 图形 JSON 响应很少包含原始 HTML
- javascript - 我需要在聚焦输入时隐藏占位符,但显示该输入的标签
- moodle-api - SQL-Statement:显示所有注册过moodle课程的用户
- r - 在 ggplot 中找不到对象