SAP ascs集群

Azure云上SAP-高可用ASCS/ERS服务器配置


创建Pacemaker集群

主要配置参数

  1. 集群的Pacemaker的使用的是:SBD设备
  2. 本次配置涉及两台虚拟机,分别是:ascs01,ascs02
  3. ASCS负载均衡器的前端地址为:vascs01 (10.0.0.30),探针端口为:62000
  4. ERS负载均衡器的前端地址为:vers01 (10.0.0.39),探针端口为:62102

注意:和官方文档保持一致,操作步骤前缀分别代表:

  • [A] – 两台机器都需要执行
  • [1] – 只需在结点1上执行
  • [2] – 只需在结点2上执行

设置SBD设备

目标机器ascs01ascs02

[A] 连接到 iSCSI 设备

启用iSCSI 和 SBD 设备:

ascs01:~ # sudo systemctl enable iscsid
Created symlink from /etc/systemd/system/multi-user.target.wants/iscsid.service to /usr/lib/systemd/system/iscsid.service.
ascs01:~ # sudo systemctl enable iscsi
Created symlink from /etc/systemd/system/corosync.service.requires/sbd.service to /usr/lib/systemd/system/sbd.service.

[1] 在第一个节点上更改发起程序名称

ascs01:~ # sudo vi /etc/iscsi/initiatorname.iscsi

更改InitiatorName的值为:

InitiatorName=iqn.2006-04.ascs01.local:ascs01

[2] 在第二个节点上更改发起程序名称

ascs02:~ # sudo vi /etc/iscsi/initiatorname.iscsi

更改InitiatorName的值为:

InitiatorName=InitiatorName=iqn.2006-04.ascs02.local:ascs02

[A] 重新启动 iSCSI 服务

重启iSCSI 服务加载配置

ascs01:~ # sudo systemctl restart iscsid
ascs01:~ # sudo systemctl restart iscsi

连接iSCSI设备。10.0.0.51是目标服务器的地址;端口为:3260;ASCS集群对应SBD设备名称为:iqn.2006-04.vascs01.local:vascs01

ascs01:~ # sudo iscsiadm -m discovery --type=st --portal=10.0.0.51:3260
10.0.0.51:3260,1 iqn.2006-04.vnfs01.local:vnfs01
10.0.0.51:3260,1 iqn.2006-04.vascs01.local:vascs01
10.0.0.51:3260,1 iqn.2006-04.vhana01.local:vhana01
ascs01:~ # sudo iscsiadm -m node -T iqn.2006-04.vascs01.local:vascs01 --login --portal=10.0.0.51:3260
Logging in to [iface: default, target: iqn.2006-04.vascs01.local:vascs01, portal: 10.0.0.51,3260] (multiple)
Login to [iface: default, target: iqn.2006-04.vascs01.local:vascs01, portal: 10.0.0.51,3260] successful.
ascs01:~ # sudo iscsiadm -m node -p 10.0.0.51:3260 --op=update --name=node.startup --value=automatic

确保iSCSI 设备可用,并标注对应的设备名称,后面步骤会用到:

ascs01:~ # lsscsi | grep vascs01
[6:0:0:0] disk LIO-ORG vascs01 4.0 /dev/sdc

现在根据设备名称获取设备ID

ascs01:~ # ls -l /dev/disk/by-id/scsi-* | grep .*3600.*sdc
lrwxrwxrwx 1 root root 9 May 2 05:40 /dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62 -> ../../sdc

以 scsi-3开头的设备就是我们的目标设备ID:/dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62

[1] 创建 SBD 设备

ascs01:~ # sudo sbd -d /dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62 -1 10 -4 20 create
Initializing device /dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62
Creating version 2.1 header on device 4 (uuid: b65c9786-ecb9-42a4-a499-26aba4df93e9)
Initializing 255 slots on device 4
Device /dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62 is initialized.

[A] 适配 SBD 配置

打开SBD配置文件:

