Just setting up rancher for the first time and my first host is disconnected

I set up Rancher on Debian8 following the quick start guide. Added another debian8 box as the first host all OK. I then rebooted that 1st host and now under hosts it says “disconnected” and I cant get it to re-connect. How do I get it to reconnect?

I checked on the host, the agent appears to be running OK. There are no firewalls in the way.

OK, I just tried to add a second host and that has not succeeded. I assume then there is something badly wrong with the rancher install.

Great first impressions of rancher…not :frowning:

OK, so I deleted the entire setup (rm’d all the containers) and re-did. First host will not connect to rancher but the second one has :frowning:

Yeah, the only time I’ve been able to install rancher properly is when it’s running on RancherOS. I always got random network issues when I tried setting it up manually.

I suspect its network. I dont know much about docker but on both hosts the network docker0 has the same IP 172.17.0.1 I dont see how that is right.

Actually all three boxes have that same Ip for docker0. So I have no idea what I am doing wrong ::frowning:

I set my networking to use dhcp, and I haven’t had an issue with it yet. Use either sudo ros config set network.interfaces.eth0.dhcp true, or modify your /var/lib/rancher/conf/cloud-config.d/user_config.yml to have a reasonable base network config like this:

rancher:
  ...
  network:
    dns:
      nameservers:
        - # your 1st dns server ip
        - # your 2nd dns server ip
      search:
        - example.local # only if you have a local domain
    http_proxy: # if you're using an http proxy
    https_proxy: # same for https
    no_proxy: # etc.
    interfaces:
      eth0: # Can also use eth* I think
        dhcp: true
        gateway: # network gateway ip

If modifying that file, make sure to double-check /var/lib/rancher/conf/cloud-config.yml doesn’t interfere, and after any changes, run sudo ros config validate -i /var/lib/rancher/conf/cloud-config.yml (same for the other file).

Hopefully that helps a bit.

The external IPs ie eth0 are all OK. ping and ssh works fine.

Sorry no idea what you mean about altering the network

Right, the docker0 ifconfig entry is immaterial in this case I think. You’re not running multiple daemons on the same machine, are you? If not, have you run the rancher-agent on all the target daemons?

Ah, my bad, I’m using RancherOS, not Debian. The principle should still be the same, however.

I went to the “add host” section and put in the IP and took the command output, ssh’d over to the host and ran it. Repeated for the second host.

Hmm. That should have worked.
Try it without specifying the ip manually, then check the rancher-agent container logs to see what might be the issue. When I was having trouble, it was because the agent was mysteriously unable to connect to the master.

Ah, also, if you’re not installing Rancher on RancherOS, you’re actually on the wrong subforum. This is for RancherOS issues, not Rancher issues. Easy mistake to make.

Oh Ok I’ll try and post again.

In the hosts section should there be a “box” for each host? What I am seeing is there is one box and the name of the host box keeps flicking between host1 and host2

You may want to go to the add host screen multiple times, but I’m not sure that’ll make a difference. I’ve never seen a problem like that before.

Since the FQDN is flicking back and forth I suspect its not a good idea to try re-adding. Either I have done something wrong or I have hit a bug but a repeatable one.

thanks for your help :slight_smile: