Monday, March 26, 2012

Adding / Removing Node in RedHat Cluster

Deleting a Node to a Cluster
To delete a node from the  cluster, perform the following steps:
At any node, use the clusvcadm utility to relocate, migrate, or stop each HA service running on the node that is being deleted from the cluster.  With it you can perform the following operations:
Enable and start a service. clusvcadm -e <service_name>
Disable a service. clusvcadm -d <service_name>
Stop a service. clusvcadm -s <service_name>
Freeze a service clusvcadm -Z <service_name>
Unfreeze a service clusvcadm -U <service_name>
Migrate a service (for virtual machine services only)
Relocate a service. clusvcadm -r <service_name> -m <member>
Restart a service. clusvcadm -R <service_name>
At the node to be deleted from the cluster, stop the cluster software.
To stop the cluster software on a node, type the following commands in this order:
service rgmanager stop, if you using high-availability (HA) services (rgmanager).
service gfs2 stop, if you are using Red Hat GFS2
umount -at gfs2, if you are using Red Hat GFS2 in conjunction with rgmanager, to ensure that any GFS2 files mounted during rgmanager startup (but not unmounted during shutdown) were also unmounted.
service clvmd stop, if CLVM has been used to create clustered volumes
service cman stop
At any node in the cluster, edit the /etc/cluster/cluster.conf to remove the clusternode section of the node that is to be deleted. For example, “Three-node Cluster Configuration”, if node-03.example.com is supposed to be removed, then delete the clusternode section for that node. If removing a node (or nodes) causes the cluster to be a two-node cluster, you can add the following line to the configuration file to allow a single node to maintain quorum (for example, if one node fails):
<cman two_node="1" expected_votes="1"/>
Update the config_version attribute by incrementing its value (for example, changing from config_version="2" to config_version="3">).
Save /etc/cluster/cluster.conf.
(Optional) Validate the updated file against the cluster schema (cluster.rng) by running the ccs_config_validate command. For example:
[root@example-01 ~]# ccs_config_validate
Configuration validates
Run the cman_tool version -r command to propagate the configuration to the rest of the cluster nodes.
Verify that the updated configuration file has been propagated.
If the node count of the cluster has transitioned from greater than two nodes to two nodes, you must restart the cluster software as follows:
At each node, stop the cluster software
[root@example-01 ~]# service rgmanager stop
[root@example-01 ~]# service gfs2 stop
[root@example-01 ~]# service clvmd stop
[root@example-01 ~]# service cman stop
At each node, start the cluster software
[root@example-01 ~]# service cman start
[root@example-01 ~]# service clvmd start
[root@example-01 ~]# service gfs2 start
[root@example-01 ~]# service rgmanager start
At any cluster node, run cman_tool nodes to verify that the nodes are functioning as members in the cluster (signified as "M" in the status column, "Sts"). For example:
[root@example-01 ~]# cman_tool nodes
Node Sts Inc Joined Name
1 M 548 2010-09-28 10:52:21 node-01.example.com
2 M 548 2010-09-28 10:52:21 node-02.example.com

At any node, using the clustat utility, verify that the HA services are running as expected. In addition, clustat displays status of the cluster nodes. For example:
[root@example-01 ~]#clustat
Cluster Status for mycluster @ Wed Nov 17 05:40:00 2010
Member Status: Quorate
Member Name ID Status
------ ---- ---- ------
node-02.example.com 2 Online, rgmanager
node-01.example.com 1 Online, Local, rgmanager
Service Name Owner (Last) State
------- ---- ----- ------ -----
service:example_apache node-01.example.com started
service:example_apache2 (none) disabled


==================================================================

Adding a Node to a Cluster