ascs01:~ # sudo vi /etc/sysconfig/sbd

填写SBD_DEVICE的值,并确保SBD_PACEMAKER=yes,SBD_STARTMODE=always,形如:

SBD_DEVICE="/dev/disk/by-id/scsi-3600140526c37c29bd7845a59c0ba9f62"
SBD_PACEMAKER=yes
SBD_STARTMODE=always

更新softdog 配置文件

ascs01:~ # echo softdog | sudo tee /etc/modules-load.d/softdog.conf
softdog

加载softdog 模块

sudo modprobe -v softdog

集群安装

[A] 更新 SLES

ascs01:~ # zypper update

[1] 启用 SSH 访问

ascs01:~ # sudo ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:R941dB5hztFMiD1PS5acFhZTPu2ts1sZteXxuQxHbCU root@ascs01
The key's randomart image is:
+---[RSA 2048]----+
| oE&&|
| ..X%X|
| . *%B|
| o . .o=@|
| S o .. ==|
| . +.+|
| o+.|
| + |
| o. |
+----[SHA256]-----+

复制nfs01的公钥

ascs01:~ # sudo cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWtt6F3oMfAr6VKlWpqFdqBC5Ov8U6T2fN55UVs67y/YLZat469l7lRF3cSomS+xQTxC6aNeMlL07svsNyeqRKOp/94oqOj7AgKuPUXpMT7w5aV4ZvcXH9mjxOvp0JkilCWcSt2X4NxY/dEbJ6oG9AatqLv5o+51yX2ebNim7m0rWxs6vUcEwqKSRa2rrArKQkBzkvOQfilaBzaQMefC1i2j1BKF5Tb9GCjp1tJuAPHVX8Ja5F82POUq8SwiFe71Gpg7tjN2xkrNmYtZki7yXDLm1dGEmBcsn22fhCuKN40yr6VQyOXzIeRGj4EFPOHCmMvajmDnmbMHMFelKi2Scl root@ascs01

[2] 启用 SSH 访问

生成密钥对:

ascs02:~ # sudo ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:pxxoAnOPfdSYgd65jLuA3i+n8p9Y02rKWQSx40mTa4k root@ascs02
The key's randomart image is:
+---[RSA 2048]----+
| . .. |
| +. = |
| o O. .+.. |
| B @.oo |
| E O *oS.. |
| o +.+o+ |
| . . +.+ |
| ..o.*++ |
| .oOO*. |
+----[SHA256]-----+

复制ascs01的公钥只nfs02的授权密钥文件:

ascs02:~ # sudo vi /root/.ssh/authorized_keys

同时查看和复制nfs02的公钥

ascs02:~ # sudo cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9vYo8qA9DyJB9J63xdS1UXhUyyMkvymZDtpNd0OajsNmBo9/eQxdJFS7z2lqdJTYEtOw9JQuApRi66E4vdKBumgxC3q8X1dVuXfU3MoPG3RPU+Htxo+XTq2Tlwgnc3skZi7lTiGjETkvkNI8FwHX+mLUOdDyGBpY8i/LnFYxDHcCNFJStEqYiHkG6iZI5ujdamdAOjdZsm5Ct2kWn5siTqmVXLW2eCJzh/CGFHsf+ddH1741Tci1ZYD5CcHPEAQBIoVbosdRbIcHG5CxIAZBJE/5C0O9Dj5b7ZfNz4hn2xZ1VnH9oEEHZnCC+1fp95rJ624T+CpCyBIWmgoVN5+f7 root@ascs02

[1] 启用 SSH 访问

复制ascs02的公钥至ascs01授权密钥文件:

ascs01:~ # sudo vi /root/.ssh/authorized_keys

[A] 安装 HA 扩展

nfs01:~ # sudo zypper install sle-ha-release fence-agents

[A] 设置主机名称解析

忽略,因为已配置DNS服务器。

[1] 安装群集

