{"id":426,"date":"2010-12-19T21:53:12","date_gmt":"2010-12-19T16:53:12","guid":{"rendered":"http:\/\/linuxndme.com\/?p=106"},"modified":"2010-12-19T21:53:12","modified_gmt":"2010-12-19T16:53:12","slug":"ocfs2-cluster-filesystem","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=426","title":{"rendered":"OCFS2 cluster filesystem"},"content":{"rendered":"<p><strong> Overview <\/strong><\/p>\n<p>Setting up a shared file system on SAN with OCFS2<\/p>\n<p><strong>Requirements &amp; Scenario <\/strong><\/p>\n<p>Two High Availability Centos servers sharing same SAN partition<\/p>\n<p>Server 1 (192.168.1.1) |&#8212;&#8212;&#8212;&#8212;| SAN |&#8212;&#8212;&#8212;&#8212;-| ( 192.168.1.2) Server 2<\/p>\n<p><strong>Objective<\/strong><\/p>\n<p>Installation of OCFS2 filesystem, a shared cluster file system on SAN partition for parallel I\/O<\/p>\n<p><strong>Configuration<\/strong><\/p>\n<p>Follow all these steps on the two server except the one step specifically mentioned.<\/p>\n<p><strong>Step 1<\/strong><\/p>\n<p><strong>Install OCFS2 packages<\/strong>. You have to follow the same steps on the two clustered servers.<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>yum install glib2-devel.x86_64 e2fsprogs-devel.x86_64 <\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/oss.oracle.com\/projects\/ocfs2\/dist\/files\/RedHat\/RHEL5\/x86_64\/1.4.7-1\/2.6.18-194.el5\/ocfs2-2.6.18-194.el5-1.4.7-1.el5.x86_64.rpm <\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/oss.oracle.com\/projects\/ocfs2-tools\/dist\/files\/RedHat\/RHEL5\/x86_64\/1.4.4-1\/ocfs2-tools-1.4.4-1.el5.x86_64.rpm <\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>wget http:\/\/oss.oracle.com\/projects\/ocfs2-tools\/dist\/files\/RedHat\/RHEL5\/x86_64\/1.4.4-1\/ocfs2-tools-devel-1.4.4-1.el5.x86_64.rpm <\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>rpm -ivh ocfs2-tools-devel-1.4.4-1.el5.x86_64.rpm ocfs2-tools-1.4.4-1.el5.x86_64.rpm ocfs2-2.6.18-194.el5-1.4.7-1.el5.x86_64.rpm <\/strong><\/p>\n<p><strong>Step 2<\/strong><\/p>\n<p><strong>Formatting partition<\/strong>. Format  the san partition from one of the nodes ( do this from only one of the servers )<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>mkfs.ocfs2 \/dev\/sdc1 <\/strong><\/p>\n<p><strong>Step 3<\/strong><\/p>\n<p><strong>Edit fstab and add the partition<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>vi \/etc\/fstab <\/strong><\/p>\n<pre>\/dev\/sdc1\t\/dir\tocfs2\t_netdev\t\t0\t0<\/pre>\n<p><strong>Step 4<\/strong><\/p>\n<p><strong>Configuring the ocfs2 . <\/strong> Add the below lines to \/etc\/ocfs2\/cluster.conf<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>mkdir \/etc\/ocfs2 <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>vi \/etc\/ocfs2\/cluster.conf <\/strong><\/p>\n<p><em>node:<br \/>\nip_port = 7777<br \/>\nip_address = 192.168.1.1<br \/>\nnumber = 0<br \/>\nname = node1.cluster.com<br \/>\ncluster = ocfs2<\/em><\/p>\n<p><em>node:<br \/>\nip_port = 7777<br \/>\nip_address = 192.168.1.2<br \/>\nnumber = 1<br \/>\nname = node2.cluster.com<br \/>\ncluster = ocfs2<br \/>\ncluster:<br \/>\nnode_count = 2<br \/>\nname = ocfs2<\/em><\/p>\n<p>set O2CB_ENABLED as true on \/etc\/default\/o2cb<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>vi \/etc\/default\/o2cb <\/strong><br \/>\n<em>O2CB_ENABLED=true<\/em><\/p>\n<p><strong>Step 5<\/strong><\/p>\n<p><strong>Configure o2cb<\/strong>, O2CB is the cluster stack of ocfs2 and it need to be configured before starting ocfs2<\/p>\n<p>remove the below lines from \/etc\/init.d\/o2cb<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>vi \/etc\/init.d\/o2cb <\/strong><\/p>\n<p><em>### BEGIN INIT INFO<br \/>\n# Provides: o2cb<br \/>\n# Required-Start:<br \/>\n# Should-Start:<br \/>\n# Required-Stop:<br \/>\n# Default-Start: 2 3 5<br \/>\n# Default-Stop:<br \/>\n# Description: Load O2CB cluster services at system boot.<br \/>\n### END INIT INFO<\/em><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span> chkconfig &#8211;del o2cb <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/o2cb offline  ocfs2 <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/o2cb unload <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/o2cb configure <\/strong><\/p>\n<p>Hit enter for the questions asked and it will keep the default value<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/o2cb load <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/o2cb online ocfs2 <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>\/etc\/init.d\/ocfs2 start <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chkconfig &#8211;add o2cb <\/strong><br \/>\n<strong><span style=\"color: #3ea99f;\">root@serv:~# <\/span>chkconfig &#8211;add ocfs2 <\/strong><\/p>\n<p>You have configured the cluster filesystem, try some write checks from two servers on the clustered partition, keep an eye on the logs also.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Setting up a shared file system on SAN with OCFS2 Requirements &amp; Scenario Two High Availability Centos servers sharing same SAN partition Server 1 (192.168.1.1) |&#8212;&#8212;&#8212;&#8212;| SAN |&#8212;&#8212;&#8212;&#8212;-| ( 192.168.1.2) Server 2 Objective Installation of OCFS2 filesystem, a shared cluster file system on SAN partition for parallel I\/O Configuration Follow all these steps on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[57],"tags":[101,58,59],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/426"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=426"}],"version-history":[{"count":0,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/426\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}