当地的牧场主不会在gui上看到

时间:2018-05-30 15:09:27

标签: docker rancher

我正在尝试在ubuntu笔记本电脑上设置一个牧场环境以进行测试。我正在重现在另一台服务器上运行的步骤(这个与Debian一起运行)以使其运行但我遇到了一些麻烦。

主机是ubuntu 16.0.4。我已经安装了docker-ce。

sudo docker version
Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:17:20 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:15:30 2018
  OS/Arch:      linux/amd64
  Experimental: false

一旦跑步,我就让牧场主开始工作:

sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable

然后我尝试在同一台机器上创建Host以便能够创建容器:

sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.10 http://192.168.20.213:8080/v1/scripts/adsasdsaddsa:sadsadasd:p7DSjasdasdsadsad

该过程运行没有任何错误。我可以在syslog中看到这个:

INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.20.213:8080/v1
INFO: Attempting to connect to: http://192.168.20.213:8080/v1
INFO: http://192.168.20.213:8080/v1 is accessible
INFO: Configured Host Registration URL info: CATTLE_URL=http://192.168.20.213:8080/v1 ENV_URL=http://192.168.20.213:8080/v1
INFO: Inspecting host capabilities
INFO: Boot2Docker: false
INFO: Host writable: true
INFO: Token: xxxxxxxx
INFO: Running registration
INFO: Printing Environment
INFO: ENV: CATTLE_ACCESS_KEY=6902E1686E18CCA097E6
INFO: ENV: CATTLE_HOME=/var/lib/cattle
INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken
INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx
INFO: ENV: CATTLE_URL=http://192.168.20.213:8080/v1
INFO: ENV: DETECTED_CATTLE_AGENT_IP=172.17.0.1
INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v1.2.10
INFO: Launched Rancher Agent: 974e4f7a9ca831e6cb829fa8c80a67049d479fd724090dbeb97602f1b5022d26

当我回到牧场主gui时,我看不到主持人。 docker container ls显示客户端容器正在运行。

我错过了什么?

更新:

如响应中所指出的,用于服务器和客户端之间的相互引用的IP地址可能存在问题。我删除了客户端和服务器并重新启动它。我正在使用172.17.0.1,我相信它是定位器(不是我的局域网IP)。这就是我在日志中看到的内容:

