RHCS(二)之quorum机制测试(阶段一、二)

四、测试

调试工具:

cman_tool、clustat、clusvadm、init 0

测试目的:

1.实现资源转移

2.探究quorum机制和fence机制

测试思路:

不开启qdiskd服务,查看quorum票数,逐个节点关机/模拟宕机,看日志、看quorum;

开启qdiskd服务,查看quorum票数,逐个节点关机/模拟宕机,看日志、看quorum;

阶段一:(移除非资源节点)

所有节点处于正常状态,资源运行在web3节点,没有开启qdisk

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 21:44:07 2014

Member Status: Quorate

Member Name                        ID   Status

------ ----                        ---- ------

web1.rocker.com                        1 Online, Local,rgmanager

web2.rocker.com                        2 Online, rgmanager

web3.rocker.com                        3 Online, rgmanager

web4.rocker.com                        4 Online, rgmanager

Service Name              Owner (Last)              State

------- ----              ----- ------              -----

service:myservice         web3.rocker.com           started

[[email protected] ~]# cman_tool status

……

Nodes: 4

Expected votes: 8

Total votes: 8

Node votes: 2

Quorum: 5

#可见Quorum=(Total votes/Nodes)+1,资料说一旦小于这个值,cluster就会挂起,我们试一下是不是这样

……

=====Step1:对眀攀戀2节点进行关机操作=====

[[email protected] ~]# ssh [email protected] ‘halt‘

查看日志

[[email protected] ~]# tail /var/log/message

Sep 22 21:49:59 web1 clurgmgrd[4807]: <notice> Member 2 shuttingdown

Sep 22 21:50:17 web1 openais[4555]: [TOTEM] The token was lost in theOPERATIONAL state.

Sep 22 21:50:17 web1 openais[4555]: [TOTEM] Receive multicast socketrecv buffer size (320000 bytes).

Sep 22 21:50:17 web1 openais[4555]: [TOTEM] Transmit multicast socketsend buffer size (221184 bytes).

Sep 22 21:50:17 web1 openais[4555]: [TOTEM] entering GATHER state from2.

Sep 22 21:50:29 web1 openais[4555]: [TOTEM] entering GATHER state from0.

Sep 22 21:50:29 web1 openais[4555]: [TOTEM] Creating commit tokenbecause I am the rep.

Sep 22 21:50:29 web1 openais[4555]: [TOTEM] Storing new sequence id forring 14

Sep 22 21:50:29 web1 openais[4555]: [TOTEM] entering COMMIT state.

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] entering RECOVERY state.

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] position [0] member192.168.1.201:

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] previous ring seq 16 rep192.168.1.201

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] aru bc high delivered bcreceived flag 1

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] position [1] member192.168.1.203:

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] previous ring seq 16 rep192.168.1.201

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] aru bc high delivered bcreceived flag 1

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] position [2] member192.168.1.204:

Sep 22 21:50:30 web1 openais[4555]: [TOTEM] previous ring seq 16 rep192.168.1.201

Sep 22 21:50:31 web1 openais[4555]: [TOTEM] aru bc high delivered bcreceived flag 1

Sep 22 21:50:31 web1 openais[4555]: [TOTEM] Did not need to originateany messages in recovery.

Sep 22 21:50:31 web1 openais[4555]: [TOTEM] Sending initial ORF token

Sep 22 21:50:31 web1 last message repeated 2 times

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] CLM CONFIGURATION CHANGE

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] New Configuration:

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.201)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.203)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.204)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] Members Left:

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.202)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] Members Joined:

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] CLM CONFIGURATION CHANGE

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] New Configuration:

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.201)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.203)

Sep 22 21:50:32 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.204)

Sep 22 21:50:32 web1 kernel: dlm: closing connection to node 2

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] Members Left:

Sep 22 21:50:32 web1 openais[4555]: [CLM  ] Members Joined:

Sep 22 21:50:32 web1 openais[4555]: [SYNC ] This node is within theprimary component and will provide service.

Sep 22 21:50:32 web1 openais[4555]: [TOTEM] entering OPERATIONAL state.

Sep 22 21:50:32 web1openais[4555]: [CLM  ] got nodejoinmessage 192.168.1.201

