无法访问在 Azure 中使用 DCOS Marathon 部署的 helloworld App
unable to access helloworld App deployed using DCOS Marathon in Azure
我已经使用 DCOS 和 Marathon 在 Azure 中部署了一个 hello world 应用程序 Framework.I 我正在尝试使用托管应用程序的 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 规则,允许端口作为自定义
在您的示例中,host port
为 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.
连同 above-mentioned JSON 我需要使用代理 URL 来访问该应用程序。我错过了
我已经使用 DCOS 和 Marathon 在 Azure 中部署了一个 hello world 应用程序 Framework.I 我正在尝试使用托管应用程序的 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 规则,允许端口作为自定义
在您的示例中,host port
为 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.
连同 above-mentioned JSON 我需要使用代理 URL 来访问该应用程序。我错过了