Sei sulla pagina 1di 31

Red Hat Cluster Suite for Apache

This document will teach you the installation and configuration of Apache Cluster with GFS2 file system For RedHat or Centos 6

Preparing for GFS2 file system


We will use Virtual san storage to create GFS file system via HP VSA image you can get the image from the following site: https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=VSA_DEMO After downloading image go to your VMware work station then choose OPEN VIRTUAL MACHINE then choose the location of image. Power on this machine and waiting startup

For login at HP VSA console write start

Then press login to get main configuration screen

Choose Network TCP/IP and press enter

Choose eth0 then enter Now you need to assign management IP address for HP VSA storage.

Please note, you should use static IP for management your virtual storage.

Configuration and management HP VSA (virtual storage)

Installation of HP CMC tool


1- Download the following file from HP website HP_StoreVirtual_CMC_Installer_for_Linux_BM480-10544.bin Run the following commands 2- chmod 755 HP_StoreVirtual_CMC_Installer_for_Linux_BM480-10544.bin 3- ./HP_StoreVirtual_CMC_Installer_for_Linux_BM480-10544.bin Then please follow the steps at the following photos

HP VSA storage configuration:


Please note after starting CMC application it will detect any HP VSA storage at your network

Now we need to assign management group for administrate HP VSA storage. At the localhost.localdomain section right click on it, then choose add new management group. Please check the below photo

Now we need to assign name for this management group. Write whatever you need I used vsan

After that we need to create administrator user and assign password for this user Please check the following photo

Now we need to assign NTP, DNS and SMTP server for VSA storage Please note we will use NTP only here. At production system you should use DNS and SMTP

Press OK then Next

Press Accept Incomplete

Assign VIP for HP VSA storage


For assign VIP for HP VSA storage we need to create cluster first. After pressing on Accept Incomplete bottom you will get create cluster windows immediately Write your cluster name then press next. Please check the following photo

Press next to assign VIP for this cluster

At the above photo its telling you that which valid VIP you can use. After write the VIP and subnet mask press OK

Partitioning HP VSA storage


The max size available for the HP VSA storage is 5 GB because I'm using demo version

Ill create 2 GB partition with full provisioning. Then press finish. Now your HP VSA storage configured and ready to connect with your system.

HP VSA VIP verification


For verify HP VSA VIP you can use ping to check the VIP whether alive or not.

Now we need to integrate HP VSA storage to RedHat 6

ISCSI installation and configuration


In this section we will install and configure the ISCSI hard drive to able to connect HP VSA storage to our system Please note for installation I will install ISCSI packages with RedHat Cluster packages 1- yum install -y cman modcluster ricci luci cluster-snmp iscsi-initiator-utils openais oddjob rgmanager 2- yum groupinstall "High Availability" "Resilient Storage" 3- yum install lsscsi after finishing the packages installation, we need to get the initiator name of ISCSI via the following command cat /etc/iscsi/initiatorname.iscsi please check the following photos

Integrate HP VSA storage to your System via ISCSI protocol


Open HP CMC tool right click on servers section, then choose new server. 1- At Name section you write your server name 2- Description section, write information about this server. 3- Controlling server IP address section write your server IP 4- Enable allow access via ISCSI 5- at initiator node name section copy the initiator name from /etc/iscsi/initiatorname (iqn.199405.com.redhat:abc702a6170) 6- You will do the same with TC2. Please check following photos.

Assign servers to access HP VSA volume


Go to Volumes (1) and snap, open it then right click on the partition, you will get assign and unassign servers. You will find your servers there. Choose read/write permission for both server and at assigned section check both servers then press OK.

After that go to TC1 and TC2 and run the following command iscsiadm -m discovery -t sendtargets -p 192.168.37.132 (VIP of VSA storage) it will start ISCSI service and show you the initiator name

Please note don't forget to run chkconfig iscsi on at both server We need to verify our configuration by the following command lsscsi to show you which iscsi hard drive connected to your system.

Important note: if the TC2 and TC2 running under VMware work station or ESXi you should add iscsi device from edit virtual machine settings. Please check the following photos

choose physical iscsi device /dev/sg0

then press finish and back to settings again select Genric ISCSI then at Virtual device node choose SCSI 0:0 Generic SCSI (SCSI 0:0) from Menu

