在Mesos群集上安装Mesos-DNS [英] Setup Mesos-DNS dockerized on a mesos cluster

查看:153
本文介绍了在Mesos群集上安装Mesos-DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Windows 8.1上安装了ubuntu信任的2台虚拟机主办。
我的虚拟机被称为docker-vm 和 docker-sl-vm ;第一个运行mesos-master,第二个运行mesos-slave。



虚拟机有2个网卡;一个运行NAT通过主机访问互联网,另一个是用于内部通信的仅主机适配器。



虚拟机的IP为:




  • 192.168.56.101 for docker-vm

  • 192.168.56.102 for docker-sl-vm



MESOS群集正在运行好吧,



我试图追踪本教程。所以,我正在运行 mesos-dns ,使用以下马拉松描述:

  {
args:[
/ mesos-dns,
-config = / config.json
],
container:{
docker :{
image:mesosphere / mesos-dns,
network:HOST
},
type:DOCKER,
volumes:[
{
containerPath:/config.json,
hostPath:/usr/local/mesos-dns/config.json
mode:RO
}
]
},
cpus:0.5,
mem:256,
id:mesos-dns,
instances:1,
constraints:[[hostname,CLUSTER,docker-sl-vm]]
}

这个 config.json

  {
zk:zk://192.168.56.101:2181 / mesos,
refreshSeconds 60,
tt l:60,
domain:mesos,
port:53,
resolvers:[8.8.8.8],
timeout :5,
email:root.mesos-dns.mesos
}

我还运行了一个名为 peek 的测试提案应用程序,其中包含以下描述:

  {
id:peek,
cmd:env> env.txt&& python3-m http.server 8080,
cpus:0.5,
mem:32.0,
container:{
type:DOCKER
docker:{
image:python:3,
network:BRIDGE,
portMappings:[
{ containerPort:8080,hostPort:0}
]
}
}
}

问题



在本教程中,dig命令如 dig _peek ._tcp.marathon.mesos SRV 得到以下答案:

 ;<> > DiG 9.9.5-3ubuntu0.5-Ubuntu<> _peek._tcp.marathon.mesos SRV 
;;全局选项:+ cmd
;;得到答案:
;; - >>>  HEADER<< - opcode:QUERY,status:NOERROR,id:57329
;; flags:qr aa rd ra; QUERY:1,ANSWER:1,AUTHORITY:附加:1

;; QUESTION SECTION:
; _peek._tcp.marathon.mesos。IN SRV

;; ANSWER SECTION:
_peek。 _tcp.marathon.mesos。60 IN SRV 0 0 31000 pe EK-27346-s0.marathon.mesos。

;;额外部分:
peek-27346-s0.marathon.mesos。 60 IN A 10.141.141.10

;;查询时间:4 msec
;;服务器:127.0.0.1#53(127.0.0.1)
;; WHEN:Sat Oct 24 23:21:15 UTC 2015
;; MSG SIZE rcvd:160

我们可以清楚的看到端口和IP绑定到 _peek._tcp.marathon.mesos SRV BUT 当我在我的从机上运行这个 - 正在运行这个容器 - 我得到这个结果:

  docker @ docker-sl-vm:〜$ dig _peek._tcp.marathon.mesos SRV 

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu<>> _peek._tcp.marathon.mesos SRV
全局选项:+ cmd
;;得到答案:
;; - >> HEADER< - opcode:QUERY,status:NXDOMAIN,id:33415
;;国旗:qr rd ra; QUERY:1,ANSWER:0,AUTHORITY:1,ADDITIONAL:1

;; OPT PSEUDOSECTION:
; EDNS:version:0,flags: udp:1280
;;问题部分:
; _peek._tcp.marathon.mesos。 IN SRV

;;授权部门:
。 10791 IN SOA a.root-servers.net。 nstld.verisign-grs.com。 2015102801 1800 900 604800 241

;;查询时间:1 msec
;;服务器:10.10.11.1#53(10.10.11.1)
;; WHEN:Wed Oct 28 17:06:30 BRT 2015
;; MSG SIZE rcvd:129

看起来像 mesos-dns 不能解析_peek._tcp.marathon.mesos SRV。



有谁知道为什么以及如何解决?



提前...



更新



命令结果 /etc/resolv.conf

  nameserver 10.10.11.1 
nameserver 10.10。 10.7


解决方案

看看从设置的Mesos DNS文档:http://mesosphere.github.io/mesos-dns/docs/rel =nofollow>


