手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux下高可用群集之corosync+openais+pacemaker+web+drbd

[日期:2012-10-26] 来源:Linux社区  作者:gjp0731 [字体:大 中 小]

11.资源的配置

集群的资源类型有4种
primitive  本地主资源 (只能运行在一个节点上)
group    把多个资源轨道一个组里面,便于管理
clone    需要在多个节点上同时启用的  (如ocfs2  ,stonith ,没有主次之分)
master    有主次之分,如drbd

现在用的资源

ip地址  http服务  共享存储
用资源代理进行配置
ocf  lsb的
使用list可以查看

[root@www1 corosync]# crm
crm(live)# help

This is the CRM command line interface program.

Available commands:

    cib              manage shadow CIBs
    resource        resources management
    configure        CRM cluster configuration
    node            nodes management
    options          user preferences
    ra              resource agents information center
    status          show cluster status
    quit,bye,exit    exit the program
    help            show help
    end,cd,up        go back one level

crm(live)# ra

(是/etc/init.d目录下的)

crm(live)ra# list ocf heartbeat

实用info或者meta 用于显示一个资源的详细信息

  meta ocf:heartbeat:IPaddr  各个子项用:分开

crm(live)ra# meta ocf:heartbeat:IPaddr

配置一个资源,可以在configuration 下面进行配置

1.先资源名字

crm(live)configure# commit
crm(live)configure# end
crm(live)# status
============
Last updated: Thu Oct 25 15:18:54 2012
Stack: openais
Current DC: www1.gjp.com - partition with quorum
Version: 1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f
2 Nodes configured, 2 expected votes
1 Resources configured.
============

Online: [ www1.gjp.com www2.gjp.com ]

webip    (ocf::heartbeat:IPaddr):    Started www1.gjp.com

可以看出该资源在node1上启动

[root@www1 corosync]# ifconfig |less

[root@www1 corosync]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@www1 corosync]# yum install httpd -y

[root@www1 corosync]# service httpd status
httpd is stopped
[root@www1 corosync]# chkconfig --list |grep httpd
httpd              0:off    1:off    2:off    3:off    4:off    5:off    6:off
[root@www1 corosync]# crm
crm(live)# ra
crm(live)ra# classes
heartbeat
lsb
ocf / heartbeat pacemaker
stonith

linux
相关资讯       DRBD  Corosync  Pacemaker  高可用群集 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款