OCFS2:Install and Config
本文呈现有关Oracle Cluster File System 2的技术细节。
OS:Oracle Enterprise Linux 5 Update 3
Arch:64bit
开始本文的基础:两台安装好的OEL5.3操作系统。
一、安装
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
[root@rac1 ~]# yum list | grep --color ocfs2 ocfs2-2.6.18-128.el5.x86_64 1.2.9-1.el5 Server ocfs2-2.6.18-128.el5debug.x86_64 1.2.9-1.el5 Server ocfs2-2.6.18-128.el5xen.x86_64 1.2.9-1.el5 Server ocfs2-tools.x86_64 1.2.7-1.el5 Server ocfs2-tools-devel.x86_64 1.2.7-1.el5 Server ocfs2console.x86_64 1.2.7-1.el5 Server [root@rac1 ~]# [root@rac1 ~]# uname -r 2.6.18-128.el5 [root@rac1 ~]# [root@rac1 ~]# yum install -y ocfs2console.x86_64 ocfs2-tools.x86_64 ocfs2-tools-devel.x86_64 ocfs2-2.6.18-128.el5.x86_64 Loaded plugins: security Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package ocfs2console.x86_64 0:1.2.7-1.el5 set to be updated ---> Package ocfs2-tools.x86_64 0:1.2.7-1.el5 set to be updated ---> Package ocfs2-tools-devel.x86_64 0:1.2.7-1.el5 set to be updated --> Processing Dependency: glib2-devel >= 2.2.3 for package: ocfs2-tools-devel --> Processing Dependency: e2fsprogs-devel for package: ocfs2-tools-devel ---> Package ocfs2-2.6.18-128.el5.x86_64 0:1.2.9-1.el5 set to be updated --> Running transaction check ---> Package glib2-devel.x86_64 0:2.12.3-2.fc6 set to be updated ---> Package e2fsprogs-devel.x86_64 0:1.39-20.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================== Installing: ocfs2-2.6.18-128.el5 x86_64 1.2.9-1.el5 Server 279 k ocfs2-tools x86_64 1.2.7-1.el5 Server 1.1 M ocfs2-tools-devel x86_64 1.2.7-1.el5 Server 82 k ocfs2console x86_64 1.2.7-1.el5 Server 168 k Installing for dependencies: e2fsprogs-devel x86_64 1.39-20.el5 Server 636 k glib2-devel x86_64 2.12.3-2.fc6 Server 1.3 M Transaction Summary =============================================================================================================================================================================== Install 6 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 3.6 M Downloading Packages: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 1.0 GB/s | 3.6 MB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : ocfs2-tools [1/6] Installing : glib2-devel [2/6] Installing : e2fsprogs-devel [3/6] Installing : ocfs2-tools-devel [4/6] Installing : ocfs2-2.6.18-128.el5 [5/6] Installing : ocfs2console [6/6] Installed: ocfs2-2.6.18-128.el5.x86_64 0:1.2.9-1.el5 ocfs2-tools.x86_64 0:1.2.7-1.el5 ocfs2-tools-devel.x86_64 0:1.2.7-1.el5 ocfs2console.x86_64 0:1.2.7-1.el5 Dependency Installed: e2fsprogs-devel.x86_64 0:1.39-20.el5 glib2-devel.x86_64 0:2.12.3-2.fc6 Complete! [root@rac1 ~]# |
安装完成后:
1 2 3 4 5 6 |
[root@rac1 ~]# lsmod | grep --color ocfs2 ocfs2_dlmfs 56080 1 ocfs2_dlm 219664 1 ocfs2_dlmfs ocfs2_nodemanager 227464 5 ocfs2_dlmfs,ocfs2_dlm configfs 62301 2 ocfs2_nodemanager [root@rac1 ~]# |
1 2 3 4 5 6 7 |
[root@rac1 ~]# export DISPLAY=192.168.56.1:0.0 [root@rac1 ~]# xhost + access control disabled, clients can connect from any host [root@rac1 ~]# [root@rac1 ~]# ocfs2console & [1] 10672 [root@rac1 ~]# |
对“/etc/init.d/o2cb”的“enable”需要在集群的各个节点上都予以执行:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@rac1 ~]# /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@rac1 ~]# [root@rac1 ~]# /etc/init.d/o2cb enable Writing O2CB configuration: OK Checking O2CB cluster configuration : Failed [root@rac1 ~]# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@rac1 ~]# cat /etc/ocfs2/cluster.conf node: ip_port = 7777 ip_address = 192.168.56.11 number = 0 name = rac1 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.56.12 number = 1 name = rac2 cluster = ocfs2 cluster: node_count = 2 name = ocfs2 [root@rac1 ~]# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@rac2 ~]# cat /etc/ocfs2/cluster.conf node: ip_port = 7777 ip_address = 192.168.56.11 number = 0 name = rac1 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.56.12 number = 1 name = rac2 cluster = ocfs2 cluster: node_count = 2 name = ocfs2 [root@rac2 ~]# |
三、O2CB
节点一:
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 39 40 41 42 43 44 45 |
[root@rac1 ~]# /etc/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 ~]# [root@rac1 ~]# /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]: 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]: 3000 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 ~]# [root@rac1 ~]# /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: 3000 Checking O2CB heartbeat: Not active [root@rac1 ~]# |
节点二:
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 39 40 41 42 43 44 |
[root@rac2 ~]# /etc/init.d/o2cb unload Unmounting ocfs2_dlmfs filesystem: OK Unloading module "ocfs2_dlmfs": OK Unmounting configfs filesystem: OK Unloading module "configfs": OK [root@rac2 ~]# [root@rac2 ~]# /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]: 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]: 3000 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@rac2 ~]# [root@rac2 ~]# /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: 3000 Checking O2CB heartbeat: Not active [root@rac2 ~]# |
*** 开机启动O2CB(各个节点均需配置)
1 2 3 4 |
[root@rac1 ~]# chkconfig o2cb on [root@rac1 ~]# chkconfig o2cb --list o2cb 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@rac1 ~]# |
四、OCFS2Console:Format and Mount
1 2 3 |
[root@rac1 ~]# ocfs2console & [1] 10981 [root@rac1 ~]# |
2)Mount:
1 2 |
[root@rac1 ~]# mkdir /ocfs [root@rac1 ~]# |
1 2 3 4 5 6 7 8 |
[root@rac1 ~]# 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 [root@rac1 ~]# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@rac1 ~]# 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 960M 133M 827M 14% /ocfs [root@rac1 ~]# mount /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) /dev/hdc on /iso type iso9660 (ro) none on /proc/fs/vmblock/mountPoint type vmblock (rw) configfs on /sys/kernel/config type configfs (rw) ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw) /dev/sdb1 on /ocfs type ocfs2 (rw,_netdev,datavolume,nointr,heartbeat=local) [root@rac1 ~]# |
b.命令行
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 |
[root@rac2 ~]# 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 [root@rac2 ~]# [root@rac2 ~]# mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs [root@rac2 ~]# [root@rac2 ~]# 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 960M 133M 827M 14% /ocfs [root@rac2 ~]# [root@rac2 ~]# mount /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) /dev/hdc on /iso type iso9660 (ro) none on /proc/fs/vmblock/mountPoint type vmblock (rw) configfs on /sys/kernel/config type configfs (rw) ocfs2_dlmfs on /dlm type ocfs2_dlmfs (rw) /dev/sdb1 on /ocfs type ocfs2 (rw,_netdev,datavolume,nointr,heartbeat=local) [root@rac2 ~]# |
五、终了
访问:
1 2 3 4 5 |
[root@rac1 ~]# cd /ocfs [root@rac1 ocfs]# ll total 2 drwxr-xr-x 2 root root 2048 Sep 16 22:43 lost+found [root@rac1 ocfs]# |
至此,有关OCFS2的安装于配置,就全部结束了。
——————————————————
Ending。