May 31 08:40:20 hostname NetworkManager[1262]: <warn>  [1527748820.3585] device (vethcd45753): failed to find device 19 'vethcd45753' with udev
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3602] manager: (vethcd45753): new Veth device (/org/freedesktop/NetworkManager/Devices/23)
May 31 08:40:20 hostname systemd-udevd[1773]: Could not generate persistent MAC address for vethcd45753: No such file or directory
May 31 08:40:20 hostname systemd-udevd[1774]: Could not generate persistent MAC address for veth6f6f5bc: No such file or directory
May 31 08:40:20 hostname NetworkManager[1262]: <warn>  [1527748820.3616] device (veth6f6f5bc): failed to find device 20 'veth6f6f5bc' with udev
May 31 08:40:20 hostname kernel: [58919.966247] docker0: port 2(veth6f6f5bc) entered blocking state
May 31 08:40:20 hostname kernel: [58919.966250] docker0: port 2(veth6f6f5bc) entered disabled state
May 31 08:40:20 hostname kernel: [58919.966290] device veth6f6f5bc entered promiscuous mode
May 31 08:40:20 hostname kernel: [58919.967341] IPv6: ADDRCONF(NETDEV_UP): veth6f6f5bc: link is not ready
May 31 08:40:20 hostname kernel: [58919.967345] docker0: port 2(veth6f6f5bc) entered blocking state
May 31 08:40:20 hostname kernel: [58919.967348] docker0: port 2(veth6f6f5bc) entered forwarding state
May 31 08:40:20 hostname kernel: [58919.970459] docker0: port 2(veth6f6f5bc) entered disabled state
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3650] manager: (veth6f6f5bc): new Veth device (/org/freedesktop/NetworkManager/Devices/24)
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3808] devices added (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753)
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3808] device added (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753): no ifupdown configuration found.
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3909] devices added (path: /sys/devices/virtual/net/veth6f6f5bc, iface: veth6f6f5bc)
May 31 08:40:20 hostname NetworkManager[1262]: <info>  [1527748820.3910] device added (path: /sys/devices/virtual/net/veth6f6f5bc, iface: veth6f6f5bc): no ifupdown configuration found.
May 31 08:40:20 hostname dockerd[1961]: time="2018-05-31T08:40:20.480191097+02:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
May 31 08:40:20 hostname dockerd[1961]: time="2018-05-31T08:40:20.480238871+02:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"
May 31 08:40:20 hostname dockerd[1961]: time="2018-05-31T08:40:20+02:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/77f35a0fb4e594bdb7005b8b997bdfd83e6a588cf15d7327bd5ea8dd26dfdffd/shim.sock" debug=false module="containerd/tasks" pid=1812
May 31 08:40:21 hostname kernel: [58920.702259] eth0: renamed from vethcd45753
May 31 08:40:21 hostname NetworkManager[1262]: <info>  [1527748821.1226] devices removed (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753)
May 31 08:40:21 hostname NetworkManager[1262]: <info>  [1527748821.1235] device (vethcd45753): driver 'veth' does not support carrier detection.
May 31 08:40:21 hostname NetworkManager[1262]: <info>  [1527748821.1242] device (veth6f6f5bc): link connected
May 31 08:40:21 hostname kernel: [58920.730229] IPv6: ADDRCONF(NETDEV_CHANGE): veth6f6f5bc: link becomes ready
May 31 08:40:21 hostname kernel: [58920.730320] docker0: port 2(veth6f6f5bc) entered blocking state
May 31 08:40:21 hostname kernel: [58920.730325] docker0: port 2(veth6f6f5bc) entered forwarding state
May 31 08:40:22 hostname NetworkManager[1262]: <warn>  [1527748822.1365] device (veth909de27): failed to find device 21 'veth909de27' with udev
May 31 08:40:22 hostname kernel: [58921.744449] docker0: port 3(vethb372dab) entered blocking state
May 31 08:40:22 hostname kernel: [58921.744452] docker0: port 3(vethb372dab) entered disabled state
May 31 08:40:22 hostname kernel: [58921.744511] device vethb372dab entered promiscuous mode
May 31 08:40:22 hostname kernel: [58921.744799] IPv6: ADDRCONF(NETDEV_UP): vethb372dab: link is not ready
May 31 08:40:22 hostname systemd-udevd[1950]: Could not generate persistent MAC address for veth909de27: No such file or directory
May 31 08:40:22 hostname systemd-udevd[1951]: Could not generate persistent MAC address for vethb372dab: No such file or directory
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1391] manager: (veth909de27): new Veth device (/org/freedesktop/NetworkManager/Devices/25)
May 31 08:40:22 hostname NetworkManager[1262]: <warn>  [1527748822.1396] device (vethb372dab): failed to find device 22 'vethb372dab' with udev
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1414] manager: (vethb372dab): new Veth device (/org/freedesktop/NetworkManager/Devices/26)
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1650] devices added (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27)
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1650] device added (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27): no ifupdown configuration found.
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1653] devices added (path: /sys/devices/virtual/net/vethb372dab, iface: vethb372dab)
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.1654] device added (path: /sys/devices/virtual/net/vethb372dab, iface: vethb372dab): no ifupdown configuration found.
May 31 08:40:22 hostname avahi-daemon[970]: Joining mDNS multicast group on interface veth6f6f5bc.IPv6 with address fe80::1cb8:cdff:fed8:86d8.
May 31 08:40:22 hostname avahi-daemon[970]: New relevant interface veth6f6f5bc.IPv6 for mDNS.
May 31 08:40:22 hostname avahi-daemon[970]: Registering new address record for fe80::1cb8:cdff:fed8:86d8 on veth6f6f5bc.*.
May 31 08:40:22 hostname dockerd[1961]: time="2018-05-31T08:40:22.269419748+02:00" level=info msg="No non-localhost DNS nameservers are left in resolv.conf. Using default external servers: [nameserver 8.8.8.8 nameserver 8.8.4.4]"
May 31 08:40:22 hostname dockerd[1961]: time="2018-05-31T08:40:22.269480537+02:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 2001:4860:4860::8844]"
May 31 08:40:22 hostname dockerd[1961]: time="2018-05-31T08:40:22+02:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/9597151e26d89499c735d9bb8beaa3e9e8c13e1a19f4311eb227fc6a7ec6c936/shim.sock" debug=false module="containerd/tasks" pid=1988
May 31 08:40:22 hostname kernel: [58922.522818] eth0: renamed from veth909de27
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.9346] devices removed (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27)
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.9354] device (veth909de27): driver 'veth' does not support carrier detection.
May 31 08:40:22 hostname NetworkManager[1262]: <info>  [1527748822.9359] device (vethb372dab): link connected
May 31 08:40:22 hostname kernel: [58922.542144] IPv6: ADDRCONF(NETDEV_CHANGE): vethb372dab: link becomes ready
May 31 08:40:22 hostname kernel: [58922.542234] docker0: port 3(vethb372dab) entered blocking state
May 31 08:40:22 hostname kernel: [58922.542238] docker0: port 3(vethb372dab) entered forwarding state
May 31 08:40:23 hostname dockerd[1961]: time="2018-05-31T08:40:23+02:00" level=info msg="shim reaped" id=9597151e26d89499c735d9bb8beaa3e9e8c13e1a19f4311eb227fc6a7ec6c936 module="containerd/tasks"
May 31 08:40:23 hostname dockerd[1961]: time="2018-05-31T08:40:23.295008937+02:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
May 31 08:40:23 hostname kernel: [58922.988229] docker0: port 3(vethb372dab) entered disabled state
May 31 08:40:23 hostname kernel: [58922.988464] veth909de27: renamed from eth0
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.4348] device (vethb372dab): link disconnected
May 31 08:40:23 hostname NetworkManager[1262]: <warn>  [1527748823.4350] device (veth909de27): failed to find device 21 'veth909de27' with udev
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.4376] manager: (veth909de27): new Veth device (/org/freedesktop/NetworkManager/Devices/27)
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.4658] devices added (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27)
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.4658] device added (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27): no ifupdown configuration found.
May 31 08:40:23 hostname kernel: [58923.177058] docker0: port 3(vethb372dab) entered disabled state
May 31 08:40:23 hostname kernel: [58923.179239] device vethb372dab left promiscuous mode
May 31 08:40:23 hostname kernel: [58923.179244] docker0: port 3(vethb372dab) entered disabled state
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.5996] devices removed (path: /sys/devices/virtual/net/veth909de27, iface: veth909de27)
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.6023] device (veth909de27): driver 'veth' does not support carrier detection.
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.6027] device (vethb372dab): driver 'veth' does not support carrier detection.
May 31 08:40:23 hostname NetworkManager[1262]: <info>  [1527748823.6096] devices removed (path: /sys/devices/virtual/net/vethb372dab, iface: vethb372dab)
May 31 08:40:28 hostname dockerd[1961]: time="2018-05-31T08:40:28+02:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/b3aef1bac28bd6e5241ca1da4acc83ebb4c0c7f7f9498b1e4461cf7957f21a46/shim.sock" debug=false module="containerd/tasks" pid=2217
May 31 08:40:28 hostname dockerd[1961]: time="2018-05-31T08:40:28+02:00" level=info msg="shim reaped" id=77f35a0fb4e594bdb7005b8b997bdfd83e6a588cf15d7327bd5ea8dd26dfdffd module="containerd/tasks"
May 31 08:40:28 hostname dockerd[1961]: time="2018-05-31T08:40:28.794313019+02:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
May 31 08:40:28 hostname kernel: [58928.524471] docker0: port 2(veth6f6f5bc) entered disabled state
May 31 08:40:28 hostname kernel: [58928.524586] vethcd45753: renamed from eth0
May 31 08:40:28 hostname NetworkManager[1262]: <info>  [1527748828.9481] device (veth6f6f5bc): link disconnected
May 31 08:40:28 hostname NetworkManager[1262]: <warn>  [1527748828.9483] device (vethcd45753): failed to find device 19 'vethcd45753' with udev
May 31 08:40:28 hostname NetworkManager[1262]: <info>  [1527748828.9501] manager: (vethcd45753): new Veth device (/org/freedesktop/NetworkManager/Devices/28)
May 31 08:40:28 hostname NetworkManager[1262]: <info>  [1527748828.9704] devices added (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753)
May 31 08:40:28 hostname NetworkManager[1262]: <info>  [1527748828.9704] device added (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753): no ifupdown configuration found.
May 31 08:40:29 hostname avahi-daemon[970]: Interface veth6f6f5bc.IPv6 no longer relevant for mDNS.
May 31 08:40:29 hostname avahi-daemon[970]: Leaving mDNS multicast group on interface veth6f6f5bc.IPv6 with address fe80::1cb8:cdff:fed8:86d8.
May 31 08:40:29 hostname kernel: [58928.775150] docker0: port 2(veth6f6f5bc) entered disabled state
May 31 08:40:29 hostname kernel: [58928.778027] device veth6f6f5bc left promiscuous mode
May 31 08:40:29 hostname kernel: [58928.778032] docker0: port 2(veth6f6f5bc) entered disabled state
May 31 08:40:29 hostname avahi-daemon[970]: Withdrawing address record for fe80::1cb8:cdff:fed8:86d8 on veth6f6f5bc.
May 31 08:40:29 hostname NetworkManager[1262]: <info>  [1527748829.1870] devices removed (path: /sys/devices/virtual/net/vethcd45753, iface: vethcd45753)
May 31 08:40:29 hostname NetworkManager[1262]: <info>  [1527748829.1886] device (vethcd45753): driver 'veth' does not support carrier detection.
May 31 08:40:29 hostname NetworkManager[1262]: <info>  [1527748829.1893] device (veth6f6f5bc): driver 'veth' does not support carrier detection.
May 31 08:40:29 hostname NetworkManager[1262]: <info>  [1527748829.1942] devices removed (path: /sys/devices/virtual/net/veth6f6f5bc, iface: veth6f6f5bc)
May 31 08:40:30 hostname dockerd[1961]: time="2018-05-31T08:40:30+02:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/86b6f6cf26ca259d8dd51d95e9f970fd385845c24c78a0a3543164f3a0a3fd2a/shim.sock" debug=false module="containerd/tasks" pid=2375
May 31 08:40:30 hostname dockerd[1961]: time="2018-05-31T08:40:30+02:00" level=info msg="shim reaped" id=86b6f6cf26ca259d8dd51d95e9f970fd385845c24c78a0a3543164f3a0a3fd2a module="containerd/tasks"
May 31 08:40:30 hostname dockerd[1961]: time="2018-05-31T08:40:30.787484070+02:00" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"

我可以看到与界面定义和激活相关的一些错误,但我不确定它们是否相关。

1 个答案:

答案 0 :(得分:0)

由于rancher/serverrancher/agent容器都在同一主机上运行,​​因此您需要指定代理IP。否则,将被错误地检测到。您可以在代理日志中看到这一点:

INFO: ENV: DETECTED_CATTLE_AGENT_IP=172.17.0.1

要解决此问题,请使用docker rm命令删除现有代理容器,然后在UI中使用deactivatedelete主机。更多信息here

在“添加主机”页面中,指定IP地址以生成正确的注册URL。

参考:https://rancher.com/docs/rancher/v1.6/en/faqs/troubleshooting/#are-the-ips-of-the-hosts-correct-in-the-ui