server迁移
先在原机器上把数据压缩,不要关闭源集群rancher server 因为后面还要执行kubectl
docker create --volumes-from myrancher-new --name rancher-data-new rancher/rancher:v2.3.2
docker run --volumes-from rancher-data-new -v $PWD:/backup csighub.tencentyun.com/tme-kubeflow/alpine tar zcvf /backup/rancher-data-backup-2.3.2-20210101.tar.gz /var/lib/rancher
把tar.gz 文件复制到新的rancher server机器上
tar -zxvf rancher-data-backup-2.3.2-20210101.tar.gz && mv var/lib/rancher /var/lib/
新机器上启动新的rancher server
sudo docker run -d --restart=unless-stopped -v /var/lib/rancher:/var/lib/rancher -p 443:443 --privileged --name=myrancher -e AUDIT_LEVEL=3 rancher/rancher:v2.3.2
1、新rancher server的web界面上修改rancher server的url 2、打开地址 https://新rancher的ip/v3/clusters/源集群id/clusterregistrationtokens 类似 https://100.116.64.86/v3/clusters/c-dfqxv/clusterregistrationtokens
|