1. 问题描述

redhat在进行HA切换时,需要先停止service,并释放调当前主机占有的资源,比如说IP Address和Filesystem,但今天我在验证HA切换时,发现service一直停止失败,导致HA切换失败,具体报错信息如下

Jun 6 11:10:50 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: Stopping service service:service_bill

Jun 6 11:10:50 SHQZ-PS-IOT-SV2-BILL01 rgmanager[7526]: [ip] Removing IPv4 address 172.17.131.222/26 from eth0

Jun 6 11:10:51 SHQZ-PS-IOT-SV2-BILL01 ntpd[2152]: Deleting interface #7 eth0, 172.17.131.222#123, interface stats: received=0, sent=0, dropped=0, active_time=1542 secs

Jun 6 11:11:01 SHQZ-PS-IOT-SV2-BILL01 rgmanager[7670]: [fs] unmounting /billdata

Jun 6 11:11:06 SHQZ-PS-IOT-SV2-BILL01 rgmanager[7804]: [fs] unmounting /billdata

Jun 6 11:11:11 SHQZ-PS-IOT-SV2-BILL01 rgmanager[7938]: [fs] unmounting /billdata

Jun 6 11:11:11 SHQZ-PS-IOT-SV2-BILL01 rgmanager[7983]: [fs] 'umount /billdata' failed, error=1

Jun 6 11:11:11 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: stop on fs "billdata" returned 1 (generic error)

Jun 6 11:11:12 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: #12: RG service:service_bill failed to stop; intervention required

Jun 6 11:11:12 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: Service service:service_bill is failed

我这里只配置了IP Address和Filesystem两个资源,从上面的日志信息可以看到,首先删除IP Address,这个是没有问题的,接下来释放Filesystem资源,这时候就出问题了,rgmanage服务尝试unmounting /billdata 三次都失败了,导致service停止失败,HA切换也就失败了。

2. 解决方法

登陆到HA管理界面,点击"Resource",选择我配置的Filesystem资源



注意:勾选Force Unmount选项,然后点击"Apply"。

接下来,再次测试HA切换,现在资源都在SHQZ-PS-IOT-SV2-BILL01机器上,执行命令clusvcadm -r service_bill -m SHQZ-PS-IOT-SV2-BILL02,将服务切换到SHQZ-PS-IOT-SV2-BILL01上

# clustat查看集群状态
[root@SHQZ-PS-IOT-SV2-BILL01 cluster]# clustat
Cluster Status for cl_bill @ Wed Jun 6 14:13:42 2018
Member Status: Quorate Member Name ID Status
------ ---- ---- ------
SHQZ-PS-IOT-SV2-BILL02 2 Online, rgmanager
SHQZ-PS-IOT-SV2-BILL01 3 Online, Local, rgmanager Service Name Owner (Last) State
------- ---- ----- ------ -----
service:service_bill SHQZ-PS-IOT-SV2-BILL01 started # 切换服务到SHQZ-PS-IOT-SV2-BILL01上
[root@SHQZ-PS-IOT-SV2-BILL01 cluster]# clusvcadm -r service_bill -m SHQZ-PS-IOT-SV2-BILL02
Trying to relocate service:service_bill to SHQZ-PS-IOT-SV2-BILL02...Success
service:service_bill is now running on SHQZ-PS-IOT-SV2-BILL02

这次,我们总算是成功了,登陆SHQZ-PS-IOT-SV2-BILL02查看IP Address和Filesystem资源是否存在

[root@SHQZ-PS-IOT-SV2-BILL02 cluster]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
link/ether 00:50:56:9e:34:c1 brd ff:ff:ff:ff:ff:ff
inet 172.17.131.224/26 brd 172.17.131.255 scope global eth0
inet 172.17.131.222/26 scope global secondary eth0
inet6 fe80::250:56ff:fe9e:34c1/64 scope link
valid_lft forever preferred_lft forever [root@SHQZ-PS-IOT-SV2-BILL02 cluster]# df -h /billdata
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_bill-lvbilldata
985G 97G 838G 11% /billdata

