OCFS2 + ISCSI Centralized storage in Ubuntu 10.10
In this article I will mention the steps to mount an ISCSI target on two ubuntu machines and then cluster it using oracle clustered file system. The newly mounted partition can be used as a centralized storage location in High availability, Failover or load-balancing setup.
The step by step howto is provided below,
1) Setup an ISCSI Server using Openfiler and create SAN LUN, and assign the IP 192.168.1.11 to it.
For setting up openfiler based ISCI target, you can refer steps 1 to 8 mentioned in the url pasted below.
2) Setup two servers with Ubuntu 10.10 in it.
3) Install open-iscsi tool in both servers
4) List out the ISCSI targets available in both servers.
In my case the above command produced the following output,
5) Mount the ISCSI target “iqn.2006-01.com.openfiler:tsn.0d0c0c810c57″(Lets call it TG57) to the local machine
6) Step5 will make the iscsi target TG57 as a device to the system. Which can be viewed as a block device.
7) Install OCFS2 – Oracle Cluster File System for Linux
8) Configure OCFS2
Create a configuration file with proper indendation and copy it to both the servers. In my case “ocfs2” is the cluster name.
If proper indentation is not provided the following error will be shown,
9) Start the cluster service in both the machines
10) Create one partition named /dev/sdb1 in the ISCSI target
11) Make ocfs cluster file system using the following command(need to execute only on one machine)
This creates a file system with 4096 block size and 32768 (32k) cluster size.
NOTE: N= 3 , for a cluster with 2 machines, N=3 and for a cluster with ‘n’ machines N=(n+1)
12) Update partition table on all servers in the cluster. In this case all the servers have /dev/sdb as the iSCSI target.
We will run the following to re-read the partition:
Next, we will want to create a mount point on the servers for this cluster.
Mount the partition,
13) Show results and test