https://github.com/rancher/os 先现在所需镜像

虚拟机引导

默认直接登录了,sudo passwd rancher  修改默认密码,然后ifconfig查看ip

用ssh生成密钥,导出pub公钥,复制到下面替换

创建cloud-config.yml
###cloud-config.yml

rancher:
docker:
registry_mirror: https://xxxx.mirror.aliyuncs.com  阿里云镜像加速
network:
interfaces:
eth0:
address: 192.168.123.219/24
gateway: 192.168.123.1
mtu: 1500
dhcp: false
dns:
nameservers:
- 223.5.5.5
- 223.6.6.6

ssh_authorized_keys:
- ssh-rsa 密钥

sudo fdisk -l 查看硬盘为/dev/sda

sudo ros install –cloud-config cloud-config.yml  –device /dev/sda 

安装到硬盘

部署rancher

sudo docker run -d –restart=always –name=rancher -p 8080:8080 rancher/server:stable

登录后开启本地认证,然后添加主机,ip填自己,复制到ssh里执行后就能看到了。

分类: Linux

0 条评论

发表回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注