2018-11-26 SAP-HANA数据库HA切换操作
作者:
麦兜的刀 | 来源:发表于
2018-11-26 11:51 被阅读0次
操作序号 |
步骤 |
命令 |
备注 |
使用场景 |
1 |
查看集群状态 |
crm_mon -r1 |
查看一次 |
任何时候 |
2 |
启动集群 |
# /etc/init.d/openais start 或者 rcopenais start |
|
正常停机后启动 |
3 |
停止集群 |
# /etc/init.d/openais stop 或者 rcopenais stop |
|
停机维护时,统一停机,不进行主/备切换 |
4 |
主节点geps1 注册备节点 2 |
$hdbnsutil -sr_register --remoteHost=geps2 --remoteInstance=00 --replicationMode=sync --name=SITEA --operationMode=logreplay |
备机节点1 HANA需在停止状态 |
geps1作为备节点注册 |
5 |
主节点geps2 注册备节点 1 |
$hdbnsutil -sr_register --remoteHost=geps1 --remoteInstance=00 --replicationMode=sync --name=SITEA --operationMode=logreplay |
备机节点2 HANA需在停止状态 |
geps2作为备节点注册 |
6 |
使集群, 进入管理模式 |
crm configure property maintenance-mode=on |
集群将不对资源进行管理 |
用于不切换的情况下对主节点的HANA服务器重启 |
7 |
使集群, 退出管理模式 |
crm configure property maintenance-mode=off |
|
|
8 |
Linux HA 层面检查HANA Replication状态 |
cibadmin --query | grep sync_state |
示例输出: <nvpair id="status-geps2-hana_gep_sync_state" name="hana_gep_sync_state" value="SOK"/> <nvpair id="status-geps1-hana_gep_sync_state" name="hana_gep_sync_state" value="PRIM"/> |
备节点状态:name="hana_gep_sync_state" value="SOK"/> 是OK的, 可以进行切换操作;如果为SFAIL, 则Replication有问题 |
9 |
HANA层面检查Replication 状态 |
gepadm用户下执行: hdbnsutil -sr_state |
两个节点都执行 |
|
10 |
主节点移动到备节点 |
# crm resource move rsc_ip_GEP_HDB00 |
做此操作后主备将发生切换 |
主节点需停机维护 |
11 |
集群日志检查 |
more /var/log/cluster/corosync.log |
集群的运行日志信息,都记录在/var/log/cluster/corosync.log |
|
12 |
为资源清除资源异常状态 |
crm resource cleanup <resource name> |
|
|
13 |
强制复制: |
hdbnsutil -sr_register --remoteHost=geps1 --remoteInstance=00 --replicationMode=sync --name=SITEB --operationMode=logreplay --force_full_replica |
|
|

演练场景
本文标题:2018-11-26 SAP-HANA数据库HA切换操作
本文链接:https://www.haomeiwen.com/subject/lejvqqtx.html
网友评论