DM8 主备集群手动切换
1. 关闭后台监听器进程
# 服务名 根据实际情况修改
systemctl stop DmMonitorServiceconfirm.service
2. 前台方式启动监听器
su - dmdba
/dm/bin/dmmonitor path=/dm/data/dmmonitor.ini
3. 查看集群状态
show global info
其中 GROUP GRP1 为集群的组名,当前【ZWWW_02】实例为主,【ZWWW】实例为备。
#================================================================================#
show global info
2023-01-10 08:52:26
#================================================================================#
GROUP OGUID MON_CONFIRM MODE MPP_FLAG
GRP1 453331 TRUE AUTO FALSE
<<DATABASE GLOBAL INFO:>>
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.20.237.3 15239 2023-01-10 08:52:25 GLOBAL VALID OPEN ZWWW_02 OK 1 1 OPEN PRIMARY DSC_OPEN REALTIME VALID
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.20.237.2 15239 2023-01-10 08:52:25 GLOBAL VALID OPEN ZWWW OK 1 1 OPEN STANDBY DSC_OPEN REALTIME VALID
#================================================================================#
4. 开始切换
4.1 登录监听器
login
用户名:sysdba
密码:
[monitor] 2023-01-10 08:55:30: 登录监视器成功!
4.2 查看可切换节点
choose switchover GRP1
Can choose one of the following instances to do switchover:
1: ZWWW
4.3 切换节点
switchover ZWWW
4.4 验证
show global info
2023-01-10 08:58:44
#================================================================================#
GROUP OGUID MON_CONFIRM MODE MPP_FLAG
GRP1 453331 TRUE AUTO FALSE
<<DATABASE GLOBAL INFO:>>
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.20.237.2 15239 2023-01-10 08:58:43 GLOBAL VALID OPEN ZWWW OK 1 1 OPEN PRIMARY DSC_OPEN REALTIME VALID
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.20.237.3 15239 2023-01-10 08:58:43 GLOBAL VALID OPEN ZWWW_02 OK 1 1 OPEN STANDBY DSC_OPEN REALTIME VALID
#================================================================================#
此时,【ZWWW】实例为主,【ZWWW_02】实例为备,集群状态正常
后台启动监听器
# 启动
systemctl start DmMonitorServiceconfirm.service
# 查看状态
systemctl status DmMonitorServiceconfirm.service