Chinaunix首页 | 论坛 | 博客
  • 博客访问: 371974
  • 博文数量: 49
  • 博客积分: 2562
  • 博客等级: 少校
  • 技术积分: 412
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-03 09:10
个人简介

时不我待。

文章分类

全部博文(49)

文章存档

2024年(1)

2020年(3)

2013年(1)

2012年(5)

2011年(9)

2010年(4)

2009年(9)

2008年(15)

2005年(2)

分类: Oracle

2009-03-08 17:07:39

    操作系统版本:RedHat-AS5,2.6.18-8el5内核

    OCFS版本:Ocfs1.2.7-1、ocfs2-tool 1.2.7-1,均为rpm格式安装包。

    安装完成后,启动报以下错误:

# /etc/init.d/o2cb start ocfs2
 Mounting configfs filesystem at /config: OK
 Loading module "ocfs2_dlmfs": OK
 Mounting ocfs2_dlmfs filesystem at /dlm: OK
 Starting cluster ocfs2: Failed
 o2cb_ctl: Unable to load cluster configuration file 
  "/etc/ocfs2/cluster.conf"
 Stopping cluster ocfs2: Failed
 o2cb_ctl: Unable to load cluster configuration file 
  "/etc/ocfs2/cluster.conf"

    查看模块加载情况:

# lsmod | grep ocfs
 ocfs2_dlmfs            19592  0
 ocfs2                 306848  0
 ocfs2_dlm             134540  2 ocfs2_dlmfs,ocfs2
 ocfs2_nodemanager     133624  3 ocfs2_dlmfs,ocfs2,ocfs2_dlm
 configfs               22028  2 ocfs2_nodemanager
 jbd                    48536  2 ocfs2,ext3

    查看配置文件:

# cat /etc/ocfs2/cluster.conf

node:
ip_port = 7777
ip_address = 192.168.51.140
number = 0
name = rac1
cluster = ocfs2

node:
ip_port = 7777
ip_address = 192.168.51.141
number = 1
name = rac2
cluster = ocfs2

cluster:
node_count = 2
name = ocfs2

    使用ocfs2console工具创建节点是出现错误,提示不能启动到集群节点,即使将/etc/ocfs2/cluster.conf文件删除,节点也不能被成功。

    通过分析,发现/etc/init.d/o2cb脚本文件中通过o2cb_ctl命令对集群文件进行操作的,进一步查看o2cb_ctl的命令帮助,可以通过此命令创建集群配置文件。对旧cluster.conf配置文件改名,试用o2cb_ctl命令进行创建。

# o2cb_ctl -h

o2cb_ctl -C -n object -t type [-i] [-a attribute ]
o2cb_ctl -D -n object [-u]
o2cb_ctl -I [-o-z] -l manager> [-n object>] [-t type] [-a attribute]
o2cb_ctl -H [-n object] [-t type>] [-a attribute>]
o2cb_ctl -h
o2cb_ctl -V

# o2cb -C -n ocfs2 -t cluster -i

# o2cb -C -n rac1 -t node  -a number=0 -a ip_address=192.168.51.140 -a ip_port=7777 -a cluster=ocfs2

# o2cb -C -n rac2 -t node  -a number=1 -a ip_address=192.168.51.141 -a ip_port=7777 -a cluster=ocfs2

    启动cluster:

# /etc/init.d/o2cb online

Starting cluster ocfs2: OK

    启动成功!

    通过比较分析,发现目前的cluster.conf配置文件内容与原来的配置文件有微小的差别,该文件如下:

node:
 ip_port = 7777
 ip_address = 192.168.51.140
 number = 0
 name = rac1
 cluster = ocfs2

node:
 ip_port = 7777
 ip_address = 192.168.51.141
 number = 1
 name = rac2
 cluster = ocfs2

cluster:
 node_count = 2
 name = ocfs2

    请注意:每行属性的前面是以TAB制表符开始的,通过多次的尝试,将属性行的第一个字符改为空格或TAB制表时,ocfs2的cluster能够正常启动,如果删除,则提示“o2cb_ctl: Unable to load cluster configuration file   "/etc/ocfs2/cluster.conf"”错误。我的cluster.conf文件是通过网上的配置文件修改而成的,忽略了这个细节,所以不能正常启动!

    问题虽然解决了,但还有两个问题依然不能弄明白:

    1、通过ocfs2console,为什么不能成功创建节点,但用命令行可以?

    2、/etc/ocfs2/cluster.conf配置文件的属性行为什么必须已空格或制表符开始呢?

阅读(4024) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-04-06 10:50:53

你好,不知道能不能实现在线删除节点?谢谢!