You are on page 1of 28

Configuration of Red Hat fails over Cluster for SAMBA service

Requirements:

2 red hat nodes
Open Filer for shared storage

All machines should be in private LAN and physical LAN.( should have two NIC cards)
All /etc/hosts file should have the IP’s and hostnames updated like below:
#Node1
172.20.129.178 dssnode1.tnsad.com
dssnode1
192.168.100.2 dssnode1.cluster1.com dssnode1
#Node2
172.20.130.96 dssnode2.tnsad.com
dssnode2
192.168.100.5 dssnode2.cluster1.com dssnode2
#Openfiler
172.20.130.103 dssop.tnsad.com
192.168.100.4 dssop.cluster1.com

dssop
dssop

Configure Open filer with minimum two disks and export to private network (one for quorum disk and one for shared storage)
I use this link to configure http://www.techhead.co.uk/how-to-configure-openfiler-v23-iscsi-storage-for-use-with-vmware-esx
Install iscsi initiator on two redhat nodes and follow the below steps on both nodes
#yum install iscsi-initiator-utils
Start iscsi
#service iscsi start
Scan for iscsi disks

http://online-trainings.net
http://onlineappsschool.com

#iscsiadm -m discovery -t sendtargets -p <open filer IP>
Restart the iscsi
#service iscsi restart
Check the disks
#fdisk -l
Create quorum disk on primary node
#mkqdisk -c /dev/sdb -l quorum
Create cluster storage disk
#mkfs.gfs -p lock_dlm -t <cluster name>:<cluster storage name> -j 4 /dev/sdb
Note: do not use gfs2 as it has auto mount issues
Create a mount point on nodes to mount the gfs file system
#mkdir /cluvol
Open cluster configuration GUI tool

http://online-trainings.net
http://onlineappsschool.com

#system-config-cluster http://online-trainings.net http://onlineappsschool.com .

Click on “Create New Configuration” button to create a new cluster Give a cluster name and update quorum disk details and fill the program field with Openfiler IP as mentioned above http://online-trainings.com .net http://onlineappsschool.

net http://onlineappsschool.http://online-trainings.com .

Select Cluster node tab to add a node to cluster and press tab and enter to get a window to specify node name: http://online-trainings.net http://onlineappsschool.com .

Add nodes other nodes in the same way.net http://onlineappsschool. Add fence to the cluster: Select “Fence device” tab and press tab and enter to add fencing to cluster: http://online-trainings.com .

net http://onlineappsschool. http://online-trainings.com .Select “scsi reservation fencing” in drop down list and give a name.

com .Create a failover domain: Select “failover Domains” tab and press tab and enter to give a name: http://online-trainings.net http://onlineappsschool.

net http://onlineappsschool.http://online-trainings.com .

com .Add node to failover domain: Select failover domain and press tab and enter and choose nodes in the “available cluster nodes” drop down list: http://online-trainings.net http://onlineappsschool.

Create the resources: http://online-trainings.net http://onlineappsschool.Set the priority for the nodes to run the services and select restrict failover.com .

net http://onlineappsschool.http://online-trainings.com .

Create IP resource for virtual IP for cluster service: http://online-trainings.net http://onlineappsschool.com .

net http://onlineappsschool.com .Create gfs filesystem resource: http://online-trainings.

net http://onlineappsschool.com .Create samba resource: http://online-trainings.

com .net http://onlineappsschool.Create services for cluster: http://online-trainings.

net http://onlineappsschool.Select “services” and press tab and enter: Add IP service: http://online-trainings.com .

Add resource to IP address service: http://online-trainings.net http://onlineappsschool.com .

net http://onlineappsschool.com .Select “add a shared resource to this service” button and select the ip resource from pop up window: http://online-trainings.

Select “relocate” and set the fail over domain and close: Follow the same steps for gfs and samba: http://online-trainings.com .net http://onlineappsschool.

http://online-trainings.net http://onlineappsschool.com .

com .http://online-trainings.net http://onlineappsschool.

Select file and click on save button: Then exit the window and start the services in order shown below: http://online-trainings.Finally we have to save the configuration.net http://onlineappsschool.com .

Then again open the cluster manager tool: http://online-trainings.net http://onlineappsschool.Note: services should be started in the order on all the nodes.com .

net http://onlineappsschool.com .Now we have to save the configuration on all the nodes for that we need to click on “send to cluster” button it will sink the cluster configuration with all the nodes: http://online-trainings.

<samba service name> is the conf file http://online-trainings.com .conf.Then you can open cluster manager tab and see the running services: Finally configure the samba for cluster the config file will be in /etc/samba directory with name : “smb.net http://onlineappsschool.<samba service name>” configure samba smb.conf.

conf. #cat /etc/samba/smb.net http://onlineappsschool.samba interfaces = <cluster virtual ip> local master = no domain master= no password server = none preferred master = no guest ok = yes guest account = root security = SHARE dns proxy = no [cluvol] comment = HA browsable = yes writable = yes public = yes path = /cluvol guest ok = yes create mask = 07777 #smbpasswd -a root restart the cluster samba service in console copy the smb conf file to all nodes Check the failover http://online-trainings.com .Note: the below samba parameters for default configuration just to check the cluster service. You can have your custom parameters for security.