ascs01:~ # sudo ha-cluster-init
! NTP is not configured to start at system boot.

Do you want to continue anyway (y/n)? y

/root/.ssh/id_rsa already exists - overwrite (y/n)? n

  Network address to bind to (e.g.: 192.168.1.0) [10.0.0.0][回车]
  Multicast address (e.g.: 239.x.x.x) [239.38.88.171][回车]
  Multicast port [5405]

SBD is already configured to use /dev/disk/by-id/scsi-36001405cb3ac7b3fb5547f8a2a3882b6 - overwrite (y/n)? n
    Hawk cluster interface is now running. To see cluster status, open:
      https://10.0.0.31:7630/

Do you wish to configure an administration IP (y/n)? n
  Done (log saved to /var/log/ha-cluster-bootstrap.log)

[2] 向群集添加节点

ascs02:~ # sudo ha-cluster-join
Do you want to continue anyway (y/n)? y

  IP address or hostname of existing node (e.g.: 192.168.1.1) []ascs01.azure-sap.poc

/root/.ssh/id_rsa already exists - overwrite (y/n)? y

[A] 重置hacluster密码

ascs01:~ # sudo passwd hacluster
New password:
Retype new password:
passwd: password updated successfully

[A] 配置corosync 结点列表

编辑corosync配置文件:

nfs01:~ # sudo vi /etc/corosync/corosync.conf

更新transport,nodelist,expected_votes,two_node的值,

# Please read the corosync.conf.5 manual page
totem {
        version: 2
        secauth: on
        crypto_hash: sha1
        crypto_cipher: aes256
        cluster_name: hacluster
        clear_node_high_bit: yes
        token: 5000
        token_retransmits_before_loss_const: 10
        join: 60
        consensus: 6000
        max_messages: 20
        interface {
                ringnumber: 0
                bindnetaddr: 10.0.0.0
                mcastaddr: 239.90.36.91
                mcastport: 5405
                ttl: 1
        }
        transport:      udpu

}

nodelist {
 node {
 # ascs01
 ring0_addr:10.0.0.31
 }
 node {
 # ascs02
 ring0_addr:10.0.0.32
 }
}

logging {
        fileline: off
        to_stderr: no
        to_logfile: no
        logfile: /var/log/cluster/corosync.log
        to_syslog: yes
        debug: off
        timestamp: on
        logger_subsys {
                subsys: QUORUM
                debug: off
        }

}

quorum {

        # Enable and configure quorum subsystem (default: off)
        # see also corosync.conf.5 and votequorum.5
        provider: corosync_votequorum
        expected_votes: 2
        two_node: 1
}

重启corosync 服务

ascs01:~ # sudo service corosync restart

[1] 修改pacemaker的默认设置

ascs01:~ # sudo crm configure rsc_defaults resource-stickiness="1"

SAP NetWeaver ASCS/ERS 安装准备

安装SUSE连接器

ascs01:~ # sudo zypper install sap_suse_cluster_connector

更新SAP资源代理

资源包已安装,无需再更新

ascs01:~ # sudo grep 'parameter name="IS_ERS"' /usr/lib/ocf/resource.d/heartbeat/SAPInstance
 <parameter name="IS_ERS" unique="0" required="0">

设置域名解析

已配置DNS服务器,无须host记录。

创建共享目录

ascs01:~ # sudo mkdir -p /sapmnt/NW1
ascs01:~ # sudo mkdir -p /usr/sap/trans
ascs01:~ # sudo mkdir -p /usr/sap/NW1/SYS
ascs01:~ # sudo mkdir -p /usr/sap/NW1/ASCS00
ascs01:~ # sudo mkdir -p /usr/sap/NW1/ERS02
ascs01:~ # sudo chattr +i /sapmnt/NW1
ascs01:~ # sudo chattr +i /usr/sap/trans
ascs01:~ # sudo chattr +i /usr/sap/NW1/SYS
ascs01:~ # sudo chattr +i /usr/sap/NW1/ASCS00
ascs01:~ # sudo chattr +i /usr/sap/NW1/ERS02

