HP Serviceguard Configuration Guide- serviceguard cluster commands, cmviewcl, cmhaltpkg, cmrunpkg

HP Serviceguard

HP Serviceguard was the very first solution for high availability clustering software. Serviceguard uses resource virtualization to ensure that critical applications, databases, or services are continually up and running. Users typically don’t care which server they run their application on—they just want to make sure that application is running. Serviceguard hides the details of which server an application is actually running on at any given time, which means it can move applications between servers on the fly.

hp-serviceguard

 

What is a Serviceguard cluster?

Any host system running in a Serviceguard cluster is called an active node. Under normal conditions, a fully operating Serviceguard cluster monitors the health of the cluster’s components on all its active nodes.Most Serviceguard packages are failover packages. When you configure a failover package, you specify which active node will be the primary node where the package will start, and one or more other nodes, called adoptive nodes, that can also run the package. 

Creating a Serviceguard  cluster

Before you configure the cluster, you will need to create a volume group on the shared disks, so that Service Guard can create a “Cluster Lock Disk”.

serviceguard-configuration

 

On testnode1

 # pvcreate /dev/rdsk/c0t4d0

# pvcreate /dev/rdsk/c1t4d0

# mkdir /dev/vg01

# mknod /dev/vg01/group c 64 0×010000

# vgcreate vg01 /dev/dsk/c0t4d0 /dev/dsk/c1t4d0

# mkdir /etc/cmcluster/maps

# vgexport –p –s –m vg01 /etc/cmcluster/maps/vg01

 On testnode2

 # mkdir /dev/vg01

# mknod /dev/vg01/group c 64 0×010000

# mkdir /etc/cmcluster/maps

# rcp testnode1:/etc/cmcluster/maps/vg01 /etc/cmcluster/maps/vg01

# vgimport –s –m /etc/cmcluster/maps/vg01 vg01

# vgchange –a y vg01

# vgchange –a n vg01

You can now go ahead and create the cluster.

# cd /etc/cmcluster

# cmquerycl –v –C cmclconfig.ascii –n testnode1 -n testnode2

After creating this file, you will need to edit it to suit your cluster. You will need to

alter the following lines:

 # vi cmclconfig.ascii

 CLUSTER_NAME simeon1

NODE_NAME testnode1

NETWORK_INTERFACE lan0

HEARTBEAT_IP 192.168.100.101

NETWORK_INTERFACE lan1

HEARTBEAT_IP 164.39.8.92

NETWORK_INTERFACE lan2

NODE_NAME testnode2

NETWORK_INTERFACE lan0

HEARTBEAT_IP 192.168.100.102

NETWORK_INTERFACE lan1

HEARTBEAT_IP 164.39.8.93

NETWORK_INTERFACE lan2

HEARTBEAT_INTERVAL 2000000

NODE_TIMEOUT 5000000

MAX_CONFIGURED_PACKAGES 10

 To check that there are no mistakes in the file, use the check command.

 # cmcheckconf –C /etc/cmcluster/cmclconfig.ascii

 To apply the configuration file, usr the apply command.

 # cmapplyconf –C /etc/cmcluster/cmclconfig.ascii

 You are now ready to startup the cluster.

On testnode1

# vgchange –a n vg01

# cmruncl –v

# cmviewcl –v

# vgchange –c y vg01

On Both nodes

# netstat -in

# vi /etc/rc.config.d/cmcluster

AUTOSTART_CMCLD=1

On testnode1

# cmhaltcl –v

# vgchange –a n vg01

Creating a basic package

Serviceguard packages group together applications and the services and resources they depend on. The typical Serviceguard package is a failover package that starts on one node but can be moved (“failed over”) to another if necessary.

Creating or modifying a package requires the following broad steps:

1. Generate the package ASCII file

2. Edit the package ASCII file

3. Generate the package control script

4. Edit the package control script

5. Distribute the control script to the cluster nodes

6. Apply the package ASCII file

Once the cluster is up and running, we can create a package to run in it. This package will run an “xclock” on a client PC, and mount a file system, using the IP Address 164.39.8.101 The first step is to make a logical volume.

On node1

# vgchange –a e vg01

# lvcreate –L 20 vg01

# lvextend –m 1 /dev/vg01/lvol1

# newfs –F vxfs /dev/vg01/rlvol1

# mkdir /pkg_1

# vi /etc/fstab

#/dev/vg01/lvol1 /pkg_1 vxfs delaylog 0 2 # MC/SG

# vgchange –a n vg01

