安装OCFS2

安装OCFS2
系统版本
[root@rac1 home]# uname -a
Linux rac1 2.6.18-8.el5xen #1 SMP
需要安装的包
[root@rac1 home]# rpm -qa|grep ocfs
ocfs2-2.6.18-8.el5-1.2.9-1.el5
ocfs2-tools-1.2.7-1.el5
ocfs2-2.6.18-8.el5xen-1.2.9-1.el5--这里漏了  版本问题 报错 Could not start cluster stack
ocfs2console-1.2.7-1.el5
各节点安装后
任意节点上root执行
ocfs2console
弹出框->菜单cluster->configure node->弹出框
添加节点 输入hostname、 vip端口默认
--如果不用vip 后面挂载共享分区时可能会报错
--mount.ocfs2: Transport endpoint is not connected while mounting /dev/vg_ocfs/lv_u02 on /u02. Check 'dmesg' for more information on this error.
--通过修改配置文件来调整VIP
--如果已经是vip  仍然有错  则考虑是否开启了防火墙
--虚拟机上配置 则不需要考虑 硬件的因素
报错:o2cb_ctl:unable to access cluster service
解决方案:
查看配置文件
[root@rac1 init.d]# cat /etc/ocfs2/cluster.conf
cluster:
        node_count = 0
        name = ocfs2
--只有集群信息
通过o2cb_ctl命令对集群文件进行操作 添加节点
[root@rac1 init.d]# o2cb_ctl -C  -n ocfs2 -t cluster -i
o2cb_ctl: Cluster "ocfs2" already exists
[root@rac1 init.d]# o2cb_ctl -C  -n  rac1 -t node -a number=0 -a
ip_address=192.168.206.11 -a ip_port=7777 -a cluster=ocfs2
[root@rac1 init.d]# o2cb_ctl -C  -n  rac2 -t node -a number=0 -a
ip_address=192.168.206.12 -a ip_port=7777 -a cluster=ocfs2
o2cb_ctl: Node number "0" already exists
[root@rac1 init.d]# o2cb_ctl -C  -n  rac2 -t node -a number=1 -a
ip_address=192.168.206.12 -a ip_port=7777 -a cluster=ocfs2
[root@rac1 init.d]# ./o2cb online
Starting O2CB cluster ocfs2: OK
再次查看配置文件
[root@rac1 init.d]# cat /etc/ocfs2/cluster.conf
node:
        ip_port = 7777
        ip_address = 192.168.206.11
        number = 0
        name = rac1
        cluster = ocfs2

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

cluster:
        node_count = 2
        name = ocfs2

菜单cluster->广播
到节点rac2查看是否接收到配置文件
[root@rac2 home]# cat /etc/ocfs2/cluster.conf
node:
        ip_port = 7777
        ip_address = 192.168.206.11
        number = 0
        name = rac1
        cluster = ocfs2

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

cluster:
        node_count = 2
        name = ocfs2
任意节点配置O2CB驱动程序
[root@rac1 init.d]# ./o2cb  unload
Stopping O2CB cluster ocfs2: OK
Unmounting ocfs2_dlmfs filesystem: OK
Unloading module "ocfs2_dlmfs": OK
Unmounting configfs filesystem: OK
Unloading module "configfs": OK
--卸载

[root@rac1 init.d]# ./o2cb  configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot.  The current values will be shown in brackets ('[]').  Hitting
without typing an answer will keep that current value.  Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [y]: y
Cluster to start on boot (Enter "none" to clear) [ocfs2]:
Specify heartbeat dead threshold (>=7) [31]: 61
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Loading module "configfs": OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OK
--配置  装载
验证节点是否联机
[root@rac1 init.d]# ./o2cb  status
Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded/etc/init.d/o2cb
Module "ocfs2_dlmfs": Loaded[root@rac1 init.d]# ./o2cb
Filesystem "ocfs2_dlmfs": MountedUsage: ./o2cb {start|stop|restart|force-reload|enable|disable|configure|load|unload|online|offline|force-offline|status}
Checking O2CB cluster ocfs2: Online[root@rac1 init.d]# ./o2cb restart
  Heartbeat dead threshold: 61Unmounting ocfs2_dlmfs filesystem: OK
  Network idle timeout: 30000Unloading module "ocfs2_dlmfs": OK
  Network keepalive delay: 2000Unmounting configfs filesystem: OK
  Network reconnect delay: 2000Unloading module "configfs": OK
Checking O2CB heartbeat: Not active--文件系统未挂载

挂载
任意节点 执行ocfs2console
tasks>format
选项number of node slots 设为4时报错:format error mkfs.ocfs
ctrl+q 退出

分别挂载各分区
root@rac1 /]# mkdir dr02
[root@rac1 /]# mount -t ocfs2 -o datavolume,nointr /dev/sdd2  /dr02
[root@rac1 /]# mkdir onlinelog
[root@rac1 /]# mount -t ocfs2 -o datavolume,nointr /dev/sdd3  /onlinelog
[root@rac1 /]# cd onlinelog/
[root@rac1 onlinelog]# ls
lost+found
vi /etc/fstab 添加
/dev/sdd1               /dr01     ocfs2   _netdev,datavolume,nointr  0 0
/dev/sdd2               /dr02     ocfs2   _netdev,datavolume,nointr  0 0
/dev/sdd3               /onlinelog     ocfs2   _netdev,datavolume,nointr  0 0
完成。。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21993926/viewspace-671960/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/21993926/viewspace-671960/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值