Sep 22 21:50:32 web1openais[4555]: [CLM  ] got nodejoinmessage 192.168.1.203

Sep 22 21:50:32 web1openais[4555]: [CLM  ] got nodejoinmessage 192.168.1.204

Sep 22 21:50:32 web1openais[4555]: [CPG  ] got joinlistmessage from node 4

Sep 22 21:50:32 web1openais[4555]: [CPG  ] got joinlistmessage from node 1

Sep 22 21:50:32 web1openais[4555]: [CPG  ] got joinlistmessage from node 3

#表示重新定义成员

查看成员

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 21:50:54 2014

Member Status: Quorate #表示集群可用状态

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Online,Local, rgmanager

web2.rocker.com                                     2 Offline

web3.rocker.com                                     3 Online,rgmanager

web4.rocker.com                                     4 Online, rgmanager

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web3.rocker.com                        started

查看quorum

[[email protected] ~]# cman_tool status

……

Nodes: 3

Expected votes: 8

Total votes: 6

Node votes: 2

Quorum: 4 

……

#对比关机前的quorum,Total votes=8,Quorum=5;可见,现在Total vote=6,少了web2的2票,但是quorum是重新计算的,就是说quorum是浮动的。

=====Step2:对web4节点进行关机操作=====

[[email protected] ~]# ssh [email protected] ‘halt‘

查看节点状态

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 21:55:26 2014

Member Status: Quorate   #表示集群可用状态

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Online,Local, rgmanager

web2.rocker.com                                     2 Offline

web3.rocker.com                                     3 Online, rgmanager

web4.rocker.com                                     4 Offline

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web3.rocker.com                        started

查看quorum

[[email protected] ~]# cman_tool status

……

Nodes: 2

Expected votes: 8

Total votes: 4

Node votes: 2

Quorum: 3

……

#看,quorum在浮动,也就是说,只剩下一台也不会让整个集群挂掉。注意,前提是节点正常关机的情况下。

*****************************************************************

阶段二:这次要关机占用资源的节点

先恢复web2和web4,开机然后开启服务即可

日志:

Sep 22 22:03:17 web1 kernel: dlm: got connection from 2

Sep 22 22:03:20 web1 kernel: dlm: got connection from 4

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 22:03:50 2014

Member Status: Quorate

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Online, Local, rgmanager

web2.rocker.com                                     2 Online,rgmanager

web3.rocker.com                                     3 Online,rgmanager

web4.rocker.com                                     4 Online,rgmanager

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web3.rocker.com                        started

[[email protected] ~]# cman_tool status

……

Nodes: 4

Expected votes: 8

Total votes: 8

Node votes: 2

Quorum: 5 

……

===Step1:现在把占用资源的web3关机,看看集群是怎么样运作的===

[[email protected] ~]# ssh [email protected] ‘halt‘

[[email protected] ~]# tail /var/log/message

Sep 22 22:05:31 web1 clurgmgrd[4807]: <notice> Member 3 shuttingdown

Sep 22 22:06:04 web1 openais[4555]: [TOTEM] The token was lost in theOPERATIONAL state.

Sep 22 22:06:04 web1 openais[4555]: [TOTEM] Receive multicast socketrecv buffer size (320000 bytes).

Sep 22 22:06:04 web1 openais[4555]: [TOTEM] Transmit multicast socketsend buffer size (221184 bytes).

Sep 22 22:06:04 web1 openais[4555]: [TOTEM] entering GATHER state from2.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] entering GATHER state from11.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] Creating commit tokenbecause I am the rep.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] Storing new sequence id forring 24

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] entering COMMIT state.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] entering RECOVERY state.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] position [0] member192.168.1.201:

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] previous ring seq 32 rep192.168.1.201

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] aru 8d high delivered 8dreceived flag 1

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] position [1] member192.168.1.202:

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] previous ring seq 32 rep192.168.1.201

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] aru 8d high delivered 8dreceived flag 1

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] position [2] member192.168.1.204:

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] previous ring seq 32 rep192.168.1.201

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] aru 8d high delivered 8dreceived flag 1

Sep 22 22:06:16 web1 kernel: dlm: closing connection to node 3

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] Did not need to originateany messages in recovery.