# vgexport –p –s –m vg01 /etc/cmcluster/maps/vg01

On Node 2

# vgexport vg01

# mkdir /dev/vg01

# mknod /dev/vg01/group c 64 0×010000

# vgimport –s –m /etc/cmlcuster/maps/vg01 vg01

# mkdir /pkg_1

# vi /etc/fstab

#/dev/vg01/lvol1 /pkg_1 vxfs delaylog 0 2 # MC/SG

Now we can make the package.

On Node1

# cd /etc/cmcluster

# mkdir pkg_1

# cd pkg_1

# cmmakepkg –p pkg_1.conf

The file pkg_1.conf will need to be edited to suit.

# vi pkg_1.conf

PACKAGE_NAME pkg_1

NODE_NAME testnode1

NODE_NAME testnode2

RUN_SCRIPT /etc/cmcluster/pkg_1/pkg_1.cntl

RUN_SCRIPT_TIMEOUT NO_TIMEOUT

HALT_SCRIPT /etc/cmcluster/pkg_1/pkg_1.cntl

HALT_SCRIPT_TIMEOUT NO_TIMEOUT

SERVICE_NAME pkg_1_service

SUBNET 164.39.8.0

Add the IP address that will be used for the package in the hosts file.

# vi /etc/hosts

164.39.8.101 pkg_1 xclock

# cmmakepkg –s pkg_1.cntl

The file pkg_1.cntl will need to be edited to suit

# vi pkg_1.cntl

VG[0]=”vg01″

LV[0]=”/dev/vg01/lvol1″; FS[0]=”/pkg_1″; FS_MOUNT_OPT[0]=”"

IP[0]=”164.39.8.101″

SUBNET[0]=”164.39.8.0″

SERVICE_NAME[0]=”pkg_1_service”

SERVICE_CMD[0/etc/cmcluster/pkg_1/service_pkg_1"

#SERVICE_RESTART[0]=”"

function customer_defined_run_cmds

{

# ADD customer defined run commands.

if [ $(hostname) = "testnode1" ]

then COLOUR=”blue”

else COLOUR=”red”

fi

/usr/bin/X11/xclock -bg “$COLOUR” -update 1 –display \

164.39.11.232:0.0 &

test_return 51

}

function customer_defined_halt_cmds
{

# ADD customer defined halt commands.

if

ps -ef |grep -v grep |grep -q “xclock”

then

kill -9 $(ps -ef |grep -v grep |grep “xclock”|cut -c10-14)

fi

test_return 52

}

# vi pkg_1_service

#!/usr/bin/sh

#This is a script to monitor that xclock is running

while true

do

if

ps -ef |grep -v grep |grep -q “xclock”

then

sleep 5

else

echo “Package xclock failed at $(date) from node \

$(hostname) > /etc/cmcluster/pkg_1/pkg_1.cntl.log”

exit 99

fi

done

# chmod u+x pkg_1_servce

# cd /etc/cmcluster

# rcp –r testnode1:/etc/cmcluster/pkg_1

 On node 1

# cmcheckconf -P pkg_1.conf

# cmapplyconf –P pkg_1.conf

# cmmodpkg –e –n testnode1 -n testnode2 pkg_1

# cmviewcl –v –p pkg_1

# cmhaltpkg pkg_1

# cmviewcl –v|more

# tail /etc/cmcluster/pkg_1/pkg_1.log

# tail /var/adm/syslog/syslog.log

Starting and stopping a Serviceguard Package

Normally, when a cluster starts up, the packages configured as part of the cluster will start up on their configured nodes. You may need to start a package manually after it has been halted manually. You can do this either in Serviceguard Manager or on the Serviceguard command line.

If you want to stop a package, use the following commands

# cmviewcl –v –p <package name>

# cmahalt <package name>

# cmviewcl –v –p <package name>

You halt a Serviceguard package when you wish to bring the package out of use but wish the node to continue in operation. You can halt a package using Serviceguard Manager or on the Serviceguard command line. Halting a package has a different effect than halting the node. When you halt the node, its failover packages may switch to adoptive nodes.

If you want to start a package, then use the following commands

# cmviewcl –v –p <package name>

# cmmodpkg –e <package name>

OR

# cmrunpkg –n <host name> <package name>

# cmmodpkg –e <package name>

Deleting a Serviceguard Package

To delete a package, use the following commands

 # cmdeleteconf -p <package name>

Stopping and starting the Serviceguard Cluster

The cmhaltcl command can be used to halt the entire cluster. This command causes all nodes in a configured cluster to halt their Serviceguard daemons. You can use the -f option to force the cluster to halt even when packages are running.

To stop the cluster, use the following commands

The cmhaltcl command can be used to halt the entire cluster. This command causes all nodes in a configured cluster to halt their Serviceguard daemons. You can use the -f option to force the cluster to halt even when packages are running.

 

To stop the cluster, use the following commands

# cmiewcl –v

# cmhaltcl

OR

# cmhaltcl –f

To start the cluster: -

# cmruncl –v

# cmviewcl –v

Automatically Restarting the Serviceguard Cluster

You can configure your cluster to automatically restart after an event, such as a long-term power failure, which brought down all nodes in the cluster. This is done by setting AUTOSTART_CMCLD to 1 in the

/etc/rc.config.d/cmcluster file.

Stopping and starting a node in the Serviceguard Cluster

Starting a node will not cause any active packages to be moved to the new node. However, if a package is DOWN, has its switching enabled, and is able to run on the new node, that package will automatically run there.

To stop a node in the cluster

# cmhaltnode –n <node name>

# cmviewcl –v

# vi /etc/rc.config.d/cmcluster

AUTOSTART_CMCLD=0

To start a node in the cluster.

# cmrunnode –n <name name>

# cmviewcl –v

# vi /etc/rc.config.d/cmcluster

AUTOSTART_CMCLD=1

Deleting a cluster

When there are no packages left in the cluster, and you want to delete the  cluster, use the following commands.

# vgchange –c n vg01

# cmhaltcl –f

# cmdeleteconf –c <cluster_name>

# vgchange –a y vg01

# lvremove /dev/vg01/lvol1

# vgremove vg01

# rm –r /dev/vg01

Tell a friend

Apple iPad Success or Failure ?

Apple iPad is the most innovative product launched in Feb,2010. Well, before its growth there are many criticisms and debates about the product. I am giving my views after analysis.

There are very less chances for the product to get failed.  The crispy features in the ipad announces its success and wrote a foreword for the “iPad’s Success Story”

iPad is the super idea  to access the Web,Photos,Videos,E-mail etc.,

Features of  Apple ipad

Safari Browser

The tablet has a large multi-touch screen which has the option to switch to portrait  and landscape view.

Strengths of iPad

No multitasking, no USB port, no Flash, no camera – that’s iPad for you. Still the device has speed, portability, style, simplicity and above all price going for it.

The iPad seems to have come in with a clearcut and flawless strategy to capture the market. By cutting out on expensive features such as the camera, Apple is set to penetrate the market on the price flank.

Price of iPad

The price of iPad starts at $499.  So that a middle class can afford buying it. I accept it is not economic for all. :-)