可以看到资源都在SHQZ-PS-IOT-SV2-BILL02上了

3. 原因分析

勾选Force Unmount选项后,HA切换时,SHQZ-PS-IOT-SV2-BILL01日志如下:

Jun 6 12:41:05 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: Stopping service service:service_bill

Jun 6 12:41:05 SHQZ-PS-IOT-SV2-BILL01 rgmanager[5791]: [ip] Removing IPv4 address 172.17.131.222/26 from eth0

Jun 6 12:41:06 SHQZ-PS-IOT-SV2-BILL01 ntpd[2152]: Deleting interface #9 eth0, 172.17.131.222#123, interface stats: received=0, sent=0, dropped=0, active_time=1516 secs

Jun 6 12:41:15 SHQZ-PS-IOT-SV2-BILL01 rgmanager[5852]: [fs] unmounting /billdata

Jun 6 12:41:15 SHQZ-PS-IOT-SV2-BILL01 rgmanager[5918]: [fs] Sending SIGTERM to processes on /billdata

Jun 6 12:41:21 SHQZ-PS-IOT-SV2-BILL01 rgmanager[5953]: [fs] unmounting /billdata

Jun 6 12:41:24 SHQZ-PS-IOT-SV2-BILL01 rgmanager[2529]: Service service:service_bill is stopped

SHQZ-PS-IOT-SV2-BILL02日志如下:

Jun 6 12:41:24 SHQZ-PS-IOT-SV2-BILL02 rgmanager[2368]: Starting stopped service service:service_bill

Jun 6 12:41:25 SHQZ-PS-IOT-SV2-BILL02 rgmanager[12296]: [fs] mounting /dev/dm-2 on /billdata

Jun 6 12:41:25 SHQZ-PS-IOT-SV2-BILL02 rgmanager[12318]: [fs] mount -t ext4 /dev/dm-2 /billdata

Jun 6 12:41:25 SHQZ-PS-IOT-SV2-BILL02 kernel: EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts:

Jun 6 12:41:25 SHQZ-PS-IOT-SV2-BILL02 rgmanager[12404]: [ip] Adding IPv4 address 172.17.131.222/26 to eth0

Jun 6 12:41:29 SHQZ-PS-IOT-SV2-BILL02 rgmanager[2368]: Service service:service_bill started

Jun 6 12:41:29 SHQZ-PS-IOT-SV2-BILL02 ntpd[2123]: Listening on interface #6 eth0, 172.17.131.222#123 Enabled

通过分析上面的日志,我猜测原因可能是这样的:

如果/billdata这个目录一直有进程在访问(我的/billdata目录确实一直被进程访问),在勾选Force Unmount选项前,rgmanager服务在umount /billdata时,因为有进程在访问该目录,导致umount失败。

勾选Force Unmount后,rgmanger在umount /billdata时,如果有进程在占用/billdata目录,会发出SIGTERM信号给该进程,解除其对/billdata的占用,然后再umount,最后stop service。同时SHQZ-PS-IOT-SV2-BILL02上监测到service停止,就会重新启动service,接管IP Address和Filesystem资源

