此内容没有您所选择的语言版本。

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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.