首页 > 其他分享 >pacemaker使用fence_sbd

pacemaker使用fence_sbd

时间:2023-08-11 16:13:55浏览次数:41  
标签:sbd fence pcs dev stonith pacemaker device id

Administrative Procedures for RHEL High Availability clusters - Enabling sbd fencing in RHEL 7 and 8 - Red Hat Customer Portal

启动watchdog

每个server 执行

modprobe softdog

modprobe softdog
cat  /etc/sysconfig/modules/softdog.modules
modprobe softdog

chmod 755 /etc/sysconfig/modules/softdog.modules

init 6

ls -l /dev/watchdog
crw------- 1 root root 10, 130 Aug  6 20:19 /dev/watchdog
#表示watchdog启动成功
 

配置sbd fence

创建共享磁盘

# 共享磁盘使用裸设备
查找共享磁盘的id
ls -l  /dev/disk/by-id
lrwxrwxrwx 1 root root  9 Aug  6 21:08 scsi-36000c29b96fbda2190b2ffa33080e9ff -> ../../sdd

安装sdb fence_agents-sbd

# 所有节点
yum install sbd 
yum install fence-agents-sbd

Prepare the environment

Optional: Initialize shared storage device(s) for sbd poison-pill fencing via block-device

pcs stonith sbd device setup --device=<device path> [--device=<device path>] [--device=<device path>]
pcs stonith sbd device setup --device=/dev/disk/by-id/scsi-36000c29b96fbda2190b2ffa33080e9ff

WARNING: All current content on device(s) '/dev/disk/by-id/scsi-36000c29b96fbda2190b2ffa33080e9ff' will be overwritten. Are you sure you want to continue? [y/N] y
Initializing device(s) /dev/disk/by-id/scsi-36000c29b96fbda2190b2ffa33080e9ff...
Device(s) initialized successfuly

Enable and configure sbd health and quorum monitoring

Option 1: With *sbd poison-pill fencing via block-device*

# # Example with a single device:
# pcs stonith sbd enable --device=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ace481447 [--watchdog=<path>[@<node>]] ... [<SBD_OPTION>=<value>]
# 
# # Example with multiple devices:
# pcs stonith sbd enable --device=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ace481447 --device=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413def1258 --device=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ber1548 [--watchdog=<path>[@<node>]] ... [<SBD_OPTION>=<value>]
pcs stonith sbd enable --device=/dev/disk/by-id/scsi-36000c29b96fbda2190b2ffa33080e9ff --watchdog=/dev/watchdog

Option 2: Without *sbd poison-pill fencing via block-device*

# # Syntax: # pcs stonith sbd enable [--watchdog=<path>[@<node>]] ... [<SBD_OPTION>=<value>]
# # Example:
# pcs stonith sbd enable 

Configure cluster fence methods

Enable stonith-watchdog-timeout fencing

Configure the cluster with a greater than 0 value for the cluster property stonith-watchdog-timeout. This value should be larger than the SBD_WATCHDOG_TIMEOUT setting configured in the earlier pcs stonith sbd enable step - which defaults to a value of 5 seconds. If SBD_WATCHDOG_TIMEOUT was left at the default, this stonith-watchdog-timeout property can be set to 10s.

# # Example with SBD_WATCHDOG_TIMEOUT=10 (seconds)
pcs property set stonith-watchdog-timeout=10

Optional: Create fence_sbd STONITH device for *sbd poison-pill fencing via block-device*

# # Example with single device:
# pcs stonith create sbd fence_sbd devices=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ace481447 
# 
# # Example with multiple devices:
# pcs stonith create sbd fence_sbd devices=/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ace481447,/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413def1258,/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ber1548
pcs stonith create sbd fence_sbd devices=/dev/disk/by-id/scsi-36000c29b96fbda2190b2ffa33080e9ff

Optional: Configure fence_sbd device into STONITH levels with any other devices in the cluster

# pcs stonith show --full
 Resource: kdump (class=stonith type=fence_kdump)
  Attributes: pcmk_host_list="rhel7-node1.example.com rhel7-node2.example.com rhel7-node3.example.com rhel7-node4.example.com"
  Operations: monitor interval=60s (kdump-monitor-interval-60s)
 Resource: sbd (class=stonith type=fence_sbd)
  Attributes: devices=/dev/disk/by-id/dm-uuid-mpath-360014054540864241b04b67af8351a38,/dev/disk/by-id/dm-uuid-mpath-360014058b858513c3044413ace481447,/dev/disk/by-id/dm-uuid-mpath-360014059b3b71fdd6254d519c085050c
  Operations: monitor interval=60s (sbd-monitor-interval-60s)