Great Features of iPad

LED-Backlit IPS Display – This has 9.6 inches of LED display that you can’t image even. So working on this would be great.

Multi-Touch Screen – This is similar to the one we see in iPhone.

Light Weight – Apple iPad weighs just 1.5 pounds and 0.5 inch thin.

Very long battery life – This graphical tablet deserves the long battery life. The battery lasts almost for 10 hours.

Numerous Applications – There are about 140,000 applications available in this great magic box.

You can write and send email, text messages

With the Apple iPad you can store all your information personal or for work.

You can listen to music or watch a movie when you have nothing to do.

And of course you can browse the internet.

Facebook – This comes with you where ever you go. Connect to your friends in one touch.

You Tube -  The iPad has the built in you tube video organiser where you can play videos in landscape mode. In this mode the video automatically switches to fullscreen view.

Handy iPod and iTunes – You can still feel the pleasure of iPod and the power of iTunes. Buletooth headphones are supported.

iBookStore – This is apple’s online bookstore. You can just read or buy books and keep it in your shelf just in one touch.

 

http://www.apple.com/ipad/

Regards,
R.Gopinath

Tell a friend

mysql error #1226 user has exceeded max_questions

Problem Statement:

mysql error #1226

The problem that everyone faces with very old databases. The reason for this error is when the database user connects to the server for several times, there are many possibilities of database lock.

1. The user connection may not have terminated properly.

2. Or the maximum connection limit specified for that particular user may have exceeded from the limit.

To resolve this mysql error #1226. we have to configure the database properly.

Mostly people using the wordpress CMS need to change the wp_options table.

Usually this situation happens sometimes due to server overloading or user exceeding max_connections_per_hour.

Solution:

But there are many instances for us that we can’t wait for such a long time to update the tables and databases and we may need to seek help from others.

