Opensourcetechブログ

OpensourcetechによるNGINX/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

Pacemakerの設定を保存する/読み込む(crm configure save/crm configure load)


LinuCエヴァンジェリストの鯨井貴博@opensourcetechです。
Pacemakerの設定を保存したり、読み込んだりするためのメモです。
以下のように、すでにクラスター構成が出来ている状態とします。

[root@db01 ~]# pcs status
Cluster name: drbd_cluster

WARNINGS:
Corosync and pacemaker node names do not match (IPs used in setup?)

Stack: corosync
Current DC: db01 (version 1.1.21-1.el7-f14e36f) - partition with quorum
Last updated: Tue Jun 9 20:16:52 2020
Last change: Tue Jun 9 15:38:50 2020 by root via cibadmin on db02

2 nodes configured
6 resources configured

Online: [ db01 db02 ]

Full list of resources:

Resource Group: Group-FS
FS (ocf::heartbeat:Filesystem): Started db01
vipcheck (ocf::heartbeat:VIPcheck): Started db01
VIP (ocf::heartbeat:IPaddr2): Started db01
prmPing (ocf::pacemaker:ping): Started db01
OraLsnr (ocf::heartbeat:oralsnr): Started db01
OraSrv (ocf::heartbeat:oracle): Started db01

Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled



ここで現在利用されている設定を保存するには、「crm configure save」を使います。

[root@db01 ~]# crm configure save /var/tmp/drbd.crm
[root@db01 ~]# cat -n /var/tmp/drbd.crm
1 node 1: db01 \
2 attributes standby=off
3 node 2: db02 \
4 attributes
5 primitive FS Filesystem \
6 params run_fsck=no device="/dev/drbd0" directory="/mnt/drbd" fstype=xfs \
7 op monitor interval=15s timeout=40s \
8 op start interval=0s timeout=60s \
9 op stop interval=0s on-fail=ignore timeout=60s
10 primitive OraLsnr oralsnr \
11 params sid=XE \
12 op monitor interval=30s timeout=120s depth=0 \
13 op start interval=0s timeout=120s \
14 op stop interval=0s timeout=120s
15 primitive OraSrv oracle \
16 params home="/u01/app/oracle/product/11.2.0/xe" sid=XE user=oracle \
17 op monitor interval=120s timeout=60s \
18 op start interval=0s timeout=120s \
19 op stop interval=0s timeout=120s
20 primitive VIP IPaddr2 \
21 params cidr_netmask=24 ip=192.168.1.221 nic=enp0s3 \
22 op monitor interval=30s \
23 op start interval=0s timeout=20s \
24 op stop interval=0s timeout=20s
25 primitive prmPing ocf:pacemaker:ping \
26 params attempts=5 debug=true host_list=192.168.1.1 multiplier=1 name=default_ping_set timeout=50s \
27 op monitor interval=10s on-fail=restart timeout=60s \
28 op start interval=0s on-fail=restart timeout=60s \
29 op stop interval=0s on-fail=fence timeout=60s
30 primitive vipcheck VIPcheck \
31 params count=3 target_ip=192.168.1.221 wait=5 \
32 op monitor interval=10s on-fail=restart start-delay=0 timeout=60s \
33 op start interval=0s on-fail=restart timeout=60s \
34 op stop interval=0s on-fail=ignore timeout=60s
35 group Group-FS FS vipcheck VIP prmPing
36 colocation colocation-FS-OraLsnr-INFINITY inf: FS OraLsnr
37 colocation colocation-OraLsnr-OraSrv-INFINITY inf: OraLsnr OraSrv
38 order pcs_rsc_order_set_FS_OraLsnr _rsc_set_ FS OraLsnr
39 order pcs_rsc_order_set_OraLsnr_OraSrv _rsc_set_ OraLsnr OraSrv
40 property cib-bootstrap-options: \
41 have-watchdog=false \
42 dc-version=1.1.21-1.el7-f14e36f \
43 cluster-infrastructure=corosync \
44 stonith-enabled=false \
45 no-quorum-policy=ignore \
46 cluster-name=drbd_cluster \
47 last-lrm-refresh=1560163421
48 rsc_defaults rsc_defaults-options: \
49 resource-stickiness=INFINITY \
50 migration-threshold=1



また、設定ファイルを読み込む場合は、「crm configure load」を使います。

[root@db01 ~]# crm configure load /var/tmp/drbd.crm

Opensourcetech by Takahiro Kujirai