配置autofs自动挂载

在/etc/auto.master中追加一行自动加载配置记录。

ascs01:~ # sudo vi /etc/auto.master

追加内容为:

/- /etc/auto.direct

创建一个auto.direct配置文件:

ascs01:~ # sudo vi /etc/auto.direct

增加ASCS和ERS安装所依赖的共享目录挂载信息:

/sapmnt/NW1 -nfsvers=4,nosymlink,sync vnfs01.azure-sap.poc:/NW1/sapmntsid
/usr/sap/trans -nfsvers=4,nosymlink,sync vnfs01.azure-sap.poc:/NW1/trans
/usr/sap/NW1/SYS -nfsvers=4,nosymlink,sync vnfs01.azure-sap.poc:/NW1/sidsys
/usr/sap/NW1/ASCS00 -nfsvers=4,nosymlink,sync vnfs01.azure-sap.poc:/NW1/ASCS
/usr/sap/NW1/ERS02 -nfsvers=4,nosymlink,sync vnfs01.azure-sap.poc:/NW1/ASCSERS

重启autofs挂载共享目录:

ascs01:~ # sudo systemctl enable autofs
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
ascs01:~ # sudo service autofs restart

此时可以通过mount命令检查一下,刚才挂载的几个目录是否处于活动状态:

ascs01:~ # mount | grep NW1
/etc/auto.direct on /usr/sap/NW1/ERS02 type autofs (rw,relatime,fd=7,pgrp=49534,timeout=600,minproto=5,maxproto=5,direct)
/etc/auto.direct on /usr/sap/NW1/SYS type autofs (rw,relatime,fd=7,pgrp=49534,timeout=600,minproto=5,maxproto=5,direct)
/etc/auto.direct on /sapmnt/NW1 type autofs (rw,relatime,fd=7,pgrp=49534,timeout=600,minproto=5,maxproto=5,direct)
/etc/auto.direct on /usr/sap/NW1/ASCS00 type autofs (rw,relatime,fd=7,pgrp=49534,timeout=600,minproto=5,maxproto=5,direct)

Configure SWAP 文件

编辑waagent.conf

ascs01:~ # sudo vi /etc/waagent.conf

设置ResourceDisk.EnableSwap=yResourceDisk.SwapSizeMB=2000

# Create and use swapfile on resource disk.
ResourceDisk.EnableSwap=y

# Size of the swapfile.
ResourceDisk.SwapSizeMB=2000

重启代理服务:

ascs01:~ # sudo service waagent restart

安装 SAP NetWeaver ASCS/ERS

ASCS的安装机器在ascs01上;

[1] 为 ASCS 实例创建虚拟 IP 资源和运行状况探针

sudo crm node standby ascs02
sudo crm configure primitive vip_NW1_ASCS IPaddr2 \
  params ip=10.0.0.30 cidr_netmask=24 \
  op monitor interval=10 timeout=20
sudo crm configure primitive nc_NW1_ASCS anything \
  params binfile="/usr/bin/nc" cmdline_options="-l -k 62000" \
  op monitor timeout=20s interval=10 depth=0
sudo crm configure group g-NW1_ASCS nc_NW1_ASCS vip_NW1_ASCS \
   meta resource-stickiness=3000

配置完毕后,请确保集群正常工作:

ascs01:~ # sudo crm_mon -r -1
Stack: corosync
Current DC: ascs02 (version 1.1.16-4.8-77ea74d) - partition with quorum
Last updated: Mon May  7 03:14:09 2018
Last change: Mon May  7 03:03:17 2018 by root via cibadmin on ascs01

2 nodes configured
3 resources configured

Node ascs02: standby
Online: [ ascs01 ]

Full list of resources:

 stonith-sbd    (stonith:external/sbd): Started ascs01
 Resource Group: g-NW1_ASCS
     nc_NW1_ASCS        (ocf::heartbeat:anything):      Started ascs01
     vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started ascs01

