pve搭建linux虚拟机集群使用AnolisOS 7.9

首先下载AnolisOS 7.9 的镜像,安装系统,一共克隆安装4个,ip地址分别为:

192.168.31.100
192.168.31.101
192.168.31.102
192.168.31.103

修改IP地址:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

修改主机名,分别在4台虚拟机上执行:

hostnamectl set-hostname vm0;
hostnamectl set-hostname vm1;
hostnamectl set-hostname vm2;
hostnamectl set-hostname vm3;

将主机名,IP加入hosts:

vi /etc/hosts

加入以下内容:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.31.100 vm0
192.168.31.101 vm1
192.168.31.102 vm2
192.168.31.103 vm3

配置免密登录:

ssh-keygen -t rsa;
ssh-copy-id 192.168.31.100;
ssh-copy-id 192.168.31.101;
ssh-copy-id 192.168.31.102;
ssh-copy-id 192.168.31.103;

检查每台机器是否都加入成功:

cat ~/.ssh/known_hosts
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享