Proxmox VE 4.x 中文初階學習手冊
https://pve.proxmox.com/wiki/Proxmox_VE_4.x_Cluster#Re-installing_a_cluster_node
Re-installing a cluster node重新安裝 Cluster 中的 node(主機)
節點(node)主機重新安裝前的準備
請先將在這一部節點(node)主機上所有的虛擬機預先遷移至其他節點(node)主機上,
或是將虛擬機及虛擬機的設定檔備份到外接硬碟或隨身碟上.
停用以下的服務:
systemctl stop pvestatd.service systemctl stop pvedaemon.service systemctl stop pve-cluster.service
備份節點(node)和 欉集(cluster)的設定
Backup /var/lib/pve-cluster/
備分 /root/.ssh/ ,
there are two symlinks here to the shared pve config authorized_keys and authorized_keys.orig, don't worry about these two yet as they're stored in /var/lib/pve-cluster/
備份 /etc/corosync/
tar -czf /root/corosync-backup.tar.gz /etc/corosync備份 /etc/hosts/
cp /etc/hosts /root/備份 /etc/network/interfaces
cp /etc/network/interfaces /root/將下列檔案以 scp 方式傳送至其它主機上存放(或直接以隨身隨儲存)
檔案列表如下:
- /root/pve-cluster-backup.tar.gz
- /root/ssh-backup.tar.gz
- /root/corosync-backup.tar.gz
- /root/hosts
- /root/interfaces
重新安裝節點(node)主機
- 將這一部主機關機
- 如果你有使用 severals eth interfaces 和 LACP 或 some kind of load balancing you should configure the first port of the switch to single mode (no LACP) to allow the standard network config in proxmox to connect to the network.
- 重新安裝 Proxmox VE , 並確認主機名稱(hostname)和原來的是一樣的.
- 如果有授權的話,請重新啟用授權.
- 執行系統更新, 以確保本機與其他主機上的套件是一致的.
還原 node and cluster 的設定
將原先備份的設定檔複製到 /root 目錄下.
還原 /etc/hosts/
還原 /etc/network/interfaces
cp /root/interfaces /etc/network/interfaces重要注意事項
Make sure that you have the right switch configuration in case you're 有使用 vlans, specific port assignments or LACP!
If you are using OVS (OpenvSwitch) you have to install the package before reboot.
將這一台節點(node)重新開機
停用下列服務:
systemctl stop pvestatd.service systemctl stop pvedaemon.service systemctl stop pve-cluster.service還原 /root/.ssh/ 下的檔案
cd / ; tar -xzf /root/ssh-backup.tar.gzReplace /var/lib/pve-cluster/ with your backup copy
rm -rf /var/lib/pve-cluster cd / ; tar -xzf /root/pve-cluster-backup.tar.gzReplace /etc/corosync/ with your backup copy
rm -rf /etc/corosync cd / ; tar -xzf /root/corosync-backup.tar.gz重新啟動 pve-cluster
systemctl start pve-cluster.service還原 這兩個連結:
ln -sf /etc/pve/priv/authorized_keys /root/.ssh/authorized_keys ln -sf /etc/pve/priv/authorized_keys /root/.ssh/authorized_keys.origStart the rest of the services:
systemctl start pvestatd.service systemctl start pvedaemon.serviceRe-add the node to the cluster to update the keys and then update the certs
pvecm add xxx.xxx.xxx.xxx -force pvecm updatecertsAccept ssh keys (again) from other nodes This may not be required, but may be required in some cases to make it work without erros!
Additionally you'll need to establish a ssh connection from every cluster other node to the re-installed node via ssh to accept the new host key.
If you have several subnets configured in your nodes make sure that you're accessing the correct ip via ssh.
Working with the Proxmox VE Cluster
Now you can start creating virtual machines on your cluster nodes by using the Central Web-based Management on any node.