gpt4 book ai didi

azure - 无法访问在Azure中使用DCOS Marathon部署的helloworld应用程序

转载 作者:行者123 更新时间:2023-12-02 18:22:13 25 4
gpt4 key购买 nike

我已使用 DCOS 和 Marathon Framework 在 Azure 中部署了一个 hello world 应用程序。我正在尝试使用 fqn: 托管该应用程序的端口号来访问该应用程序。我无法打开该应用程序

以下是我使用的json

{
"id": "/dockercloud-hello-world",
"cmd": null,
"cpus": 0.1,
"mem": 128,
"disk": 0,
"instances": 2,
"acceptedResourceRoles": [
"*"
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "dockercloud/hello-world",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"servicePort": 10000,
"protocol": "tcp",
"labels": {}
}
],
"privileged": false,
"parameters": [],
"forcePullImage": true
}
},
"healthChecks": [
{
"gracePeriodSeconds": 10,
"intervalSeconds": 2,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 10,
"portIndex": 0,
"path": "/",
"protocol": "HTTP",
"ignoreHttp1xx": false
}
],
"portDefinitions": [
{
"port": 10000,
"protocol": "tcp",
"name": "default",
"labels": {}
}
]
}

我已为主 nsg 资源添加 NSG 入站规则我已为主 lb 资源添加了 NAT 规则,允许自定义端口

最佳答案

在您的示例中,主机端口为0,Azure将在随机端口上监听您的服务。您需要打开 NSG 和 lb 上的端口。

我建议你可以指定端口,你可以检查以下示例:

{
"id": "/dockercloud-hello-world",
"cmd": null,
"cpus": 0.1,
"mem": 32,
"disk": 0,
"instances": 1,
"acceptedResourceRoles": [
"slave_public"
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "dockercloud/hello-world",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp",
"labels": {},
"name": "test80"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": true
}
},
"healthChecks": [
{
"gracePeriodSeconds": 10,
"intervalSeconds": 2,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 10,
"portIndex": 0,
"path": "/",
"protocol": "MESOS_HTTP",
"ignoreHttp1xx": false
}
],
"requirePorts": true
}

注意:您应该将 acceptedResourceRoles 设置为 slave_public。有关此的更多信息请查看此 link .

关于azure - 无法访问在Azure中使用DCOS Marathon部署的helloworld应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49027249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com