In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of how to manage and maintain RHCS cluster, the content is detailed and easy to understand, the operation is simple and fast, and it has certain reference value. I believe you will gain something after reading this article on how to manage and maintain RHCS cluster. Let's take a look at it.
RHCS is the abbreviation of Redhat Hat Cluster Suite, that is, Red Hat Cluster Suite. RHCS is a collection of cluster tools that can provide high availability, high economy, load balancing, storage sharing and low cost. It integrates the three major economic architectures in the cluster system, and can provide a secure and stable running environment for web applications, database applications, etc.
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 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 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 closes 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 monitors RHCS cluster status
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 1M 2492 2010-08-23 01:22:43 web2 Addresses: 192.168.12.240 2M 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: 9Flags: DirtyPorts 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 clustat command of the corresponding IP address of this node
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, rgmanagerMysql1 2 Online RgmanagerMysql2 3 Online, rgmanagerweb1 4 Online, Local, rgmanager/dev/sdb7 0 Online Quorum DiskService 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 several application examples of ccs_tool: when the configuration file is modified on a node, 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. This is the end of the article on "how to manage and maintain RHCS clusters". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to manage and maintain RHCS clusters". If you want to learn more, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.