Sep 22 22:06:16 web1 openais[4555]: [TOTEM] Sending initial ORF token

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] CLM CONFIGURATION CHANGE

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] New Configuration:

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.201)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.202)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.204)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] Members Left:

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.203)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] Members Joined:

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] CLM CONFIGURATION CHANGE

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] New Configuration:

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.201)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.202)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ]       r(0)ip(192.168.1.204)

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] Members Left:

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] Members Joined:

Sep 22 22:06:17 web1 openais[4555]: [SYNC ] This node is within theprimary component and will provide service.

Sep 22 22:06:17 web1 openais[4555]: [TOTEM] entering OPERATIONAL state.

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] got nodejoin message 192.168.1.201

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] got nodejoin message 192.168.1.202

Sep 22 22:06:17 web1 openais[4555]: [CLM  ] got nodejoin message 192.168.1.204

Sep 22 22:06:17 web1 openais[4555]: [CPG  ] got joinlist message from node 4

Sep 22 22:06:18 web1 openais[4555]: [CPG  ] got joinlist message from node 1

Sep 22 22:06:18 web1 openais[4555]: [CPG  ] got joinlist message from node 2

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 22:06:37 2014

Member Status: Quorate #集群可用

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Online,Local, rgmanager

web2.rocker.com                                     2 Online, rgmanager

web3.rocker.com                                     3 Offline

web4.rocker.com                                     4 Online,rgmanager

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web2.rocker.com                        started

#集群资源转移到了web2节点上了,测试一下。

查看quorum

[[email protected] ~]# cman_tool status

……

Nodes: 3

Expected votes: 8

Total votes: 6

Node votes: 2

Quorum: 4 

……

#对比之前的quorum,这里的quorum也发生了浮动。

=====step2:把web2关机======

[[email protected] ~]# ssh [email protected] ‘halt‘

[[email protected] ~]# tail /var/log/message

Sep 22 22:09:30 web1 clurgmgrd[4807]: <notice> Member 2 shutting down

Sep 22 22:09:30 web1 clurgmgrd[4807]: <notice> Starting stopped service service:myservice

Sep 22 22:09:33 web1 avahi-daemon[3919]: Registering new address record for 192.168.1.200 on eth0.    #资源转到web1节点了

Sep 22 22:09:34 web1clurgmgrd[4807]: <notice> Service service:myservice started

……

Sep 22 22:10:15 web1 openais[4555]: [CLM  ] got nodejoin message 192.168.1.201

Sep 22 22:10:15 web1 openais[4555]: [CLM  ] got nodejoin message 192.168.1.204

Sep 22 22:10:15 web1 openais[4555]: [CPG  ] got joinlist message from node 4

Sep 22 22:10:15 web1 openais[4555]: [CPG  ] got joinlist message from node 1

查看节点状态

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 22:11:25 2014

Member Status: Quorate

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Online,Local, rgmanager

web2.rocker.com                                     2 Offline

web3.rocker.com                                     3 Offline

web4.rocker.com                                     4 Online,rgmanager

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web1.rocker.com                        started

测试

=====step3:把web1节点关机=====

[[email protected] ~]# ssh [email protected] ‘halt‘

[[email protected] ~]# clustat

Cluster Status for mycluster @ Mon Sep 22 22:31:02 2014

Member Status: Quorate #集群依然可用

Member Name                                     ID   Status

------ ----                                     ----------

web1.rocker.com                                     1 Offline

web2.rocker.com                                     2 Offline

web3.rocker.com                                     3 Offline

web4.rocker.com                                     4 Online,Local, rgmanager

Service Name                           Owner (Last)                           State

------- ----                           ----- ------                           -----

service:myservice                      web4.rocker.com                        started

测试

###字数限制####

###更多见下文###

时间: 2024-10-27 06:27:06

RHCS(二)之quorum机制测试(阶段一、二)的相关文章

RHCS(三)之quorum机制测试(阶段三、四、结论)

阶段三:我们这次试一下非正常退出 模拟宕机方法: 方法一:虚拟机挂起 方法二:echoc>/proc/sysrq-trigger 恢复所有节点(略) [[email protected] ~]# cman_tool status -- Nodes: 4 Expected votes: 8 Total votes: 8 Node votes: 2 Quorum: 5  -- =====Step1:对web3节点进行模拟故障===== [[email protected] ~]# ssh [emai

