6.5. Disabling Resources of a Clustered Service for Maintenance


At times, it may be necessary to to stop a resource that is part of a clustered service. You can configure services in the cluster.conf file to have hierarchical resources (similar to a dependency tree) to disable a resource in a service without disabling other resources within that service.
So, for example, if you have a database that uses an ext3-formatted filesystem, you can disable the database while preserving the filesystem resource for use in the service.
In the following example snippet of a cluster.conf file, a service uses a MySQL database and ext3-formatted filesystem resources.

<resources>
     <mysql config_file="/etc/my.cnf" name="mysql-resource" shutdown_wait="0"/>
     <fs device="/dev/sdb1" force_fsck="0" force_unmount="1" fsid="9349" fstype="ext3" mountpoint="/opt/db" name="SharedDisk" self_fence="0"/>
</resources>

<service name="ha-mysql">
     <fs ref="SharedDisk">
          <mysql ref="mysql-resource"/>
     </fs>
</service>
In order to stop the MySQL-database and perform maintenance tasks without interfering with the cluster software (mainly rgmanager), you must first freeze the clustered service:
clusvcadm -Z ha-mysql
You can then stop the MySQL service with the rg_test command:
rg_test test /etc/cluster/cluster.conf stop mysql mysql-resource
When the MySQL database has been shutdown, maintenance can be performed. After finishing the maintenance, start the MySQL database with rg_test again:
rg_test test /etc/cluster/cluster.conf start mysql mysql-resource
The cluster service is still frozen and will not be monitored by rgmanager. To enable monitoring again, unfreeze the clustered service:
clusvcadm -U ha-mysql

Note

The rg_test utility will stop all instances of a resource on a given node, potentially causing undesired results if multiple services on a single node are sharing the same resource. Do not perform these steps on resources that have multiple instances within the cluster.conf file. In such cases, it is usually necessary to disable the service for maintenance.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.