During that critical time, this solution helps you much from avoiding the downtime of your website.

Once i faced a similar problem and my website was down for 1 week. It was a drastic situation and i lost all my page rank.

But i came forward with a quick and simple solution.

Follow these simple steps to solve ‘user has exceeded max_questions’ problem

1. Your database must have a user ‘A’ using which you have configured your wordpress blog.

2. Now the problem is that user ‘A’ has exceeded maximum_questions resource (current value: 40)

3.  Create a new user ‘B’ in your database through your domain control panel  and update the same user name you wp-config.php file in  wordpress installation directory.

4.  Now you got the problem fixed in few minutes. It will not disturb the database or the posts you have in your wordpress or phpbb.

For phpbb  users ‘mysql error #1226 user has exceeded max_questions’

1.  Follow the same steps above and update the config.php file in your phpbb installation directory.

The issue is solved.  This may be a simple two-lined solution but powerful.

Keep away your worries and enjoy blogging. if any clarifications revert back to gopi@neuronring.com.

Regards,

R.Gopinath

Tell a friend

High Availability Clustering–Types and Advantages

What does High Availability mean?

In terms of computers HA means a system design protocol which ensures the availability of a resource in a given amount of time or any terms of measurement.

HA-Clustering and Failover

This is a computer cluster implemented for making a resource available all the time or reducing the downtime of the resource. For example, an application server serving the user requests continuously and in come point of time it stopped responding. In that time the users waiting for a response from the server should not get disappointed.

Here comes the clustering technology, the cluster configuration in the network transfers or redirects the user requests to the backup server. This process is called Failover.

High-availability-clustering

High-availability-clustering

The Clustering Software

The clustering software plays main role in the successful functioning of the HA-Clusters. Everyone have a question of who maintains the information and transactions processed by the First Machine.

Yes, the clustering software does that for us. It will copy the last good known configuration from the machine which failed to complete its duty to the machine which is ready to serve for us.

Heart Beat of Clustering

HA clusters use a private Heart-Beat network. This network is responsible for monitoring the health status of all the nodes in the cluster.

HA-Clustering

HA-Clustering-Heart Beat

Split-Brain in Cluster network

The term “Split-Brain” technically explains the following scenario. When all the private network link goes down but the individual cluster nodes are still running, there is a possibility of confusion. Each node in the cluster may think that other node is down and will supply duplicate data. So this is a tedious configure the network to avoid split-brains.

Cluster Node Configurations

 These are the available clustering node configurations

 1. Active/Active – Traffic is directed to another existing node or balanced across all other nodes

2. Active/Passive A complete new node is served when primary node fails

3.  N+1 – Serving a complete new node in the place of primary node and the new node    in the cluster must be capable of handling any services which the primary node handled with/without any special additional software.

4. N+M – Here more than one dedicated nodes are served for handling failovers.
This   may require high cost and maintenance.

5. N-to-1 – Here the backup node is serving temporarily until the primary node is brought back online. Then the running services are transferred to primary node.

6. N-to-N — A combination of Active/Active and N+M clusters, N to N clusters.

Requirements for a High Availability Clustering Environment

 

The HA-Clustering is widely used technology in Data centers and Industries where adaptive infrastructure is required. This requires high investment hence this is called as costly technology.

Below given are the minimum requirements for setting up a HA Clustered Environment.

  1. You must be having suitable advanced application which is capable to support HA-C. Not all the applications can run in High Availability Environment.
  2. The application should be capable of running its own multiple instances.
  3. The application you are using in HA-C must have command line utility. i.e ability to control the app through command line interface by executing some commands.
  4. The application should have the capability of using Storage Area Network (SAN).

The application must be capable of storing the data in a SAN, so that even a crash occurs the other back-up node can use the saved-state of information.

Applications of HA Clustering Technology

So, where is this clustering more useful and applied ? HA Clustering is used for

1. Critical databases

2. File sharing networks

3. Business Applications

4. E-Commerce Websites

oracle-real-application-clusters-RAC

Some famous HA-Clustering products

Vendor Product Name Supported Platforms
Hewlett-Packard HP ServiceGuard   HP-UX, Linux
IBM High Availability Cluster AIX, Linux
Open –Source Linux-HA   Linux
Microsoft Microsoft Cluster Server (MSCS) Windows server 2008
Red Hat Red Hat Cluster Suite Linux

My next update in HA-Clustering would be about configuring the HA clusters in live environment.

Wait for a couple days….

Regards,
R.Gopinath

Tell a friend