Clustering with CentOS 5.5 and “luci”….

Ok, so i deal a lot with clustering of servers or “Nodes” and i will briefly show a really simple cluster which only has a shared or “Highly available” IP address in the case of one of the Nodes failing the shared IP address will still be up and pingable if you where to combine this with the “HTTPD” or Web services for linux then you would end up with a website that would also be acceible even if one of the servers/Nodes die.

The Setup we are going to create…

Ok so for this example we are going to have:
172.16.0.1 ClusterAdmin.example.local
172.16.0.2 ClusterNode01.example.local
172.16.0.3 ClusterNode02.example.local
172.16.0.4 Shared Highly Availible IP Address

ClusterAdmin will contain luci and administer our cluster, ClusterNode0X are our cluster node servers.

On all the servers do a bog standard install of CentOS 5.5 and when it asks for what enviroment you want tick “server – Desktop” and “Clustering”, do this on all servers.

Configuring luci…

On ClusterAdmin open terminal and type in luci_admin init and enter a password for luci, this will be the main admin password ofr adminitering the cluster, the user name will be admin.

Then type in “service luci start” this will start luci and we will then be able to type in to a

web browser  https://172.16.0.1:8084 and be presented with the luci log in page.

Type in admin and the password you choose earlier.

Click on add a system down the left hand side and enter the full FQDN “Fully Qulified Domain Name” so in our case ClusterNode01.example.local and the root password for this node repeat this step for ClusterNode02.example.local, click on submit.

Tip: On all Nodes edit the /etc/hosts file “nano /etc/hosts” and enter the hostname and ip address this will make it easiyer.

IE : 172.16.0.1 ClusterAdmin.example.local ClusterAdmin
172.16.0.2 ClusterNode01.example.local ClusterNode01… etc…..

Click on “Cluster” at the top and then click on “Create a New Cluster” and again enter a Cluster Name IE Shared_IP_Example, enter the FQDN’s of the nodes and the root passwords, and click on submit.

If all went well you should see the cluster name in green and the nodes also listed in green.

Creating the Shared IP Resource…

Click on the cluster name and then click on Resources and add a resource, Select IP Address from the drop down, enter the Highly Availible IP address 172.16.0.4 and put a tick in monitor, and click on submit.

 

Creating the Failover domain and actions…

Next we have to create a failover domain, click on Failover Domains, add a failover domain and give the domain a name such as failover put a tick in Member for both clusterNode01 and ClusterNode02 and click on submit.

 

 

Creating a Shared Fence Device…

Click on Shared Fence Devices, add Shared fence Device. the fence Type is going to be SCSI and the name “Shared_IP”, and click on Add this Shared Fence device.

Click on Nodes, click on ClusterNode01 and scoll to the bottom of the page click on add a fence device, select the scsi shared IP and enter this nodes name which is the same as the node we clicked on IE ClusterNode01.example.local, repeat this for ClusterNode02.

Creating the Shared IP Service…

Click on Services and add a Service, give the service a name, put a tick in automatically start select the failover domain and the recovery policy to relocate.

Click on Add a reserice to the service and under Global resource select the Shared IP resource, and click on Submit.

Nearly done.. Test the failover…

Once all the steps above are completed, click on Nodes and you should see the node names, the failover domain memberships and the services, Shared IP should be running on one of the nodes, click on the Service Shared IP and select from the drop down relocate to other node, while doing this have a ping running to the Shared IP it should stop responding for 2 pings and then kick back in again and the Shared IP should now be on another node.

The Acid Test…

unplug the power to the same node that the shared IP is running on and it should fail back over the the still running node.

Conclusion…

The steps above are the same steps to create, for example a highly availible Web Site, Storage, and other services that need to be up and running 24/7, even if the hardware fails on you…

Any Questions please feel free to email me.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
This entry was posted in How To Guides and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Comments are closed.