在Rancher上运行领事

时间:2016-10-02 14:34:53

标签: consul rancher

我想让领事在Rancher上跑。 这似乎应该是一件容易的事,因为已经有了一个目录项。

然而,我们无法使其工作,它在启动时抛出异常,说服务器中的json无效。 (这个server.json所在的位置或它的用途对我们来说仍然是个谜)

所以,我试图让它手动运行。 有一些docker-compose脚本,其中没有一个在rancher中工作。

我尝试手动设置每个服务器,但仍然失败,每个节点都抱怨它没有从其他节点获得任何ping。

enter image description here

这是我想要构建的docker-compose文件: https://github.com/AsynkronIT/ConsulCluster/blob/master/docker-compose.yml

consul1:
  ports:
  - 8400:8400/tcp
  - 8500:8500/tcp
  - 8600:8600/tcp
  - 8301:8301/tcp
  - 8301:8301/udp
  - 8302:8302/tcp
  - 8302:8302/udp
  environment:
    CONSUL_LOCAL_CONFIG: '{"skip_leave_on_interrupt": true}'
  labels:
    io.rancher.container.pull_image: always
  tty: true
  command:
  - agent
  - -server
  - -bootstrap-expect=3
  - -ui
  hostname: consulserver1
  image: consul:latest
  stdin_open: true

consul2:
  ports:
  - 8400:8400/tcp
  - 8500:8500/tcp
  - 8600:8600/tcp
  - 8301:8301/tcp
  - 8301:8301/udp
  - 8302:8302/tcp
  - 8302:8302/udp
  environment:
    CONSUL_LOCAL_CONFIG: '{"skip_leave_on_interrupt": true}'
  labels:
    io.rancher.container.pull_image: always
  tty: true
  command:
  - agent
  - -server
  - -bootstrap-expect=3
  - -retry-join=consul1
  hostname: consulserver2
  image: consul:latest
  stdin_open: true
  links:
  - consul1

consul3:
  ports:
  - 8400:8400/tcp
  - 8500:8500/tcp
  - 8600:8600/tcp
  - 8301:8301/tcp
  - 8301:8301/udp
  - 8302:8302/tcp
  - 8302:8302/udp
  environment:
    CONSUL_LOCAL_CONFIG: '{"skip_leave_on_interrupt": true}'
  labels:
    io.rancher.container.pull_image: always
  tty: true
  command:
  - agent
  - -server
  - -bootstrap-expect=3
  - -retry-join=consul1
  hostname: consulserver3
  image: consul:latest
  stdin_open: true
  links:
  - consul1

我做错了什么? 还有其他人真的设法让领事与牧场主一起工作吗?

这一点对我来说非常奇怪:

memberlist: Suspect consulserver1 has failed, no acks received
memberlist: Got ping for unexpected node 'consulserver1' from=172.17.0.3:8301
memberlist: Got ping for unexpected node consulserver1 from=172.17.0.3:47164
memberlist: Failed TCP fallback ping: EOF
memberlist: Marking consulserver1 as failed, suspect timeout reached (0 peer confirmations)

日志显示它没有从consulserver1得到任何消息,同时它抱怨意外的节点consulserver1正在ping它..为什么?

0 个答案:

没有答案