Proxmox 创建群集与迁移功能使用说明

By | 2018-11-26

1、在主服务器上创建群集

proxmox:~# pveca -c
cluster master successfully created

2、检查群集状态

proxmox:~# pveca -l
CID—-IPADDRESS—-ROLE-STATE——–UPTIME—LOAD—-MEM—DISK
1 : 192.168.100.10    M     A   2 days 18:21   0.00    29%     3%

3、在节点服务器上连接群集(节点即NODE)

proxmox:~# pveca -a -h 192.168.100.10

Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.100.10′ (RSA) to the list of known hosts.
[email protected]’s password:

cluster node successfully created

4、群集创建成功,查看群集运行状态:

proxmox:~# pveca -l
CID—-IPADDRESS—-ROLE-STATE——–UPTIME—LOAD—-MEM—DISK
1 : 192.168.100.10    M     A   2 days 18:52   0.00    29%     3%
2 : 192.168.100.15    N     A           00:38   0.00     5%     1%

此时,就能直接登陆到http://192.168.100.10上,看到两台服务器了。

虚拟机的迁移

由于使用的是local disks(安装虚拟机储存在本地硬盘),不能动态迁移,只能把虚拟机关闭后再迁移!

/usr/sbin/qmigrate –online 192.168.100.15 102
Oct 13 10:31:37 starting migration of VM 102 to host ‘192.168.100.15′
Oct 13 10:31:37 copying disk images
Oct 13 10:31:37 Failed to sync data – can’t do online migration – VM uses local disks
Oct 13 10:31:37 migration aborted
VM 102 migration failed –

关机后成功迁移!

——————————————————————————————————————–
Proxmox 2.0 的操作方法
相关信息来自: http://pve.proxmox.com/wiki/Proxmox_VE_2.0_Cluster

1、在主服务器上创建群集

proxmox:~# pvecm create abc (创建群集名称)

cluster master successfully created

2、检查群集状态

proxmox:~# pvecm status

CID—-IPADDRESS—-ROLE-STATE——–UPTIME—LOAD—-MEM—DISK
1 : 192.168.100.10    M     A   2 days 18:21   0.00    29%     3%

3、在节点服务器上连接群集(节点即NODE)

proxmox:~# pvecm add 192.168.100.10

Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.100.10′ (RSA) to the list of known hosts.
[email protected]’s password:

cluster node successfully created

4、群集创建成功,查看群集运行状态:

proxmox:~# pvecm nodes
CID—-IPADDRESS—-ROLE-STATE——–UPTIME—LOAD—-MEM—DISK
1 : 192.168.100.10    M     A   2 days 18:52   0.00    29%     3%
2 : 192.168.100.15    N     A           00:38   0.00     5%     1%

此时,就能直接登陆到http://192.168.100.10上,看到两台服务器了。

5、RGmanager 无法启动的问题

主要是 fence 未运行

在主服务器和节点主机上运行以下命令

先把 /etc/default/redhat-cluster-pve 里的 “FENCE_JOIN=”yes” 取消注释,默认是注释掉的”

保存后重启服务器,然后执行以下指令

# fence_tool join

# fence_tool ls

再在主服务器和节点主机上启动 rgmanager 服务就能看到状态为 “running” 了

6、在“HA”菜单中点击“添加” –> “HA托管VM/CT” –> 选择需要“托管”的虚拟主机,例如“101” ;最后点击“运行中” 这个设定就生效了

至此虚拟机已经实现HA功能,虚拟机可以在任何一台NODE中“迁移”

發佈留言