无法添加Rancher主机并使它们保持活动状态

时间:2018-12-17 13:51:14

标签: docker rancher

因此,我有几个正在运行的虚拟机,我想要一个(简化的设置)虚拟机,其中有一个用于Rancher的主机(10.100.10.1)和一个用于运行容器的主机(10.100.10.4)。我已经在管理机上安装了Rancher服务器1.6.25,并且在两台机器上都安装了Docker CE版本18.06.1〜ce〜3-0〜ubuntu。它们都在Ubuntu 18.04 LTS上运行。

在管理机上,我使用以下设置https://pastebin.com/KgCxQdfH运行nginx,因此它将80流量定向到8080。Rancher使用

运行
sudo docker run -d -v <host_vol>:/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server. 

我也在两台机器上都运行了sudo ufw allow 500 / udp和sudo ufw allow 4500 / udp。我还必须做https://docs.docker.com/install/linux/linux-postinstall/#specify-dns-servers-for-docker,因为它没有执行就给出了错误。

问题是,当我尝试添加主机时,我很难注册它,即使在它成功连接后,Rancher仍难以保持活动状态。当我注册一个代理商时,起初会给出以下信息:

time=“2018-12-17T13:23:28Z” level=info msg=“Host not registered yet. Sleeping 1 second and trying again. reportedUuid=a0ca6f30-a804-4227-5532-8c2692673e56 Attempt=12”
time=“2018-12-17T13:23:29Z” level=info msg=“Host not registered yet. Sleeping 1 second and trying again. reportedUuid=a0ca6f30-a804-4227-5532-8c2692673e56 Attempt=13”
time=“2018-12-17T13:23:30Z” level=info msg=“Host not registered yet. Sleeping 1 second and trying again. reportedUuid=a0ca6f30-a804-4227-5532-8c2692673e56 Attempt=14”
…
time=“2018-12-17T12:28:57Z” level=error msg=“Failed to get connection token for host-api startup: Reached max retry attempts for getting token”

然后连接一段时间:

time=“2018-12-17T13:23:31Z” level=info msg=“Connecting to proxy.” url=“ws://10.100.10.1/v1/connectbackend?token=token”

这比我过去花费的时间更长,而且几次完全失败了,这意味着我开始从10.100.10.1收到401条消息(也许令牌已过期?)。但是即使后来我设法使其连接到主机,主机仍会在UI中保持Disconnected => Reconnecting -state的状态。然后在rancher-server日志中,我得到以下提示:

2018-12-17 13:24:06,050 ERROR [3a6531c0-b638-4494-bcad-2ee79553901e:3725] [instance:111] [instance.start->(InstanceStart)] [] [ecutorService-4] [i.c.p.process.instance.InstanceStart] Failed [Dependencies readiness error instance is not     running] for instance [111]
2018-12-17 13:24:07,047 ERROR [7c3e0b91-7037-4df2-96bd-634aba7eca39:3732] [instance:112] [instance.start->(InstanceStart)] [] [ecutorService-3] [i.c.p.process.instance.InstanceStart] Failed [Dependencies readiness error instance is not     running] for instance [112]
2018-12-17 13:24:07,048 ERROR [c995c17c-6e33-4308-b0e3-f4ded72ca0dc:3736] [instance:113] [instance.start->(InstanceStart)] [] [ecutorService-5] [i.c.p.process.instance.InstanceStart] Failed [Dependencies readiness error instance is not     running] for instance [113]
2018-12-17 13:24:11,644 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [43] count [3]
2018-12-17 13:24:16,645 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [43] count [4]
2018-12-17 13:24:21,645 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [43] count [5]
2018-12-17 13:24:26,646 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Failed to get ping from agent [43] count [6]
2018-12-17 13:24:26,648 ERROR [:] [] [] [] [TaskScheduler-1] [i.c.p.a.s.ping.impl.PingMonitorImpl ] Scheduling reconnect for agent [43] host [8] count [6]

因此,我添加的虚拟机一直保持断开状态。这是对该问题的简化说明,因此,如果需要更多信息,我可以提供此信息,但是在设置时受到以下限制的确可能是错误的:

A)无法将主机注册到牧场主。它可能会失败很长时间,以至于一直提供401:无法获得用于主机API启动的rancher客户端:错误的响应statusCode [401]。状态[401未经授权]。正文:来自[{http://10.100.10.1/v1]

的[code = Unauthorized,baseType = error,message = Unauthorized]

B)如果主机已注册,则无法将其保持为活动状态,它会一直处于断开/重新连接状态,并且有时会弹出“活动”。

C)如果我对主机进行ping,卷曲等操作,流量似乎可以从主机中顺利通过。

0 个答案:

没有答案