使用Proxmox 5.4进行集群配置,支持冷迁移。没有配置共享存储,不支持热迁移。
1 环境准备
1.1网络
pve2 192.168.189.2 集群主
pve3 192.168.189.3
pve4 192.168.189.4
openwrt 192.168.189.254
1.2主机名
/etc/hosts
192.168.189.2 pve2 pve2.ict.com
192.168.189.3 pve3 pve3.ict.com
192.168.189.4 pve4 pve4.ict.com
1.3硬盘
除开安装系统的盘,另外有一个500G的SCSI硬盘,路径为 /dev/sdb
1.4重新生成密钥对
root@pve2:~# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
cat .ssh/id_rsa.pub > .ssh/authorized_keys
1.5改源
没有付费,那就去掉企业版的源,用免费的。
sed -i 's/deb/#deb/g' /etc/apt/sources.list.d/pve-enterprise.list
echo "deb http://download.proxmox.com/debian/pve stretch pve-no-subscription" >/etc/apt/sources.list.d/pve-install-repo.list
wget http://download.proxmox.com/debian/proxmox-ve-release-5.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg
apt update && apt dist-upgrade
1.6安装常用工具
安装net-tools , ntpdate, vim,openvswitch-switch
apt install ntpdate net-tools vim
apt install openvswitch-switch
1.7同步时间
ntpdate-debian
1.8注意
三台主机都要操作第4~7步骤。
2 建立集群
2.1创建集群
通过网页操作, 在pve2上建立集群。
2.2加入集群
通过网页操作,加入时需复制主控机的信息到本机。