rancher: Unable to run rancher host/agent on same machine that rancher/server container on
CentOS7.2.1511 kernel 3.10.0-327.13.1, docker 1.11.0, build 4dc5990. Trying to run rancher/agent host on same machine that rancher/server container on. With rancher server public address, it stuck at curl command. From the agent host, not able to ping public IP.
| Useful | Info |
|---|---|
| Versions | Rancher v1.0.1 Cattle: v0.159.7 UI: v1.0.5 |
| Access | localauth admin |
| Route | authenticated.project.help |
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17
On my Ubuntu 16.04 it’s iptables issue, I flush any rules and set policy to ACCEPT, restart docker daemon - problem solved with default agent cmd from webUI, with CATTLE_AGENT_IP as real external IP.
UPD
kernel: iptables: blocked: IN=docker0 OUT= PHYSIN=veth72d701a MAC=... SRC=172.17.0.3 DST=[PUBLIC-IP] LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16008 DF PROTO=TCP SPT=38082 DPT=8080 WINDOW=29200 RES=0x00 SYN URGP=0So, i just add this docker subnet to my rules
UPD2 and another one, without this scheduler/healthcheck are broken
-A INPUT-s 10.0.0.0/8 -j ACCEPTUPD3 ALLinONE fix 4 my issue:
iptables -I INPUT -i docker0 -j ACCEPTI still have this issue?
I had the same issue. Fixed that by deleting the files under /var/lib/rancher (only the files, not the folders).
In case your server uses a domain name (i.e. rancher.server.com), edit the /etc/hosts file and add the server address to it. I prefer to use the internal IP address instead of the public IP because I had fewer problems this way.
Then, rerun the agent registration:
sudo docker run -e CATTLE_AGENT_IP=[PRIV-IP-ADDRESS] --add-host rancher.server.com:[PRIV-IP-ADDRESS] -d --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 https://rancher.server.com/v1/scripts/753155FC97D6375C1F3A:1468022400000:JWzjpNACU9EjJ3iRyGueT8ooCxQ
Hope it helps.