#yum install docker-io
#systemctl start docker
序号 ip 用途 备注
1 192.168.1.237 rancher主
2 192.168.1.236 rancher从
3 192.168.1.238 rancher从
#docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
http://192.168.1.237:8080/admin/access/local
访问控制:添加用户账户信息 admin/[email protected]
应用商店安装k8s
#192.168.1.236加入rancher集群
docker run -e CATTLE_AGENT_IP="192.168.1.236" -e CATTLE_HOST_LABELS=‘Name=docker01‘ --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.11 http://192.168.1.237:8080/v1/scripts/6A7548B62F95B0FEB565:1514678400000:cNvU3MmLyADRXY3xKEV5SGNCWg
应用商店安装k8s Kubernetes集群
卸载rancher集群节点:
192.168.1.236
停止所有容器
docker ps -a |awk ‘{print $1}‘ |while read line ; do docker stop $line; done
192.168.1.236
删除所有容器
docker ps -a |awk ‘{print $1}‘ |while read line ; do docker rm -f $line; done
卸载docker
docker.x86_64 2:1.13.1-74.git6e3bb8e.el7.centos
yum remove docker-* -y
rancher主节点192.168.1.237
docker stop rancher/server
docker rm rancher/server
yum remove docker-* -y
原文地址:http://blog.51cto.com/zjunzz/2298931