2020年2月1日 星期六

Proxmox VE two nodes + qdevice HA Cluster 雙節點叢集

在GUI 的資料中心介,有 pve1 , pve2 和 qdevice (ip : 192.168.1.30)
一般都是用 Raspberry Pi 做 qdevice,但因為剛好有台 windows 10 常開,所以我就用 windows 10 裡的 hyper-V 灌 Ubuntu 18.043 LTS Server 來當 qdevice

在  hyper-V 上安裝好 Ubuntu 後記得要為固定 IP 以及讓 SSH 允許 root 登入
nano /etc/ssh/sshd_config
修改以下內容
PermitRootLogin yes
再來安裝 corosync-qnetd
apt install -y corosync-qnetd
接著在 PVE1 和 PVE2 上安裝 corosync-qdevice
apt install -y corosync-qdevice
PVE1 及 PVE2 都裝好之後,找一台下指令
pvecm qdevice setup 192.168.1.30
執行後會發現跳出錯誤
...
..
.
INFO: start and enable corosync qdevice daemon on node 'pve1'...
Synchronizing state of corosync-qdevice.service with SysV service script with /l                                                                                                                                                             ib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable corosync-qdevice
update-rc.d: error: corosync-qdevice Default-Start contains no runlevels, aborti                                                                                                                                                             ng.
command 'ssh -o 'BatchMode=yes' -lroot 192.168.1.90 systemctl enable corosync-qd
evice' failed: exit code 1
查了許久,原來是bug!!
所以要到 PVE1 及 PVE2 修正,在 /etc/init.d/corosync-qdevice 裡找到 Default-Start 加入 2 3 4 5
### BEGIN INIT INFO
# Provides:  corosync-qdevice
# Required-Start: $remote_fs $syslog corosync
# Required-Stop: $remote_fs $syslog corosync
# Default-Start: 2 3 4 5
# Default-Stop:  0 1 6
# Short-Description: Corosync Qdevice daemon
# Description:  Starts and stops Corosync Qdevice daemon.
### END INIT INFO
然後分別在 PVE1 及 PVE2 上執行
update-rc.d -f corosync-qdevice remove
update-rc.d -f corosync-qdevice defaults
重新載入 corosync-qdevice,
載入完後, PVE1 及 PVE2 上執行 (注意!兩台 PVE HOST 都要執行)
systemctl enable corosync-qdevice.service
然後查詢狀態
pvecm status
看到有三台 vote,就設定完成
Cluster information
-------------------
Name:             LAB
Config Version:   3
Transport:        knet
Secure auth:      on

Quorum information
------------------
Date:             Sun Feb  2 01:38:55 2020
Quorum provider:  corosync_votequorum
Nodes:            2
Node ID:          0x00000001
Ring ID:          1.150
Quorate:          Yes

Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2
Flags:            Quorate Qdevice

Membership information
----------------------
    Nodeid      Votes    Qdevice Name
0x00000001          1    A,V,NMW 192.168.1.90 (local)
0x00000002          1         NR 192.168.1.20
0x00000000          1            Qdevice

參考資料
Proxmox 6.1 Cluster Manager
Bug #1809682 "systemctl enable corosync-qdevice.service" fails

沒有留言:

張貼留言