Pages

PowerHA Cluster Manually Startup

PowerHA cluster manually start using below mention script, including steps to:

  1. Check cluster IP

  2. Check network interface and assign alias if needed

  3. Vary on cluster volume groups (VGs)

  4. Mount the filesystems

Here the below script
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/ksh

echo "Check cluster IP Address......................................."
cltopinfo

echo "Check Network Interfaces......................................."
ifconfig -a

read -p "Please Enter the NIC card, Virtual IP Address & Subnet Mask (space separated): " niccard virtualip subnetmsk

echo "NIC Card: $niccard"
echo "Virtual IP: $virtualip"
echo "Subnet Mask: $subnetmsk"

echo "Adding Alias IP........................................................"

ifconfig $niccard alias $virtualip netmask $subnetmsk up
if [ $? -ne 0 ]; then
echo "Failed to add alias IP on $niccard"
exit 1
fi

echo "Varyon cluster volume groups and Mount Filesystems.............."

# Extract volume groups related to cluster resources

vgs=$(clshowres | grep "Volume Group" | grep "vg" | awk '{print $NF}')
if [ -z "$vgs" ]; then
echo "No volume groups found in cluster resources"
exit 1
fi

for vg in $vgs
do
echo "Varyon volume group: $vg"
varyonvg -O $vg
if [ $? -ne 0 ]; then
echo "Failed to varyon volume group $vg"
exit 1
fi

# List jfs2 filesystems in this VG (exclude jfs2log)
FS_LIST=$(lsvg -l $vg | awk '/jfs2/ && !/jfs2log/ {print $7}')
if [ -z "$FS_LIST" ]; then
echo "No JFS2 filesystems found in volume group $vg"
continue
fi
for fs in $FS_LIST
do
echo "Mounting filesystem: $fs"
mount $fs
if [ $? -ne 0 ]; then
echo "Failed to mount filesystem $fs"
exit 1
fi
done
done

echo "Mount any remaining filesystems from /etc/filesystems......."
mount -a
if [ $? -ne 0 ]; then
echo "Failed to mount filesystems"
exit 1
fi

echo "PowerHA Cluster Manual Start Script Completed..............."


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment