Manage and maintain RHCS clusters

Source: Internet
Author: User
Tags app service

Guide Management and maintenance of RHCS cluster is a very complex and tedious work, to maintain good one RHCS cluster, must be familiar with RHCS basic operating principles, in the cluster management, RHCS provides two ways: Luci graphical interface and command line mode, Here you'll focus on how to manage RHCs clusters under the command line.
Start 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:

[Email protected] ~]# 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]

Cman after the other node successfully started, start the Rgmanager service, the following:

[[Email protected] ~]# service Rgmanager startstarting Cluster service Manager: [OK]
Close RHCs Cluster

Just as opposed to starting the cluster server, the command to close the RHCs cluster is as follows:

[[Email protected] ~]# service Rgmanager stop[[email protected] ~]# service Cman stop

Sometimes when you turn off the Cman service, you may be prompted to fail, and you can check that the shared storage GFS2 file system has been uninstalled or that the Rgmanager service for the other nodes has been shut down properly.

Manage App Services

After the cluster system starts, the app service starts automatically by default, but if an app service does not start automatically, it needs to be started manually. The command to manage app services is CLUSVCADM, which enables you to start, shut down, restart, and switch between application services in the Cluster service.

Start an application

You can start the app service on a node in the following ways to start Wrbserver as an example:

[[Email protected] ~] #clusvcadm-e webserver-m web1member web1 trying to enable service:webserver ... Successservice:webserver is now running on Web1
Close an application

You can turn off app service on a node in the following ways to start MySQLServer as an example:

[[Email protected] ~] #clusvcadm-S mysqlserver-m web1member mysql1 stopping service:mysqlserver ... Success
Restart an application

You can restart the app service on a node in the following ways to start Wrbserver as an example:

[[Email protected] ~] #clusvcadm-R wrbserver-m Web1member web1 trying to restart Service:wrbserver ... Success

This command is executed on the WEB2 node, and the Wrbserver on the WEB1 node can be restarted, so the CLUSVCADM command can be executed on any node of the cluster.

switch an application

You can switch app services on a node in the following ways, for example, on a node web1 service switch to Node WEB2:

[Email protected] ~]# clusvcadm-r wrbserver-m web2trying to relocate service:webserver to web2 ... Successservice:webserver is now running on WEB2
monitor RHCs cluster status

By monitoring the RHCS, it helps to understand the health status of each node in the cluster, identify problems and solve problems in a timely manner. The RHCS cluster provides a rich view of State commands, which mainly introduce the use of Cman_tool, Clustat, Ccs_tool.

cman_tool Command

Cman_tool parameters are more, but the use of the method is relatively simple, here are the two parameters to use:

[[email protected] ~]# 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 shows the node name, along with the corresponding node IP address and time to join the cluster. If you want to learn more about cluster node information, you can use the following command:

[Email protected] ~]# cman_tool   statusversion:6.2.0config version:35  #集群配置文件版本号Cluster name:mycluster   #集群名称Cluster id:56756cluster member:yescluster generation:2764membership state:cluster-membernodes:4   # Number of cluster nodes expected votes:6   #期望的投票数Quorum device votes:2   #表决磁盘投票值Total votes:6   #集群中所有投票值大小Quorum: 4 #集群法定投票值, Below this value, the cluster will stop serving active subsystems:9 flags:dirty Ports bound:0 177  Node name:web1node id:4  #本节点在集群中的ID号Multicast addresses:239.192.221.146 #集群广播地址 Node addresses:192.168.12.230 #本节点对应的IP地址
clustat Command

The Clustat command uses a very simple, detailed use method that can be used to obtain help information through "clustat-h", here are just a few examples.

 [[email protected] ~] #clustat-I 3Cluster Status for mycluster @ Mon 18:54:15 2010Member status:quorate                     Member Name ID Status--------------------WEB2 1 online, Rgmanager Mysql1 2 online, Rgmanager M YSQL2 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 in real time each node in the cluster system and the running state of the service, "-I 3" means to refresh the cluster state every three seconds. In this output, you can see each node is in the "online" state, indicating that each node is running normally, if a node exited the cluster, the corresponding state should be "Offline", but also can see that the cluster of two services are also in the "Started" state, Run on the MYSQL1 node and the Web1 node, respectively. In addition, the "ID" column can be used to know the corresponding relationship between cluster nodes, for example, WEB2 in this cluster is the "Node 1" nodes, in the same vein, web1 corresponding to the "Node 4" nodes. Understanding the sequence of cluster nodes helps to interpret the cluster logs.

ccs_tool Command

Ccs_tool is primarily used to manage cluster profile cluster.conf, Ccs_tool can add/remove nodes in the cluster, add/Remove fence devices, update cluster configuration files, and more. Here are a few application examples of Ccs_tool: When a node finishes modifying a configuration file, you can perform an "Ccs_tool update" instruction to update the configuration file on all nodes, for example:

[Email protected] cluster]# ccs_tool  update/etc/cluster/cluster.confproposed updated config file does not having Grea ter version number.  Current config_version::  proposed config_version:: 35Failed to update config file.

Ccs_tool is based on the "config_version" value in cluster.conf to decide whether to update, so after modifying the cluster.conf file, be sure to cluster.conf The version value is updated so that the configuration file can be updated when Ccs_tool is executed.

[Email protected] cluster]# ccs_tool  update/etc/cluster/cluster.confconfig file updated from version 36Update Complete.

Manage and maintain RHCS clusters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.