at TC2 choose SCSI 0:1 Generic SCSI (SCSI 0:1) from Menu at Virtual Device Node

Apache Cluster configuration


we already had installed cluster packages above via the following commands: 1- yum install -y cman modcluster ricci luci cluster-snmp iscsi-initiator-utils openais oddjob rgmanager 2- yum groupinstall "High Availability" "Resilient Storage" now we should stop iptables and Selinux for stopping iptables you should run the following commands service iptables stop chkconfig iptables off in case you need to keep iptables running you should add the following ports at iptables rules 5404, 5405 UDP corosync/cman (Cluster Manager) 11111 TCP ricci (propagates updated cluster information) 21064 TCP dlm (Distributed Lock Manager) 16851 TCP modclusterd 8084 TCP luci (head node for conga access) For disable Selinux
Edit /etc/selinux/config Set SELINUX=disabled Then run this command #setenforce 0

Conga Pre-configuration
Set the password for ricci ( run the following commands at both servers) passwd ricci Changing password for user ricci. New password: configure the cluster services for auto startup chkconfig ricci on | service ricci start chkconfig luci on | service luci start (head node only) chkconfig cman on | chkconfig clvmd on | chkconfig rgmanager on chkconfig modclusterd on chkconfig NetworkManager off | service NetworkManager stop Regarding the NetworkManager service you should edit the following file /etc/sysconfig/network-scripts/ifcfg-eth0 on both server and configure it like the following photos

Please note i didn't use bond interface because it's not production server now add the IP of both server with Hostname at /etc/hosts of both servers please check the following photos

Configure HP VSA storage as GFS2 file system


To know which hard drive is ISCSI use lsscsi command to tell you which drive is ISCSI Please check the following photo

The ISCSI hard drive is /dev/sdc. Run fdisk /dev/sdc to create /dev/sdc1 partition We need to create GFS2 file system for this partition via the following command mkfs.gfs2 -p lock_dlm -t cls(cls here its my cluster name):datafs1 -j (The number of journals for gfs2_mkfs to create. You need at least one journal per machine that will mount the filesystem. If this option is not specified, one journal will be created) 8 /dev/sdc1

Build your cluster with Conga tool


. 1- Now we will build our cluster with Conga tool. Please note the head node is TC1 with IP 192.168.37.128 and conga port is 8084 Open your web browser and write the following URL https://192.168.37.128:8084 username is root and pw is root1234 then press login

Click on manage clusters then create

For the cluster name as we mention before our cluster name is cls. You can check Use the Same Password for All Nodes if all root password is same Node name it will be based on command hostname ############################################ [root@tc1 ~]# hostname tc1.local [root@tc1 ~]# [root@tc2 ~]# hostname tc2.local [root@tc2 ~]# ################################################ In case it's first time for building cluster I would recommend use Download packages Check enable shared storage support Please check the following photo

Then press create cluster

Now you have cls cluster with 2 node member

For Fence Devices i wont create it, because its not production system.

Go to failover domains then press add 2- For fail over section add the name of your fail over then check each of prioritized and no failback At member section check both servers and for priority for tc1.local set 1 and tc2.local set 2

3- Go to Resources section and press on add. We will add the following as resources A IP address (VIP) B F ile system (GFS2) C - Script (Apache init script for start and stop Apache) Please check the following photos

Adding file system Please note ISCSI device (/dev/sdc1) should be the same at both servers.

Create recourse script. We will use http init script for Apache. For name section you can use httpd or whatever you need.

4- After pressing submit, we need to create service from service group section

Press on add A- For service name section write your service name B- enable Automatically Start for this Service C- For failover domain choose your failover domain name or leave it none

5- the most important step add resource After pressing on add resource bottom we should add all resources we created it before. Please check the following photos

add all resources we had created at global resources section

After pressing on submit bottom you will have Apache Cluster with GFS2 file system. To verify configuration 1- for GFS2 file system please run mount command at TC1

Please check the following photo

For Apache go to your web browser and write the vip (http://192.168.37.139)

we need to check failover whether is working or not we need to reboot TC1 and check logs at TC2. At TC2 log file you will got notification that the TC1 went down and TC2 will handle the cluster check the following photos

Run mount command to check GFS2 whether is mounted or not.

Potrebbero piacerti anche