Restart rancher/server lose all hosts and stacks

I start use : docker run -d --restart=always --name=rancher-server -p 8080:8080 -v /var/lib/rancher:/var/lib/rancher rancher/server:v1.1.0

shutdown the server host , then restart the host , loses all hosts and stack added before

Hello there,

I just started to use Rancher and I love it, so after a week of test I decided to deploy it on our qa servers, then on production at OVH, so I just figured aout after a power lost that the rancher server ost all stacks and hosts configured, It just did keep the users information. then it is a normal behaviour? how I can void it?

My configuration:
OS: Ubuntu Server 16.04.1 LTS
8 GB RAM

Firewalling with UFW:

To                         Action      From
-----                      ------      -----
22                         ALLOW       10.192.42.0/24            
22                         ALLOW       10.192.40.0/24            
8080                       ALLOW       10.192.42.0/24            
8080                       ALLOW       10.192.40.0/24            
80                         ALLOW       10.192.42.0/24            
80                         ALLOW       10.192.40.0/24            
443                        ALLOW       10.192.40.0/24            
443                        ALLOW       10.192.42.0/24            
500/udp                    ALLOW       10.192.42.0/24            
4500/udp                   ALLOW       10.192.42.0/24            
8081/tcp                   ALLOW       10.192.42.0/24            
8080/tcp                   ALLOW       172.17.0.0/16             
8081/tcp                   ALLOW       172.17.0.0/16  

All IP address where substituted with non valid IP subnets for our security but those that belongs to docker and rancher :wink:

Docker
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 25
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-38-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.791 GiB
Name: dnodo-srv02
ID: IQ7P:MNHL:VVRV:YQGO:6VNF:RCOA:N4GB:DLU4:PLD4:FI7N:N2ZV:6R6D
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

My server was deployed using a docker-compose file:

version: '2'
services:
  rancher:
    image: rancher/server:v1.1.4
    restart: unless-stopped
    ports:
      - 8080:8080
    environment:
      - CATTLE_DB_CATTLE_MYSQL_HOST=my_mysql_percona_based_server
      - CATTLE_DB_CATTLE_MYSQL_PORT=3306
      - CATTLE_DB_CATTLE_MYSQL_NAME=my_database
      - CATTLE_DB_CATTLE_USERNAME=my_user
      - CATTLE_DB_CATTLE_PASSWORD=my_password
    network_mode: bridge

So I reviewed the database just to be sure that the configuration of hosts was saved and there exists, but isn’t fetched by the server after a restart.

I hope some one can help me with this and thanks in advance,

Oscar.

All the persistent state is in the database… Are you sure you’re not looking at the wrong environment? It doesn’t really make sense that auth would be configured but all the other info was lost.

Thank you for your reply,

I figured out that all the issue was related with the environments. I was looking in the wrong place and I can say that my issue was solved.

Just a sugestion, please add an officia procedure to migrate the rancher server to another host, because I tried it and all my host where messed up. Then Rancher is a terrific product and I want to say thank you for your hard work.

Regards,