Launching rancher server with bind mount MySQL volume

Rancher Version: 1.6.26

Launched rancher server container with volume and created host and deployed host.
Stopped the first rancher server and launched the second rancher server with the same mount MySQL volume. But the host is still in a disconnected state.

Expected: In second rancher server, all hosts and stacks must be in an active state.

Reference Link: https://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/

If you setup Rancher and add a host, you will get prompted to set a Host Registration URL which will be the endpoint used by the Rancher agent and infrastructure services to connect to Rancher. If you move the rancher/server container with the data, it does not automatically update this setting. So you should move the IP/hostname to point to the new host or basically update the setting and recreate all containers to update.

The rancher/agent container on the host showing disconnected will log why it can’t connect to Rancher.

1 Like

Thanks for your reply. I have changed the settings to current rancher IP address. But the host still in disconnected state. I have tried restarting host but still nothing works. rancher agent logs are not shown. Even if we create container it goes to error state.

Hosts open the connection to the server. Changing the setting on its own does nothing, the hosts don’t know it changed. You need to re-register the nodes using the new custom add host command.

1 Like

Thanks for your reply @vincent. It worked.

Host are in active state after registering the nodes but all the infrastructure and user stacks are in unhealthy state. Stacks are not becoming active. How to resolve this issue.