corosync,pacemaker,crm集群资源监控

简介:

本文介绍下corosync的资源监控功能:

node1 node1.luojianlong.com  192.168.30.116   OS: Centos 6.4 x86_64

node2 node2.luojianlong.com  192.168.30.117   OS: Centos 6.4 x86_64


1.定义corosync资源:

1
2
3
4
5
6
7
8
9
10
11
[root@node1 ~] # crm configure primitive WebIP ocf:heartbeat:IPaddr params ip=192.168.30.230 op monitor interval=20 timeout=15 on-fail=restart
[root@node2 ~] # crm status
Last updated: Tue Mar 25 13:22:25 2014
Last change: Tue Mar 25 13:17:52 2014 via cibadmin on node1.luojianlong.com
Stack: classic openais (with plugin)
Current DC: node1.luojianlong.com - partition with quorum
Version: 1.1.10-14.el6_5.1-368c726
2 Nodes configured, 2 expected votes
1 Resources configured
Online: [ node1.luojianlong.com node2.luojianlong.com ]
  WebIP  (ocf::heartbeat:IPaddr):    Started node1.luojianlong.com

发现WebIP已经在node1自动启动


2.验证corosync在其中一个节点启动失败时,会在另外一个节点启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#在node1和node2上分别安装nginx
[root@node1 ~] # yum -y install nginx
[root@node2 ~] # yum -y install nginx
#在node2上启动httpd,模拟80端口被占用,使nginx无法启动
[root@node2 ~] # service  httpd start
Starting httpd:                                            [  OK  ]
#创建nginx资源
[root@node2 ~] # crm configure primitive nginx lsb:nginx op monitor interval=20 timeout=20 on-fail=restart
[root@node2 ~] # crm status
Last updated: Tue Mar 25 13:40:30 2014
Last change: Tue Mar 25 13:37:07 2014 via cibadmin on node2.luojianlong.com
Stack: classic openais (with plugin)
Current DC: node1.luojianlong.com - partition with quorum
Version: 1.1.10-14.el6_5.1-368c726
2 Nodes configured, 2 expected votes
2 Resources configured
Online: [ node1.luojianlong.com node2.luojianlong.com ]
  WebIP  (ocf::heartbeat:IPaddr):    Started node1.luojianlong.com
  nginx  (lsb:nginx):    Started node1.luojianlong.com
#在node1上发现nginx服务已经启动:
[root@node1 ~] # ss -antpl | grep nginx
LISTEN     0      128                       *:80                       *:*       users :(( "nginx" ,29510,6),( "nginx" ,29512,6))






     本文转自ljl_19880709 51CTO博客,原文链接http://blog.51cto.com/luojianlong/1383768,如需转载请自行联系原作者




相关文章
|
Shell 应用服务中间件 网络安全
|
2月前
|
人工智能 搜索推荐 Serverless
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
|
2月前
|
中间件
什么是 SAP CRM 系统里的 Initial Download
什么是 SAP CRM 系统里的 Initial Download
|
2月前
|
中间件
什么是 SAP CRM Initial Download
什么是 SAP CRM Initial Download
|
2月前
|
存储 数据管理 数据处理
SAP CRM 里 Attachment 搜索的实现逻辑介绍
SAP CRM 里 Attachment 搜索的实现逻辑介绍