[1] 安装 SAP NetWeaver ASCS

ascs01:~ # /sapmedia/1709/SWPM/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin
Please confirm (y/n):y

SAPinst build information:
--------------------------
Version:         749.0.39
Build:           1790872
Compile time:    Sep 24 2017 - 13:22:20
Make type:       optU
Codeline:        749_REL
Platform:        linuxx86_64
Kernel build:    749, patch 316, changelist 1790531
SAP JRE build:   SAP Java Server VM (build 8.1.032 25.51-b02, Jul 27 2017 16:40:00 - 81_REL - optU - linux amd64 - 6 - bas2:292506 (mixed mode))
SAP JCo build:   3.0.17
SL-UI version:   2.6.11
SAP UI5 version: 1.48.1
Exe directory: /tmp/sapinst_exe.121666.1525663189

INFO       2018-05-07 03:20:14.642 (root/sapinst) (SLPCommunicator) [/bas/749_REL/bc_749_REL/src/ins/SAPINST/impl/src/guiengine/SLPMonitoringStatemachine.cpp:1377]
********************************************************************************
Open your browser and paste the following URL address to access the GUI
https://ascs01.azure-sap.poc:4237/sapinst/docs/index.html
Logon users: [sapadmin]

通过浏览器打开:https://ascs01.azure-sap.poc:4237/sapinst/docs/index.html,下面是按照过程中的截图:

[1] 为 ERS 实例创建虚拟 IP 资源和运行状况探测

sudo crm node online ascs02
sudo crm node standby ascs01
sudo crm configure primitive vip_NW1_ERS IPaddr2 \
  params ip=10.0.0.39 cidr_netmask=24 \
  op monitor interval=10 timeout=20
sudo crm configure primitive nc_NW1_ERS anything \
 params binfile="/usr/bin/nc" cmdline_options="-l -k 62102" \
 op monitor timeout=20s interval=10 depth=0

遇到确认提示,请输入y继续

# WARNING: Resources nc_NW1_ASCS,nc_NW1_ERS violate uniqueness for parameter "binfile": "/usr/bin/nc"
# Do you still want to commit (y/n)? y
sudo crm configure group g-NW1_ERS nc_NW1_ERS vip_NW1_ERS

确保集群已经工作正常,所以资源已启动:

ascs01:~ # crm_mon -r -1
Stack: corosync
Current DC: ascs02 (version 1.1.16-4.8-77ea74d) - partition with quorum
Last updated: Mon May  7 09:36:41 2018
Last change: Mon May  7 09:33:20 2018 by root via cibadmin on ascs01

2 nodes configured
5 resources configured

Node ascs01: standby
Online: [ ascs02 ]

Full list of resources:

 stonith-sbd    (stonith:external/sbd): Started ascs02
 Resource Group: g-NW1_ASCS
     nc_NW1_ASCS        (ocf::heartbeat:anything):      Started ascs02
     vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started ascs02
 Resource Group: g-NW1_ERS
     nc_NW1_ERS (ocf::heartbeat:anything):      Started ascs02
     vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started ascs02

[2] 安装 SAP Netweaver ERS

注意:这一步需要在ascs02上安装:

ascs02:~ # /sapmedia/1709/SWPM/sapinst SAPINST_REMOTE_ACCESS_USER=sapadmin
[==============================] / extracting...  done!
Please confirm (y/n):y

SAPinst build information:
--------------------------
Version:         749.0.39
Build:           1790872
Compile time:    Sep 24 2017 - 13:22:20
Make type:       optU
Codeline:        749_REL
Platform:        linuxx86_64
Kernel build:    749, patch 316, changelist 1790531
SAP JRE build:   SAP Java Server VM (build 8.1.032 25.51-b02, Jul 27 2017 16:40:00 - 81_REL - optU - linux amd64 - 6 - bas2:292506 (mixed mode))
SAP JCo build:   3.0.17
SL-UI version:   2.6.11
SAP UI5 version: 1.48.1
Exe directory: /tmp/sapinst_exe.125575.1525686072

