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
