Configuring CentOS + OCFS2

Following outlines the steps that you can take to configure several computers with one shared disk having a distributed file system. In this case OCFS2. CentOS is used here but this works for RHEL as well. Since OCFS2 is developed by Oracle one would think that it’ll come preinstalled with Oracle Enterprise Linux. Alas, not so. I was a bit surprised to find out that it came with GFS with the whole RedHat cluster suite. Bummer.

  • Install the OS on all nodes
  • Download OCFS2 and OCFS2 Tools. Get the version that’s most suited to your OS and install it with the rpm command.
  • Now, have to create the cluster.conf file with all the node info. Following is a config for a 3 node cluster.
    node:
            ip_port = 7777
            ip_address = 10.100.1.1
            number = 0
            name = node0
            cluster = ocfs2
    
    node:
            ip_port = 7777
            ip_address = 10.100.1.2
            number = 1
            name = node1
            cluster = ocfs2
    
    node:
            ip_port = 7777
            ip_address = 10.100.1.3
            number = 2
            name = node2
            cluster = ocfs2
    
    cluster:
            node_count = 3
            name = ocfs2
    

    Create the /etc/ocfs2 folder and copy the cluster.conf there.

  • Configure the o2cb deamon with /etc/init.d/o2cb configure.
  • You can now mount the OCFS2 formatted volume with mount -t ocfs2 /dev/sdb1 /mnt/ocfs

No Comment

Be the first to respond!

Leave a Reply