https://ascs02.azure-sap.poc:4237/sapinst/docs/index.html
Logon users: [sapadmin]
********************************************************************************

浏览器打开 https://ascs02.azure-sap.poc:4237/sapinst/docs/index.html ,进行安装ERS,安装过程完整截图如下:

[1] 调整 ASCS/SCS 和 ERS 实例配置文件

ASCS/SCS 配置文件

编辑ASCS的配置文件:

ascs01:~ # vi /sapmnt/NW1/profile/NW1_ASCS00_vascs01

把EN参数对应的命令:把Restart_Program的值改为start:

#Restart_Program_01 = local $(_EN) pf=$(_PF)
Start_Program_01 = local $(_EN) pf=$(_PF)

文件末尾追加:

# Add the following lines
service/halib = $(DIR_CT_RUN)/saphascriptco.so
service/halib_cluster_connector = /usr/bin/sap_suse_cluster_connector

# Add the keep alive parameter
enque/encni/set_so_keepalive = true

ERS 配置文件

编辑ERS配置文件:

ascs01:~ # vi /sapmnt/NW1/profile/NW1_ERS02_vers01

文件末尾追加:

# Add the following lines
service/halib = $(DIR_CT_RUN)/saphascriptco.so
service/halib_cluster_connector = /usr/bin/sap_suse_cluster_connector

[A] 配置 Keep Alive

ascs01:~ # sudo sysctl net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_keepalive_time = 120

[A] 在安装后配置 SAP 用户

ascs01:~ # sudo usermod -aG haclient nw1adm

[1] 将 ASCS 和 ERS SAP 服务添加到 sapservice 文件

ascs01:~ # cat /usr/sap/sapservices | grep ASCS00 | sudo ssh ascs02 "cat >>/usr/sap/sapservices"
ascs01:~ # sudo ssh ascs02 "cat /usr/sap/sapservices" | grep ERS02 | sudo tee -a /usr/sap/sapservices

[1] 创建 SAP 群集资源

sudo crm configure property maintenance-mode="true"
sudo crm configure primitive rsc_sap_NW1_ASCS00 SAPInstance \
 operations \$id=rsc_sap_NW1_ASCS00-operations \
 op monitor interval=11 timeout=60 on_fail=restart \
 params InstanceName=NW1_ASCS00_nw1-ascs START_PROFILE="/sapmnt/NW1/profile/NW1_ASCS00_vascs01" \
 AUTOMATIC_RECOVER=false \
 meta resource-stickiness=5000 failure-timeout=60 migration-threshold=1 priority=10
sudo crm configure primitive rsc_sap_NW1_ERS02 SAPInstance \
 operations \$id=rsc_sap_NW1_ERS02-operations \
 op monitor interval=11 timeout=60 on_fail=restart \
 params InstanceName=NW1_ERS02_nw1-aers START_PROFILE="/sapmnt/NW1/profile/NW1_ERS02_vers01" AUTOMATIC_RECOVER=false IS_ERS=true \
 meta priority=1000
sudo crm configure modgroup g-NW1_ASCS add rsc_sap_NW1_ASCS00
sudo crm configure modgroup g-NW1_ERS add rsc_sap_NW1_ERS02
sudo crm configure colocation col_sap_NW1_no_both -5000: g-NW1_ERS g-NW1_ASCS
sudo crm configure location loc_sap_NW1_failover_to_ers rsc_sap_NW1_ASCS00 rule 2000: runs_ers_NW1 eq 1
sudo crm configure order ord_sap_NW1_first_start_ascs Optional: rsc_sap_NW1_ASCS00:start rsc_sap_NW1_ERS02:stop symmetrical=false
sudo crm node online ascs01
sudo crm configure property maintenance-mode="false"

