Restarted Rancher Server - Lost Configuration

Hi,

I restarted the rancher server and it lost all of its’ hosts and github auth configurations. I ran rancher with -v, as the instructions mentioned for persistent data. Did I miss a configuration?

docker run -d -v /var/docker/mysql:/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server

I guess this leads to another question, if I lose rancher config data, can I add the hosts back with custom (used for google hosts) and just not run the boot script and will it auto populate?

Thanks,
Chris

I just tested this again and a reboot clears out the entire rancher configuration.

/var/run is wiped on reboot (or a tmpfs) on a lot of distributions and is a generally odd choice for storing data you want to keep. What OS are you running? All the Rancher state is in the database, so if the data isn’t there anymore neither is your configuration.

You can delete the /var/lib/rancher/state directory on each host and re-register them to a new server; the containers still running will show up on them, but the definition of the stacks and services was in the database and is gone.

Thank you! I am running RancherOS.

I can stop start the container, see files in /var/docker being updated however on reboot, everything is lost.

OK, fixed.

I didn’t realize /var is not disk mounted. Changed to /mnt

docker run -d -v /mnt/docker/mysql:/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server

Docks could use a note :slight_smile: