DCO上具有不同端口的相同上下文路径服务

3zwtqj6y  于 2021-06-26  发布在  Mesos
关注(0)|答案(1)|浏览(329)

我已经部署了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在“/”上,所以不起作用

hjqgdpho

hjqgdpho1#

我通过移除 "HAPROXY_GROUP":"external" 从elasticsearch来看,现在它不会部署在MarathonLB上,因此无法通过浏览器访问。

相关问题