查看集群状态,确保所有的资源已启动:

ascs01:~ # sudo crm_mon -r -1
Stack: corosync
Current DC: ascs01 (version 1.1.16-4.8-77ea74d) - partition with quorum
Last updated: Tue May  8 08:53:11 2018
Last change: Tue May  8 08:32:06 2018 by root via cibadmin on ascs01

2 nodes configured
7 resources configured

Online: [ ascs01 ascs02 ]

Full list of resources:

 stonith-sbd    (stonith:external/sbd): Started ascs02
 Resource Group: g-NW1_ASCS
     nc_NW1_ASCS        (ocf::heartbeat:anything):      Started ascs02
     vip_NW1_ASCS       (ocf::heartbeat:IPaddr2):       Started ascs02
     rsc_sap_NW1_ASCS00 (ocf::heartbeat:SAPInstance):   Started ascs02
 Resource Group: g-NW1_ERS
     nc_NW1_ERS (ocf::heartbeat:anything):      Started ascs01
     vip_NW1_ERS        (ocf::heartbeat:IPaddr2):       Started ascs01
     rsc_sap_NW1_ERS02  (ocf::heartbeat:SAPInstance):   Started ascs01

创建STONITH设备

如何创建自定义角色,服务主体,分配角色,可参考《创建STONITH设备

sudo crm configure property stonith-timeout=900
sudo crm configure primitive rsc_st_azure stonith:fence_azure_arm \
   params subscriptionId="订阅Id" resourceGroup="资源组名称" tenantId="租户Id" login="APPID" passwd="秘钥"
sudo crm configure fencing_topology \
  stonith-sbd rsc_st_azure
sudo crm configure property stonith-enabled=true

配置结束以后,机器中资源的状态,如下图:

SAP ascs集群

故障转移测试

接下来,我们会通过调整ASCS01和ASCS02两台机器的开关机状态,然后在客户端jump01上通过PowerShell测试ASCS和ERS的端口打开情况,简单验证集群的故障转移结果。

在此之前现在PowerShell控制定义个检测函数:

function ASCS-ERS-Cluster-Test
{
    $ascs = Test-NetConnection vascs01.azure-sap.poc -Port 50013 -InformationLevel Quiet;
    "ASCS:$ascs"

    $ers = Test-NetConnection vers01.azure-sap.poc -Port 50213 -InformationLevel Quiet;
    "ERS:$ers"
}

第一步:保证两台机器ASCS01和ASCS02都开机:

如下图,ascs资源工作在ascs02上,ers工作在ascs01上:

SAP ascs集群

jump01上端口检测如下,测试通过

PS C:\> ASCS-ERS-Cluster-Test
ASCS:True
ERS:True

第二步:关闭ASCS01

如下图,ascs和ers都工作在ascs02上:

jump01上端口检测如下:测试通过

PS C:\> ASCS-ERS-Cluster-Test
ASCS:True
ERS:True

第三步:开启ASCS01,关闭ASCS02

如下图,资源工作在ascs01上:

jump01上端口检测如下:测试通过

PS C:\> ASCS-ERS-Cluster-Test
ASCS:True
ERS:True

第四步:开启ASCS02

如下图,ERS工作在ascs02,ASCS工作在ascs01上:

jump01上端口检测如下:测试通过

PS C:\> ASCS-ERS-Cluster-Test
ASCS:True
ERS:True

引用通告

本文ASCS 和RES 的全部配置步骤引用自:SUSE Linux Enterprise Server for SAP applications 上的 Azure VM 上 SAP NetWeaver 的高可用性

本文链接: https://www.pstips.net/sap-on-azure-setup-ascs-ers.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

关于 Mooser Lee

我是一个Powershell的爱好者,创建了PowerShell中文博客,热衷于Powershell技术的搜集和分享。本站部分内容来源于互联网,不足之处敬请谅解,并欢迎您批评指正。

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注