OCFS2 error:Error when attempting to run /sbin/ocfs2_hb_ctl: “Operation not permitted”
今天,在做OCFS2的操作的时候遇到了如题所示的报错,具体的现象如下:
1 2 3 4 |
[root@oel2 ~]# mount.ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2/ ocfs2_hb_ctl: Unable to access cluster service while starting heartbeat mount.ocfs2: Error when attempting to run /sbin/ocfs2_hb_ctl: "Operation not permitted" [root@oel2 ~]# |
产生上述问题的原因是涉及到OCFS2挂载的节点间的O2CB的状态不一致。
即,在挂载OCFS2之前,没有将o2cb configure设为一致的状态。
具体如下:
在上述报错发生的时候,我的各个节点的O2CB的状态如下:
节点一)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@oel1 /]# /etc/init.d/o2cb status Module "configfs": Loaded Filesystem "configfs": Mounted Module "ocfs2_nodemanager": Loaded Module "ocfs2_dlm": Loaded Module "ocfs2_dlmfs": Loaded Filesystem "ocfs2_dlmfs": Mounted Checking O2CB cluster ocfs2: Online Heartbeat dead threshold: 31 Network idle timeout: 30000 Network keepalive delay: 2000 Network reconnect delay: 2000 Checking O2CB heartbeat: Not active [root@oel1 /]# |
节点二)
1 2 3 4 5 6 7 8 9 |
[root@oel2 ~]# /etc/init.d/o2cb status Module "configfs": Loaded Filesystem "configfs": Mounted Module "ocfs2_nodemanager": Loaded Module "ocfs2_dlm": Loaded Module "ocfs2_dlmfs": Loaded Filesystem "ocfs2_dlmfs": Mounted Checking O2CB cluster ocfs2: Offline [root@oel2 ~]# |
解决方法:
手动在各个节点执行“/etc/init.d/o2cb configure”将各个参数配置为一致的即可。
如下:
节点一)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
[root@oel1 /]# /etc/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 <ENTER> without typing an answer will keep that current value. Ctrl-C will abort. Load O2CB driver on boot (y/n) [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@oel1 /]# [root@oel1 /]# /etc/init.d/o2cb status Module "configfs": Loaded Filesystem "configfs": Mounted Module "ocfs2_nodemanager": Loaded Module "ocfs2_dlm": Loaded Module "ocfs2_dlmfs": Loaded Filesystem "ocfs2_dlmfs": Mounted Checking O2CB cluster ocfs2: Online Heartbeat dead threshold: 61 Network idle timeout: 30000 Network keepalive delay: 2000 Network reconnect delay: 2000 Checking O2CB heartbeat: Not active [root@oel1 /]# |
节点二)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
[root@oel2 ~]# /etc/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 <ENTER> without typing an answer will keep that current value. Ctrl-C will abort. Load O2CB driver on boot (y/n) [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@oel2 ~]# [root@oel2 ~]# /etc/init.d/o2cb status Module "configfs": Loaded Filesystem "configfs": Mounted Module "ocfs2_nodemanager": Loaded Module "ocfs2_dlm": Loaded Module "ocfs2_dlmfs": Loaded Filesystem "ocfs2_dlmfs": Mounted Checking O2CB cluster ocfs2: Online Heartbeat dead threshold: 61 Network idle timeout: 30000 Network keepalive delay: 2000 Network reconnect delay: 2000 Checking O2CB heartbeat: Not active [root@oel2 ~]# |
如上,操作成功后,再次挂载就没有问题了。
节点一)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@oel1 /]# mounted.ocfs2 -d Device FS UUID Label /dev/sdb1 ocfs2 dab4b9ed-2ab3-439d-a215-6b4e5460f5fe clusterware [root@oel1 /]# [root@oel1 /]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2/ [root@oel1 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 16G 2.8G 12G 19% / /dev/sda1 99M 13M 82M 13% /boot tmpfs 1005M 0 1005M 0% /dev/shm /dev/hdc 3.3G 3.3G 0 100% /iso /dev/sdb1 489M 67M 423M 14% /ocfs2 [root@oel1 /]# |
节点二)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@oel2 ~]# mounted.ocfs2 -d Device FS UUID Label /dev/sdb1 ocfs2 dab4b9ed-2ab3-439d-a215-6b4e5460f5fe clusterware [root@oel2 ~]# [root@oel2 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2/ [root@oel2 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 16G 2.8G 12G 19% / /dev/sda1 99M 13M 82M 13% /boot tmpfs 1005M 0 1005M 0% /dev/shm /dev/hdc 3.3G 3.3G 0 100% /iso /dev/sdb1 489M 67M 423M 14% /ocfs2 [root@oel2 ~]# |
——————————————————————————————–
Ending。