I have recently been working alot with HP-UX. A big part of that work relates to managing Serviceguard clusters, something I have had little previous experience doing. It was a challenge for me to find any sort of a quick start guide or simplified steps towards building a Serviceguard cluster, so I wanted to combine all the pieces and parts I have Googled and man-paged together so the next person can hopefully find this useful.
Prerequisites
- Two hosts (nodes) running the same build of HP-UX
- Same version of Serviceguard installed
Here are the steps to build a ServiceGuard cluster on HP-UX 11.31
- Run csshsetup <secondary nodename> on your primary node, enter the root password.
- Run csshsetup <primary nodename> on your secondary node, enter the root password.
- Run cmpreparecl -n <primarynode> -n <secondarynode> to set up the Serviceguard relationship settings
- Create a basic cluster configuration file by running cmquerycl -v -C <clustername.ascii> -n <primarynode> -n <secondarynode>
- Edit the newly created ascii file to your specific needs, noting things like:
- Cluster name
- IPs
- Quorum server hosts or volume group
- Cluster shares storage/volume groups
- Take some extra time here, this is really important!
- Validate the cluster config file by running cmcheckconf -C <clustername.ascii>. Deal with any warnings or errors that are of concern. (The setup will apply with warnings, but they should still be considered)
- Apply the config and create the cluster by running cmapplyconf -v -C <clustername.ascii>.
- Review all the output and make sure the cluster relationship was successful; run cmviewcl which should show both nodes, likely in a “down” state
- You can bring up the nodes now if you want, starting with the primary node by running cmrunnode <nodename>. Run cmviewcl again to check and make sure everything looks good. You’ll see a cluster, and nodes but no packages yet
- Now its time to create some packages. This is where the real meat of Serviceguard starts to develop, so pay special attention to these configurations
- You can create a very basic template config by running cmmakepkg -m sg/failover -m sg/package_ip <packageconfig.conf> – which would give you failover and IP capabilities
- Or, you could create a “full” config by running cmmakepkg -m sg/all <packageconfig.conf>.
- Edit the package config file to suit your needs, consider adding: IP Addresses, package names, filesystems and volume groups
- When you’ve got your package config file in order, you can validate it by running cmcheckconf -v -P <packageconfig.conf>.
- Review your output and check for any errors. If you’re satisfied with everything, go ahead and apply the config to create your cluster package! cmapplyconf -P <packageconfig.conf>
- Run a cmviewcl again to check out the cluster now, you should see your newly created cluster package, in a down state.
- To bring the package online, run cmrunpkg -n <nodename> <packagename> and then make sure it is up and running (with another cmviewcl)
- Optionally, you can set the package up for auto run by cmmodpkg -e <packagename> to allow it to startup automatically after a failover.
You can also use the HP systems management homepage to click through the steps of creating a Serviceguard cluster, but really where’s the fun in that? 🙂
A list of some of the useful commands to use for Serviceguard clusters:
- cmviewcl
- cmquerycl
- cmrunpkg
- cmhaltpkg
- cmrunnode
- cmcheckconf
- cmapplyconf
- cmmakepkg