HA切换失败原因分析的更多相关文章

  1. 百度编辑器(Ueditor)最新版(1.4.3.3)插入锚点失败原因分析及BUG修复

    用百度编辑器——Ueditor(版本1.4.3.3,2016-05-18日上线)插入锚点的时候,每次总是失败,百思不得其解.通过分析Ueditor的代码ueditor.all.js,可以看出Uedit ...

  2. dpdk组态 千兆网卡 驱动 失败 原因分析及 解决方案

    dpdk版本号是1.7.1稳定版,server它是ubuntu12.04LTS x86 64bit 绑定默认驱动程序千兆网卡ixgbe失败 # ./dpdk_nic_bind.py -b ixgbe ...

  3. ROS HTB限速失败原因分析和需注意事项

    要想做限速,必须要知道以下几点: 首先要知道自己要限制什么的速度,谁的速度,于是需要用的标记,即Mangle. 其次要知道怎么限速,是限制上传,还是下载? 最后要知道所做的限速是否成功,即需要知道如何 ...

  4. RP4412开发板烧写Ubuntu12.04失败原因分析解决

    Ubuntu烧写失败可能是卡的问题 问:用RP4412开发板,卡烧了光盘中的fastboot失败,现在如何补救呢? 答:INAND格式化,利用usb来升级啊. 也有文档,看升级文档. 问:这个是怎么回 ...

  5. Linux suse x86_64 环境上部署Hadoop启动失败原因分析

    一.问题症状: 在安装hadoop的时候报类似如下的错误: # A fatal error has beendetected by the Java Runtime Environment: # #  ...

  6. centos7 sftp设置后 ssh 启动失败 原因分析

    大多数人 在 设置SFTP 使用时,会在 ../sshd_config中添加如下内容: ------------------------------- Subsystem sftp internal- ...

  7. virsh default启动失败原因分析及解决

    启动default时出现如下错误提示:[root@node1 ~]# virsh net-start defaulterror: Failed to start network defaulterro ...

  8. linux下使用crontab实现定时PHP计划任务失败的原因分析

    这篇文章主要介绍了linux下使用crontab实现定时PHP计划任务失败的原因分析,需要的朋友可以参考下   很多人在linux下使用crontab实现PHP执行定时任务却未能成功,不能生成缓存.本 ...

  9. HBase丢失数据的故障和原因分析

    hbase的稳定性是近期社区的重要关注点,毕竟稳定的系统才能被推广开来,这里有几次稳定性故障和大家分享.     第一次生产故障的现象及原因     现象: 1 hbase发现无法写入 2 通过hbc ...

随机推荐

  1. C#分布式登录——jwt

    一.传统的session登录 在服务器存储一份用户登录的信息,这份登录信息会在响应时传递给浏览器,告诉其保存为cookie,以便下次请求时发送给我们的应用,这样我们的应用就能识别请求来自哪个用户了,这 ...

  2. python列表的增删改查和嵌套

    列表 python常用的数据类型 可承载任意的数据类型 列表是有序的,可索引.切片(步长) 列表的创建 list1 = [1, 2, 'whll'] #1. list2 = list() #2. #3 ...

  3. Git操作之码云代码clone

    安装Git https://git-scm.com/book/zh/v2/起步-安装-Git Git的网站上有详细的分各种系统的安装教程. 配置Git 1. 打开你要放置项目的本地路径,右键选择$ G ...

  4. javaWeb项目之图书管理系统(附视频讲解)

    视频播放地址:javaWeb图书系统 本系统为"Swing项目之图书管理系统"(此源码已共享)的Web版,网页框架用采用EasyUI 数据库为MysqL,写Web项目摒弃了火狐浏览 ...

  5. 将composer切换到国内镜像

    composer config -g repo.packagist composer https://packagist.phpcomposer.com

  6. selenium入门编程总结学习于龙腾)

    """编程题打开 http://ip/ecshop/wwwroot/admin/privilege.php?act=login登录(admin/123456)点击商品管理 ...

  7. Deep and Beautiful. The Reward Prediction Error Hypothesis of Dopamine

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! Contents: Abstract 1. Introduction 2. Reward-Prediction Error Meets D ...

  8. 学习一下 JVM (二) -- 学习一下 JVM 中对象、String 相关知识

    一.JDK 8 版本下 JVM 对象的分配.布局.访问(简单了解下) 1.对象的创建过程 (1)前言 Java 是一门面向对象的编程语言,程序运行过程中在任意时刻都可能有对象被创建.开发中常用 new ...

  9. js对象数组新增、修改时的验证是否重复的逻辑

    JS代码: // 定义数据集合 const persons = [ { id: 1, name: '张三' }, { id: 2, name: '李四' } ] console.log('') con ...

  10. OGG复制进程延迟高,优化方法二(存在索引),SQL选择不好的索引

    https://www.cnblogs.com/lvcha001/p/13469500.html 接前序,本次场景中有索引,但是OGG复制进程使用了低效率的索引?  类似SQL使用低效索引,如何让Or ...