2018-10-22 SAP HANA数据库复制Replication重设置

ERP ECC 系统HANA数据库复制Replication设置

  • 三节点数据库复制模式 SITED(primary)--->SITEC(second)--->SITEE(third)
  1. 在主节点上 确认replication状态


    确认replication状态1

    启用了就显示为Disable system replication,否则就显示为 Enable system replication


    确认replication状态2
  2. ssh 登陆从节点HANA数据库服务器,停止HANA数据库


    停止HANA数据库
hdbgep1:~ # su - gepadm
hdbgep1:/usr/sap/GEP/HDB00> HDB stop
hdbdaemon will wait maximal 300 seconds for NewDB services finishing.
Stopping instance using: /usr/sap/GEP/SYS/exe/hdb/sapcontrol -prot NI_HTTP -nr 00 -function Stop 400

22.10.2018 11:29:17
Stop
OK
Waiting for stopped instance using: /usr/sap/GEP/SYS/exe/hdb/sapcontrol -prot NI_HTTP -nr 00 -function WaitforStopped 600 2

22.10.2018 11:34:31
WaitforStopped
OK
hdbdaemon is stopped.
hdbgep1:/usr/sap/GEP/HDB00> ping hdbgep2
PING hdbgep2.yuchai.com (172.16.120.234) 56(84) bytes of data.
64 bytes from hdbgep2.yuchai.com (172.16.120.234): icmp_seq=1 ttl=64 time=0.078 ms
  1. 启用 远程复制 模式为同步 sync 站点名称为 SITEC ,远程节点 为 remoteHost=hdbgep2

hdbnsutil -sr_register --remoteHost=hdbgep2 --remoteInstance=00 --replicationMode=sync --name=SITEC --operationMode=logreplay

如果同步异常 可以增加强制复制的参数 --force_full_replica

hdbnsutil -sr_register --remoteHost=hdbgep2 --remoteInstance=00 --replicationMode=sync --name=SITEC --operationMode=logreplay --force_full_replica

  1. 启动HANA数据库,就会与主节点进行replicaton连接,并做初始化的数据同步

HDB start

hdbgep1:/usr/sap/GEP/HDB00> HDB start

StartService
Impromptu CCC initialization by 'rscpCInit'.
  See SAP note 1266393.
OK
OK
Starting instance using: /usr/sap/GEP/SYS/exe/hdb/sapcontrol -prot NI_HTTP -nr 00 -function StartWait 2700 2

22.10.2018 11:36:13
Start
OK

22.10.2018 11:37:01
StartWait
OK
hdbgep1:/usr/sap/GEP/HDB00>
  1. 查看同步状态信息,正常

hdbnsutil -sr_state

hdbgep1:/usr/sap/GEP/HDB00> hdbnsutil -sr_state

System Replication State
~~~~~~~~~~~~~~~~~~~~~~~~
online: true

mode: sync
site id: 1
site name: SITEC
active primary site: 2

Host Mappings:
~~~~~~~~~~~~~~

hdbgep1 -> [SITEC] hdbgep1
hdbgep1 -> [SITED] hdbgep2

primary masters:hdbgep2

done.
hdbgep1:/usr/sap/GEP/HDB00>
HANA 复制状态
  1. 从节点到第三节点的复制,同理
    6.1. 在从节点上启用复制
hdbgep1:/usr/sap/GEP/HDB00> hdbnsutil -sr_enable --name=SITEC
nameserver is active, proceeding ...
successfully enabled system as system replication source site
done.
hdbgep1:/usr/sap/GEP/HDB00> hdbnsutil -sr_state

System Replication State
~~~~~~~~~~~~~~~~~~~~~~~~
online: true

mode: sync
site id: 1
site name: SITEC
active primary site: 2

Host Mappings:
~~~~~~~~~~~~~~
hdbgep1 -> [SITEC] hdbgep1
hdbgep1 -> [SITED] hdbgep2

primary masters:hdbgep2

done.
hdbgep1:/usr/sap/GEP/HDB00>

6.2. 在第三节点上注册远程节点,只能使用async异步同步模式

hdbnsutil -sr_register --remoteHost=hdbgep1 --remoteInstance=00 --replicationMode=async --name=SITEE --operationMode=logreplay

hdbgepbak1:/usr/sap/GEP/HDB00> hdbnsutil -sr_register --remoteHost=hdbgep1 --remoteInstance=00 --replicationMode=async --name=SITEE --operationMode=logreplay
adding site ...
nameserver hdbgepbak1:30001 not responding.
collecting information ...
updating local ini files ...
done.
hdbgepbak1:/usr/sap/GEP/HDB00> HDB start


StartService
Impromptu CCC initialization by 'rscpCInit'.
  See SAP note 1266393.
OK
OK
Starting instance using: /usr/sap/GEP/SYS/exe/hdb/sapcontrol -prot NI_HTTP -nr 00 -function StartWait 2700 2

22.10.2018 13:33:29
Start
OK

22.10.2018 13:35:05
StartWait
OK
hdbgepbak1:/usr/sap/GEP/HDB00>

6.3. 查看全局的复制状态

hdbnsutil -sr_state

hdbgep1:/usr/sap/GEP/HDB00> hdbnsutil -sr_state

System Replication State
~~~~~~~~~~~~~~~~~~~~~~~~
online: true

mode: sync
site id: 1
site name: SITEC
active primary site: 2

Host Mappings:
~~~~~~~~~~~~~~
hdbgep1 -> [SITEC] hdbgep1
hdbgep1 -> [SITEE] hdbgepbak1
hdbgep1 -> [SITED] hdbgep2

primary masters:hdbgep2

done.
hdbgep1:/usr/sap/GEP/HDB00>
三站点复制状态

你可能感兴趣的:(2018-10-22 SAP HANA数据库复制Replication重设置)