# pcs stonith level add 1 rhel7-node1.example.com kdump
# pcs stonith level add 2 rhel7-node2.example.com sbd
# # [... repeat for all nodes ...]
pcs stonith level add 1 r7-node-1-hb kdump
pcs stonith level add 2 r7-node-1-hb sbd

pcs stonith level add 1 r7-node-2-hb kdump
pcs stonith level add 2 r7-node-2-hb sbd

标签:sbd,fence,pcs,dev,stonith,pacemaker,device,id
From: https://www.cnblogs.com/goldtree358/p/17623218.html

相关文章

  • Painting the Fence 题解
    题目传送门一道枚举题。我们可以直接枚举那\(2\)个去掉的粉刷匠。先统计一下每个栅栏会被多少个粉刷匠刷到,然后枚举第一个被去掉的粉刷匠,然后计算剩下的粉刷匠会将每个栅栏刷到多少次,我们只需要看只能被刷\(1\)次的栅栏就行了。接着处理一个前缀和数组,记录前\(i\)个栅栏......
  • Linux mem 2.8 Kfence 详解【转】
    转自:https://pwl999.blog.csdn.net/article/details/1244949581.原理介绍Kfence(KernelElectricFence)是Linux内核引入的一种低开销的内存错误检测机制,因为是低开销的所以它可以在运行的生产环境中开启,同样由于是低开销所以它的功能相比较KASAN会偏弱。Kfence的基本原......
  • Best Cow Fences(前缀和+特殊二分)
    之前的二分大多数都是整数类型的,今天又学到一种新型的二分,浮点数的二分,浮点数的二分可太巧妙了.且听我细细分说::OpenJudge-2018:BestCowFences#include<bits/stdc++.h>usingnamespacestd;constintN=1e5+10;intn,k;doublea[N],s[N],l,r;boolcheck(doubleu)......
  • 【每日一题】Problem 363B. Fence
    原题解决思路求k个木板的最小高度和,因为所有木板的高度和不超过1e9,因此计算出到当前木板j的总高度-前j-k模板的总高度并求得最小数即可#include<bits/stdc++.h>intmain(){intn,k;std::cin>>n>>k;std::vector<int>vec(n+1,0);for(in......
  • 关于sap-hana-数据库-在pacemaker集群中迁移主控节点-master节点
    环境介绍,hana数据库的两个节点:azphxxxdb01azphxxxdb02目前master位于azphxxxdb02,现在需要切换回azphxxxdb01 需要确保Pacemaker没有任何失败的操作(通过pcs状态检查)、没有任何意外的位置约束(例如迁移测试的遗留内容),并且HANA处于同步状态,例如,使用systemReplicationStat......
  • C++并发之fence
    intx=0;inty=0;intr0,r1;//cpu1voidf1(){x=1;std::atomic_thread_fence(std::memory_order_acquire);r0=y;}//cpu2voidf2(){y=1;std::atomic_thread_fence(std::memory_order_acquire);r1=x;} fence......
  • 关于hana数据库集群在pacemaker下的启动后变化及pcs状态记录
    对于hana数据库,两个节点、使用了pacemkaer软件进行了高可用的集群首页、我们在开机后,使用 pcsclusterstart--all,将pacemaker服务启动起来,然后就是到了关机的维护模式 然后我们使用 pcsnodeunmaintenance--all取消维护模式,才能启动资源,可以观察到hana的pacemaker的状......
  • RocksBD+ZenFS的安装及测试(Fedora 37)
    安装安装libzbd依赖库及libzbd://依赖yuminstallm4yuminstallautoconfyuminstalllibtoolyuminstallautomake//下载libzbd库gitclonehttps://github.com/westerndigitalcorporation/libzbd.git//编译sh./autogen.sh./configuremake//安装sudomakein......
  • CentOS7/RHEL7 pacemaker+corosync高可用集群搭建
    CentOS7/RHEL7pacemaker+corosync高可用集群搭建一、集群信息二、集群搭建1、制作软件源2、主机基础配置3、集群基础环境准备4、集群资源准备5、资源配置6、constraint配置7、stonith配置8、集群功能验证三、集群常用命令及作用1、验证群集安装2、查看群集资源3、使......
  • PostgreSQL 13 pacemaker 高可用集群
    环境介绍 操作系统版本CentOSLinuxrelease7.8.2003(Core)  数据库版本psql(13.10)  PCS集群版本[root@hd-clw-select-proxysql01~]# rpm-qa|greppacemakerpacemaker-libs-1.1.23-1.el7_9.1.x86_64pacemaker-cli-1.1.23-1.el7_9.1.x86_64pacemaker-1.1.2......