`

启动OCFS2时出错:o2cb_ctl Unable load configuration file

阅读更多

操作系统版本: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配置文件的属性行为什么必须已空格或制表符开始呢?

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics