vSphere HA集群的基础配置
1.打开之前创建的集群DRS-HA_Cluster的"vSphere 可用性"界面,默认vSphere HA是没有启用的
![image-20231130194634013](https://i0.wp.com/imgs.run/i/2023/11/30/656876227d9b6.png?w=640&ssl=1)
2.打开"编辑"界面,选中"vSphere HA"按钮以启用
![image-20231130195105746](https://i0.wp.com/imgs.run/i/2023/12/01/6569d15b5c37a.png?w=640&ssl=1)
![image-20231130195121962](https://i0.wp.com/imgs.run/i/2023/12/01/6569d167c1c90.png?w=640&ssl=1)
3.开启Proactive HA
![image-20231130195228995](https://i0.wp.com/imgs.run/i/2023/12/01/6569d16f2df54.png?w=640&ssl=1)
4.在vSphere HA设置界面里,打开"启用主机监控"(默认是开启的)
5.将"虚拟机监控"选择"仅虚拟机监控"
![image-20231201181149495](https://i0.wp.com/imgs.run/i/2023/12/01/6569d17e6f575.png?w=640&ssl=1)
随后确认后系统自动配置,任务完成后,查看esxi主机,发现两台主机已变为一主一备
![image-20231201181414985](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1802e610.png?w=640&ssl=1)
![image-20231201181431404](https://i0.wp.com/imgs.run/i/2023/12/01/6569d18b4ea90.png?w=640&ssl=1)
vSphere HA功能测试
为方便测试,在vSphere HA设置界面-准入控制,将"主机故障切换容量的定义依据"改为禁用
![image-20231201181813190](https://i0.wp.com/imgs.run/i/2023/12/01/6569d18166a7f.png?w=640&ssl=1)
由于故障切换要用到实时迁移,因此可以使用ping命令来测试故障切换时的连通性
主机 | ip | 所在esxi主机 |
---|---|---|
ubuntu-iSCSI | 192.168.1.152 | 192.168.0.141 |
ubuntu-iSCSI_2 | 192.168.1.153 | 192.168.0.142 |
在ubuntu-iSCSI_2中去ping另一台虚拟机ubuntu-iSCSI
ping 192.168.1.152
![image-20231201183814926](https://i0.wp.com/imgs.run/i/2023/12/01/6569d18e6a9d7.png?w=640&ssl=1)
此时,将ubuntu-iSCSI所在的esxi主机(192.168.0.141)强制关机
![image-20231201183140681](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1978cf0b.png?w=640&ssl=1)
随后,在警报中爆出"主机连接和电源状况"警报
等待一会会自动进行切换操作,并提示"正在进行故障切换"
![image-20231201184134387](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1964a0d4.png?w=640&ssl=1)
并且该esxi主机(192.168.0.141)页面也会有故障提示
![image-20231201184224584](https://i0.wp.com/imgs.run/i/2023/12/01/6569d19cda4a0.png?w=640&ssl=1)
另一台esxi主机(192.168.0.142)类型自动变为主要
![image-20231201184352828](https://i0.wp.com/imgs.run/i/2023/12/01/6569d19bb6d7f.png?w=640&ssl=1)
ping也恢复正常
![image-20231201184811597](https://i0.wp.com/imgs.run/i/2023/12/01/6569d19d4ef1e.png?w=640&ssl=1)
vSphere FT配置
配置FT需要至少两张网卡(一张用于 vMotion,一张用于Fault Tolerance 日志记录)
这里为实现FT功能,后添一个专用网络(192.168.4.0/24)承担FT日志流量传输
esxi主机 | FT网络内的ip |
---|---|
192.168.0.141 | 192.168.4.141 |
192.168.0.142 | 192.168.4.142 |
1.添加配置FT专用网络
参考前文的流程,启动添加网络引导,选择VMkernel 网络适配器 - 新建标准交换机 - 添加网卡
![image-20231201191315640](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1af67bb2.png?w=640&ssl=1)
端口属性如下
![image-20231201191515275](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1b0376f0.png?w=640&ssl=1)
![image-20231201191636356](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1b1b83c7.png?w=640&ssl=1)
![image-20231201191645669](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1b38a488.png?w=640&ssl=1)
另一台同理
2.启用FT功能过程
需要确认所有参与实验的esxi主机都在一个群集内,因之前实验已确保两台esxi主机在一个群集内,故继续
2.1虚拟机开启FT
1.在需要开启FT的虚拟机上右键,选择"Fault Tolerance"-"打开 Fault Tolerance"
![image-20231201192211795](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1bf79743.png?w=640&ssl=1)
2.选择备用数据存储,即与主存储位置(iSCSIstore)不同的,这里选择(iSCSIstore_3)
![image-20231201192402576](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1bf2f8a4.png?w=640&ssl=1)
3.选择备用esxi主机,这里选择192.168.0.142
![image-20231201192532013](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1c0d4ba8.png?w=640&ssl=1)
![image-20231201192543082](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1ca10439.png?w=640&ssl=1)
4.查看两台esxi主机的虚拟机界面,发现有一主一备
![image-20231201192722760](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1ccd1729.png?w=640&ssl=1)
![image-20231201192732453](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1d416b22.png?w=640&ssl=1)
5.开启虚拟机电源
开机主虚拟机电源,系统会自动将备用虚拟机开机,主备虚拟机都开机后,虚拟机界面会显示被FT保护
![image-20231201193427650](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1d36cc3a.png?w=640&ssl=1)
FT功能测试
1.测试故障切换
可以触发故障切换测试FT保护功能,右键虚拟机-"Fault Tolerance"-"测试故障切换"
![image-20231201193626041](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1d5132e7.png?w=640&ssl=1)
随后触发警报及自动切换任务,切换后发现变为在esxi主机(192.168.0.142)上的备用虚拟机,并更新为主要虚拟机,原在另一台esxi主机(192.168.20.141)上的主虚拟机变为辅助虚拟机
![image-20231201194022612](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1d7cb19b.png?w=640&ssl=1)
![image-20231201194035120](https://i0.wp.com/imgs.run/i/2023/12/01/6569d1d650ca3.png?w=640&ssl=1)
Comments NOTHING