要允许Mesos任务使用Mesos-DNS作为主DNS服务器,必须编辑文件 /etc/resolv.conf 在每个slave中添加一个新的名称服务器。例如,如果在具有IP地址为10.181.64.13的服务器上运行mesos-dns,则应在 /etc/resolv.conf 的开头添加行名称服务器10.181.64.13在每个从属节点上。


我认为本地IP( 192.168.56.102 )的地址在您的 /etc/resolv.conf 中丢失。



否则,您还可以尝试我的最小Mesos DNS映像,但是您仍然需要编辑上述文件。


I'm facing some trouble trying to run mesos-dns dockerized on a mesos cluster.

I've setup 2 virtual machines with ubuntu trusty on a windows 8.1 host. My VMs are called docker-vm and docker-sl-vm; where the first one runs mesos-master and the 2nd one runs mesos-slave.

The VMs have 2 network cards; one running NAT for accesing internet through the host and the other one is a Host-only adapter for internal communication.

The IPs for the VMs are:

  • 192.168.56.101 for docker-vm
  • 192.168.56.102 for docker-sl-vm

The MESOS cluster is running Okay.

I am trying to follow this tutorial. So, I am running mesos-dns with the following marathon description:

{
    "args": [
        "/mesos-dns",
        "-config=/config.json"
    ],
    "container": {
        "docker": {
            "image": "mesosphere/mesos-dns",
            "network": "HOST"
        },
        "type": "DOCKER",
        "volumes": [
            {
                "containerPath": "/config.json",
                "hostPath": "/usr/local/mesos-dns/config.json",
                "mode": "RO"
            }
        ]
    },
    "cpus": 0.5,
    "mem": 256,
    "id": "mesos-dns",
    "instances": 1,
    "constraints": [["hostname", "CLUSTER", "docker-sl-vm"]]
}

and this config.json:

{
    "zk": "zk://192.168.56.101:2181/mesos",
    "refreshSeconds": 60,
    "ttl": 60,
    "domain": "mesos",
    "port": 53,
    "resolvers": ["8.8.8.8"],
    "timeout": 5,
    "email": "root.mesos-dns.mesos"
}

I am also running a test proposal application called peek with the following description:

{
  "id": "peek",
  "cmd": "env >env.txt && python3 -m http.server 8080",
  "cpus": 0.5,
  "mem": 32.0,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "python:3",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 8080, "hostPort": 0 }
      ]
    }
  }
}

PROBLEM

Into the tutorial, a dig command such as dig _peek._tcp.marathon.mesos SRV got the following answer:

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> _peek._tcp.marathon.mesos SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57329
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;_peek._tcp.marathon.mesos. IN  SRV

;; ANSWER SECTION:
_peek._tcp.marathon.mesos. 60   IN  SRV 0 0 31000 peek-27346-s0.marathon.mesos.

;; ADDITIONAL SECTION:
peek-27346-s0.marathon.mesos. 60 IN A   10.141.141.10

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Oct 24 23:21:15 UTC 2015
;; MSG SIZE  rcvd: 160

Where we can clearly see the port and IP bound to _peek._tcp.marathon.mesos SRV, BUT when I run this on my slave machine - which is running this container - I get this result:

docker@docker-sl-vm:~$ dig _peek._tcp.marathon.mesos SRV

; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> _peek._tcp.marathon.mesos SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 33415
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;_peek._tcp.marathon.mesos. IN  SRV

;; AUTHORITY SECTION:
.           10791   IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2015102801 1800 900 604800 241

;; Query time: 1 msec
;; SERVER: 10.10.11.1#53(10.10.11.1)
;; WHEN: Wed Oct 28 17:06:30 BRT 2015
;; MSG SIZE  rcvd: 129

It looks like mesos-dns can't resolve _peek._tcp.marathon.mesos SRV.

Does anyone know why and how to fix it?

Thank you in advance...

UPDATE

Result of command /etc/resolv.conf :

nameserver 10.10.11.1
nameserver 10.10.10.7

解决方案

Have a look at the Mesos DNS docs regarding Slave Setup:

To allow Mesos tasks to use Mesos-DNS as the primary DNS server, you must edit the file /etc/resolv.conf in every slave and add a new nameserver. For instance, if mesos-dns runs on the server with IP address 10.181.64.13, you should add the line nameserver 10.181.64.13 at the beginning of /etc/resolv.conf on every slave node.

I think the local IP (192.168.56.102) address is missing in your /etc/resolv.conf.

Otherwise, you can also try my minimal Mesos DNS image, but you'd still have to edit the above file.

这篇关于在Mesos群集上安装Mesos-DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