Marathon-lb DCOS 上具有不同端口的相同上下文路径服务
Same context path services with different ports on Marathon-lb DCOS
我已经使用以下应用程序定义部署了 elasticsearch 和 kibana
elasticsearch.json
{
"id": "elasticsearch",
"container": {
"type": "DOCKER",
"docker": {
"image": "docker.elastic.co/elasticsearch/elasticsearch:6.3.2",
"network": "BRIDGE",
"portMappings": [
{ "hostPort": 9200, "containerPort": 9200, "servicePort": 0 },
{ "hostPort": 9300, "containerPort": 9300, "servicePort": 0 }
],
"forcePullImage":true
}
},
"instances": 1,
"cpus": 1,
"mem": 3048,
"labels":{
"HAPROXY_GROUP":"external",
"HAPROXY_0_VHOST":"publichost",
"HAPROXY_0_MODE":"http",
"DCOS_PACKAGE_NAME": "elasticsearch"
},
"env": {
"ES_JAVA_OPTS": "-Xmx2048m -Xms2048m"
}
}
在“/”上下文路径上部署 elasticsearch
kibana.json
{
"id": "kibana",
"container": {
"type": "DOCKER",
"docker": {
"image": "docker.elastic.co/kibana/kibana:6.3.2",
"network": "BRIDGE",
"portMappings": [
{ "hostPort": 5601, "containerPort": 5601, "servicePort":0}
],
"forcePullImage":true
},
"volumes": [
{
"containerPath": "/usr/share/kibana/config",
"hostPath": "/home/azureuser/kibana/config",
"mode": "RW"
}
]
},
"instances": 1,
"cpus": 0.5,
"mem": 2000,
"labels":{
"HAPROXY_0_VHOST":"publichost",
"HAPROXY_0_MODE":"http",
"DCOS_SERVICE_NAME": "kibana",
"DCOS_SERVICE_SCHEME": "http",
"DCOS_SERVICE_PORT_INDEX": "0"
}
}
这还在“/”上下文路径上部署了 kibana
然后如何访问kibana
当我尝试访问
http://publichost/app/kibana
不起作用,因为 elasticsearch 位于“/”
我通过从 elasticsearch 中删除 "HAPROXY_GROUP":"external"
来做到这一点,现在它不会在 marathon-lb 上部署它,因此无法通过浏览器访问。
我已经使用以下应用程序定义部署了 elasticsearch 和 kibana
elasticsearch.json
{
"id": "elasticsearch",
"container": {
"type": "DOCKER",
"docker": {
"image": "docker.elastic.co/elasticsearch/elasticsearch:6.3.2",
"network": "BRIDGE",
"portMappings": [
{ "hostPort": 9200, "containerPort": 9200, "servicePort": 0 },
{ "hostPort": 9300, "containerPort": 9300, "servicePort": 0 }
],
"forcePullImage":true
}
},
"instances": 1,
"cpus": 1,
"mem": 3048,
"labels":{
"HAPROXY_GROUP":"external",
"HAPROXY_0_VHOST":"publichost",
"HAPROXY_0_MODE":"http",
"DCOS_PACKAGE_NAME": "elasticsearch"
},
"env": {
"ES_JAVA_OPTS": "-Xmx2048m -Xms2048m"
}
}
在“/”上下文路径上部署 elasticsearch
kibana.json
{
"id": "kibana",
"container": {
"type": "DOCKER",
"docker": {
"image": "docker.elastic.co/kibana/kibana:6.3.2",
"network": "BRIDGE",
"portMappings": [
{ "hostPort": 5601, "containerPort": 5601, "servicePort":0}
],
"forcePullImage":true
},
"volumes": [
{
"containerPath": "/usr/share/kibana/config",
"hostPath": "/home/azureuser/kibana/config",
"mode": "RW"
}
]
},
"instances": 1,
"cpus": 0.5,
"mem": 2000,
"labels":{
"HAPROXY_0_VHOST":"publichost",
"HAPROXY_0_MODE":"http",
"DCOS_SERVICE_NAME": "kibana",
"DCOS_SERVICE_SCHEME": "http",
"DCOS_SERVICE_PORT_INDEX": "0"
}
}
这还在“/”上下文路径上部署了 kibana
然后如何访问kibana
当我尝试访问
http://publichost/app/kibana
不起作用,因为 elasticsearch 位于“/”
我通过从 elasticsearch 中删除 "HAPROXY_GROUP":"external"
来做到这一点,现在它不会在 marathon-lb 上部署它,因此无法通过浏览器访问。