Search This Blog

Tuesday, December 17, 2013

Shared Storage with OCFS2

Hi Friends,
How is it going ? Well today i am here to share with you how to share your shared storage (SAN in shared mode or shared iscsi lun ) across multiple nodes. Here we go

Do these steps on all nodes you wish to have shared storage

Step 1: Install ocfs2 tools on each of the nodes. Lets me assume you have debian based distro. Use relative commands for other distro

# apt-get install ocfs2-tools ocfs2console

Step 2: Edit default configuration file and enable O2CB

# vi /etc/default/o2cb


O2CB_ENABLED = false



Step 3: Create the clustering configuration

# vi /etc/ocfs2/cluster.conf

Add these contents

        ip_port = 7777
        ip_address = <node 1 ip>
        number = 1
        name = <node 1 host name>
        cluster = ocfs2
        ip_port = 7777
        ip_address = <node 2 ip>
        number = 2
        name = <node 2 host name>
        cluster = ocfs2
        node_count = 2
        name = ocfs2

        <node # ip> is the node ip
        <node # host name> is the host name of node

I have assumed that my cluster consists of 2 nodes. If there are more nodes add more node parameter group and change node_count = <total of nodes in the cluster>

Step 4: start or restart o2cb service

# /etc/init.d/o2cb restart

Step 5: Change vm.dirty_ratio to reduce caching of files as it would create some lag in shared cluster.

# vi /etc/sysctl.conf

Add this line to the end of file, if it does not exists anywhere in the file


Save the file and exit

Step 6: This step is performed on only one of the nodes. Here we format the file system to ocfs2 format

# mkfs.ocfs2 -b 4k -C 32k -L <any cluster name> -N <max no. of nodes> /dev/<shared device path>


# mkfs.ocfs2 -b 4k -C 32k  -L "cluster-storage" -N2 /dev/sdb1

Step 7: Perform the following steps on all nodes

# modprobe ocfs2_stackglue

Mount the shared partition on all nodes

# mount /dev/<shared device path> <mount point>


# mount /dev/sdb1 /mnt/

Step 8: Testing the shared storage

# touch <mounted location>/a

list it across all the other nodes

# ls <mounted location>

You must be able to see the shared data on all nodes :)

Sunday, December 15, 2013

Solution to Problem installing BCM Wireless drivers in linux

Hi All,
This is another page i write today which might help few people like me who struggled installing bcm wireless drivers on linux (debian). It may work for other flavors too. So steps are as follows.

Get to the terminal as root user and typw,

# lspci

and if you find something like this on the output of the command

Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)

Then this solution might help you.

Download the bcm drivers from (choose your architecture)

Also download the patch from the following site

Get to the folder where you downloaded the drivers

# cd <download driver>

Extract the driver and apply the patch

# tar zxvf <downloaded file name>
# cd <extracted folder>
# mv <patch> .
# patch -p0 src/wl/sys/wl_linux.c < bc_wl_abiupdate.patch

Compile the drivers

# make
# make install

Insert the module

# insmod /lib/modules/`uname -r`/wl.ko
# modprobe wl

There you go

Your wireless drivers are up. Tadaaaaaaaaaaa