Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the ways to manage and maintain RHCS clusters

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what are the methods of managing and maintaining RHCS clusters". In the daily operation, I believe that many people have doubts about the methods of managing and maintaining RHCS clusters. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the methods of managing and maintaining RHCS clusters?" Next, please follow the editor to study!

Managing and maintaining RHCS cluster is a very complex and tedious task. In order to maintain a RHCS cluster, you must be familiar with the basic operation principle of RHCS. In terms of cluster management, RHCS provides two ways: Luci graphical interface mode and command line mode. Here we focus on how to manage RHCS cluster under the command line.

Start the RHCS cluster

The core processes of the RHCS cluster are cman and rgmanager. To start the cluster, start cman in turn, and then start rgmanager as follows:

Start the cluster service on the host web1:

[root@web1 ~] # service cman startStarting cluster: Loading modules... Done Mounting configs... Done Starting ccsd... Done Starting cman... Done Starting qdiskd...done Starting daemons...done Starting fencing... Done [OK]

After cman starts successfully on other nodes, start the rgmanager service as follows:

[root@web1 ~] # service rgmanager startStarting Cluster Service Manager: [OK]

Shut down the RHCS cluster

Contrary to starting the cluster server, the command to shut down the RHCS cluster is as follows:

[root@web1 ~] # service rgmanager stop [root@web1 ~] # service cman stop

Sometimes when shutting down the cman service, you may prompt a failure. At this point, you can check whether the local shared storage GFS2 file system has been unmounted, or you can check that all the rgmanager services on other nodes have been shut down properly.

Manage application services

After the cluster system starts, the application service starts automatically by default, but if an application service does not start automatically, it needs to be started manually. The command to manage the application service is clusvcadm, through which you can start, shut down, restart and switch the Del application service in the cluster service.

Start an application

You can start the application service on a node in the following ways, such as starting wrbserver:

[root@web1] # clusvcadm-e webserver-m web1Member web1 trying to enable service:webserver...Successservice:webserver is now running on web1

Close an application

You can shut down the application service on a node in the following ways, such as starting mysqlserver:

[root@mysql1] # clusvcadm-s mysqlserver-m web1Member mysql1 stopping service:mysqlserver...Success

Restart an application

You can restart the application service on a node in the following ways, such as starting wrbserver:

[root@web2] # clusvcadm-R wrbserver-m web1Member web1 trying to restart service:wrbserver...Success

This command is executed on the web2 node and can also restart the wrbserver on the web1 node, so it is possible to execute the clusvcadm command on any node in the cluster.

Switch an application

You can switch application services on a node in the following ways, taking the switching of services from node web1 to node web2 as an example:

[root@web1] # clusvcadm-r wrbserver-m web2Trying to relocate service:webserver to web2...Successservice:webserver is now running on web2

Monitoring the status of RHCS clusters

Through the monitoring of RHCS, it is helpful to understand the health status of each node in the cluster, find the problem and solve the problem in time. The RHCS cluster provides a wealth of status viewing commands. This article mainly introduces how to use cman_tool, clustat, and ccs_tool.

Cman_tool command

There are many cman_tool parameters, but the method to use them is relatively simple. Here's how to use two parameters:

[root@web1] # cman_tool nodes-aNode Sts Inc Joined Name 0 M 0 2010-08-23 01:24:00 / dev/sdb7 1 M 2492 2010-08-23 01:22:43 web2 Addresses: 192.168.12.240 2 M 2492 2010-08-23 01:22:43 Mysql1 Addresses: 192.168.12.231 3 M 2492 2010-08- 23 01:22:43 Mysql2 Addresses: 192.168.12.232 4 M 2488 2010-08-23 01:22:43 web1 Addresses: 192.168.12.230

This command displays the name of the node, as well as the IP address of the corresponding node and the time it joined the cluster.

To learn more about cluster nodes, you can use the following command:

[root@web1 ~] # cman_tool statusVersion: 6.2.0Config Version: 35 # Cluster profile version number Cluster Name: mycluster # Cluster name Cluster Id: 56756Cluster Member: YesCluster Generation: 2764Membership state: Cluster-MemberNodes: 4 # number of cluster nodes Expected votes: 6 # expected number of votes Quorum device votes: 2 # voting disk voting value Total votes: 6 # all voting values in the cluster Quorum: 4 # cluster legal voting value, below this value The cluster will stop serving Active subsystems: 9 Flags: Dirty Ports Bound: 0177 Node name: web1Node ID: 4 # the ID number of this node in the cluster Multicast addresses: 239.192.221.146 # Cluster broadcast address Node addresses: 192.168.12.230 # the corresponding IP address of this node

Clustat command

The clustat command is very easy to use, and you can get help through "clustat-h" for detailed usage. Here are just a few examples.

[root@web1] # clustat-I 3Cluster Status for mycluster @ Mon Aug 23 18:54:15 2010Member Status: QuorateMember Name ID Status-web2 1 Online Rgmanager Mysql1 2 Online, rgmanager Mysql2 3 Online, rgmanager web1 4 Online, Local, rgmanager / dev/sdb7 0 Online Quorum Disk Service Name Owner (Last) State-service:mysqlserver Mysql1 started service:webserver web1 started

The meaning of the output is as follows:

The "- I" parameter of clustat can display the running status of each node and service in the cluster system in real time, and "- I 3" indicates that the cluster status is refreshed every three seconds.

In this output, you can see that each node is in a "Online" state, indicating that each node is running normally. If a node exits the cluster, the corresponding state should be "Offline". At the same time, you can also see that the two services of the cluster are also in the "started" state, running on the Mysql1 node and the web1 node.

In addition, the correspondence of cluster nodes can be known through the column "ID". For example, web2 corresponds to a "Node 1" node in this cluster, and similarly, web1 corresponds to a "Node 4" node. Understanding the order of cluster nodes is helpful to the interpretation of cluster logs.

Ccs_tool command

Ccs_tool is mainly used to manage the cluster configuration file cluster.conf. Through ccs_tool, you can add / delete nodes, add / delete fence devices, update cluster configuration files and other operations.

Here are some examples of ccs_tool applications:

When a node has finished modifying the configuration file, you can execute the "ccs_tool update" directive to update the configuration file on all nodes, for example:

[root@web1 cluster] # ccs_tool update / etc/cluster/cluster.confProposed updated config file does not have greater version number. Current config_version:: 35 Proposed config_version:: 35Failed to update config file.

Ccs_tool determines whether or not to update based on the "config_version" value in cluster.conf, so be sure to update the config_ version value of cluster.conf after you modify the cluster.conf file, so that the configuration file can be updated when ccs_tool is performed.

[root@web1 cluster] # ccs_tool update / etc/cluster/cluster.confConfig file updated from version 35 to 36Update complete. At this point, the study on "what are the ways to manage and maintain RHCS clusters" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report