分布式系统理论之Quorum机制

一,Quorum机制介绍 在分布式系统中有个CAP理论,对于P(分区容忍性)而言,是实际存在 从而无法避免的.因为,分布系统中的处理不是在本机,而是网络中的许多机器相互通信,故网络分区.网络通信故障问题无法避免.因此,只能尽量地在C 和 A 之间寻求平衡.对于数据存储而言,为了提高可用性(Availability),采用了副本备份,比如对于HDFS,默认每块数据存三份.某数据块所在的机器宕机了,就去该数据块副本所在的机器上读取(从这可以看出,数据分布方式是按“数据块”为单位分布的) 但是,问题来

冲刺阶段(二)第五天 5月18日

昨天:利用前几天学习的知识实现铁大助手中图片切换的功能. 今天:团队测试 困难:不能在所有Android版本模式下运行本软件,有的不能兼容. 冲刺阶段(二)第五天 5月18日,布布扣,bubuko.com

结合手机上网流量业务来说明Hadoop中的二次排序机制,分区机制

本篇博客将结合手机上网流量业务来详细介绍Hadoop的二次排序机制.分区机制,先介绍一下业务场景: 先介绍一下业务场景:统计每个用户的上行流量和,下行流量和,以及总流量和. 本次描述所用数据: 日志格式描述: 日志flowdata.txt中的具体数据: 首先我们先通过mapreduce程序实现上面的业务逻辑: 代码实现: package FlowSum; import java.io.DataInput; import java.io.DataOutput; import java.io.IOE

深入JVM虚拟机(二) JVM运行机制

深入JVM虚拟机(二) JVM运行机制 1 JVM运行机制 1.1 JVM启动流程 JVM是Java程序运行的环境,同时是一个操作系统的一个应用程序进程,因此它有自己的生命周期,也有自己的代码和数据空间.JVM工作原理和特点主要是指操作系统装入JVM,是通过jdk中Java.exe来完成通过下面4步来完成JVM环境. 1.创建JVM装载环境和配置. 2.装载JVM.dll. 3.初始化JVM.dll并挂界到JNIENV(JNI调用接口)实例. 4.调用JNIEnv实例装载并处理class类. J

安全性测试入门(二):Command Injection命令行注入攻击和防御

安全性测试入门(二):Command Injection命令行注入攻击和防御 本篇继续对于安全性测试话题,结合DVWA进行研习. Command Injection:命令注入攻击. 1. Command Injection命令注入 命令注入是通过在应用中执行宿主操作系统的命令,来达到破坏目的的一种攻击方式.如果我们的应用程序将不安全的用户输入传递给了系统命令解析器(shell),那么命令攻击就有可能发生. 通常来说,由应用程序传递操作系统命令会赋有和应用一样的权限,所以如果没有合理防御机制会给系

微信支付二维码本地测试可以,上传到服务器不显示问题

今天给一个网站开发微信二维码支付,本地测试没问题,但是上传后在服务器上二维码就是不显示,打开路径也可以打开就是生成的图片内容不对. 后来用sesseion保存data参数解决. 但是多方寻找问题是url参数问题导致的,因为微信的参数是weixin://wxpay/bizpayurl 这种格式的,好像安全原因给过滤了,可能是无法获取正确的 ============================= protected void Page_Load(object sender, EventArgs

Kali Linux Web 渗透测试— 第十二课-websploit

Kali Linux Web 渗透测试— 第十二课-websploit 文/玄魂 目录 Kali Linux Web 渗透测试— 第十二课-websploit............................................... 1 Websploit 简介........................................................................................... 2 主要功能...........

基于Quorum机制的强一致性存储方案

在线上生成环境用一台服务器提供数据服务时,我们会担心这台服务器停机,造成服务不可用或数据丢失,通常我们对数据进行冗余存储,保障数据服务的高可用性. 但加入更多的机器,会带来数据一致性的问题,下面我们来了解一个基于Quorum机制的强一致性存储方案. 三机Quorum机制 Quorum即多数派原则,与投票选举的方式类似,被多数同意的一项操作即可获得通过. 本文讨论基于三机的Quorum机制,我们称这三台机为A机.B机.C机.其中A.B机用于数据存储,称为数据机.当写请求落到A机时,是否能真正写入数