Prerequisite Steps for Adding Cluster Nodes
Complete the following steps to prepare nodes to add to the cluster:
Make physical connections.
Connect the nodes' hardware to the network infrastructure of your cluster. This includes establishing electrical connections, configuring network interconnects, configuring shared disk subsystem connections, and so on.
Install the operating system.
Install a cloned image of the operating system that matches the operating system on the other nodes in your cluster. This includes installing required service patches, updates, and drivers.
Ensure that SSH is configured on the node.
Verify the hardware and operating system installations with the Cluster Verification Utility (CVU).
After you configure the hardware and operating systems on the nodes you want to add, you can run the following commands to verify that the nodes you want to add are reachable by other nodes in the cluster. You can also use this command to verify user equivalence to all given nodes the local node, node connectivity among all of the given nodes, accessibility to shared storage from all of the given nodes, and so on.
After completing these steps, you are ready to add the nodes to the cluster.
Adding a node to a cluster consists of updating the cluster configuration, propagating the updated configuration to the node to be added, and starting the cluster software on that node. To add a node to a cluster, perform the following steps:
At any node in the cluster, edit the /etc/cluster/cluster.conf to add a clusternode section for the node that is to be added. For example “Two-node Cluster Configuration”, if node-03.example.com is supposed to be added, then add a clusternode section for that node. If adding a node (or nodes) causes the cluster to transition from a two-node cluster to a cluster with three or more nodes, remove the following cman attributes from /etc/cluster/cluster.conf:
cman two_node="1"
expected_votes="1"
Update the config_version attribute by incrementing its value (for example, changing from config_version="2" to config_version="3">).
Save /etc/cluster/cluster.conf.
(Optional) Validate the updated file against the cluster schema (cluster.rng) by running the ccs_config_validate command. For example:
[root@example-01 ~]# ccs_config_validate
Configuration validates
Run the cman_tool version -r command to propagate the configuration to the rest of the cluster nodes.
Verify that the updated configuration file has been propagated.
Propagate the updated configuration file to /etc/cluster/ in each node to be added to the cluster. For example, use the scp command to send the updated configuration file to each node to be added to the cluster.
If the node count of the cluster has transitioned from two nodes to greater than two nodes, you must restart the cluster software in the existing cluster nodes as follows:
At each node, stop the cluster software according
[root@example-01 ~]# service rgmanager stop
[root@example-01 ~]# service gfs2 stop
[root@example-01 ~]# service clvmd stop
[root@example-01 ~]# service cman stop
At each node, start the cluster software according to Section 8.1.1, “Starting Cluster Software”. For example:
[root@example-01 ~]# service cman start
[root@example-01 ~]# service clvmd start
[root@example-01 ~]# service gfs2 start
[root@example-01 ~]# service rgmanager start
At any node, using the clustat utility, verify that each added node is running and part of the cluster. For example:
[root@example-01 ~]#clustat
Cluster Status for mycluster @ Wed Nov 17 05:40:00 2010
Member Status: Quorate

Member Name ID Status
------ ---- ---- ------
node-03.example.com 3 Online, rgmanager
node-02.example.com 2 Online, rgmanager
node-01.example.com 1 Online, Local, rgmanager

Service Name Owner (Last) State
------- ---- ----- ------ -----
service:example_apache node-01.example.com started
service:example_apache2 (none) disabled
For information about using clustat, refer to Section 8.3, “Managing High-Availability Services”.
In addition, you can use cman_tool status to verify node votes, node count, and quorum count. For example:
[root@example-01 ~]#cman_tool status
Version: 6.2.0
Config Version: 19
Cluster Name: mycluster
Cluster Id: 3794
Cluster Member: Yes
Cluster Generation: 548
Membership state: Cluster-Member
Nodes: 3
Expected votes: 3
Total votes: 3
Node votes: 1
Quorum: 2
Active subsystems: 9
Flags:
Ports Bound: 0 11 177
Node name: node-01.example.com
Node ID: 3
Multicast addresses: 239.192.14.224
Node addresses: 10.15.90.58


DISCLAIMER: The information provided on this website comes without warranty of any kind and is distributed AS IS. Every effort has been made to provide the information as accurate as possible, but no warranty or fitness is implied. The information may be incomplete, may contain errors or may have become out of date. The use of this information described herein is your responsibility, and to use it in your own environments do so at your own risk.


Copyright © 2012 LINUXHOWTO.IN

.

1 comment: