Vous êtes sur la page 1sur 8

Command_line ON RHEL 5 cluster config using cli Create cluster.

ccs_tool create <cluster name> ccs_tool create lab_oracle Adding the fence device ccs_tool addfence <fence method> <fence name> <options> ccs_tool addfence apc fence_apc ipaddr=192.168.1.5 user=apc password=apc Adding node to cluster. ccs_tool addnode -v<votevalue> -n<nodeid> -f <fencedevice> nodename ccs_tool addnode -v 1 -n 1 -f apc rhcnode1 ccs_tool addnode -v 1 -n 2 -f apc rhcnode2 scp cluster.conf to another node. ccsd. service cman restart clustat

[root@rhcnode1 ~]# ccs_tool lsnode Cluster name: lab_oracle, config_version: 4 Nodename rhcnode1 rhcnode2 Adding multicast ip ccsd -m <multicast ip> Move a service to another node clusvcadm r -m Stop a service Page 1 Votes Nodeid Fencetype 1 1 apc 1 2 apc

Command_line clusvcadm d Start a service clusvcadm e ======================================================================= To view the cluster status: #clustat To Failover the services from one node to other #clusvcadm -r -m -r = relocate -m=member ex: #clusvcadm -r DEVDB -m host2 in case if the status of the service is Failed, when you try to failover, try this: #clusvcadm -d DEVDB -m host1 # clusvcadm -e DEVDB -m host2 In the above example -d switch will Disable the service on the host1 and will enable it on the host2. -e switch will enable the service. LUCI is the web based tool used to manage the RHCS - Redhat Cluster Service. To freeze the particular service: # clusvcadm -z DEVDB -m host1 To unfreeze the particular service: # clusvcadm -Z DEVDB -m host1 =========================================================================

Checking status of the cluster: # clustat # clustat -m <member> Display status of <member> and exit # clustat -s <service> Display status of <service> and exit # clustat -l Use long format for services Page 2

Command_line # cman_tool status # cman_tool nodes # cman_tool nodes -af # ccs_tool lsnode # ccs_tool lsfence # group_tool # group_tool ls Resource Group Control Commands: clusvcadm -d <group> clusvcadm -e <group> clusvcadm -e <group> -F domain rules clusvcadm -e <group> -m <member> clusvcadm -r <group> -m <member> clusvcadm -R <group> clusvcadm -s <group> Show local record of cluster status Show local record of cluster nodes List nodes List fence devices displays the status of fence, dlm and gfs groups displays the list of groups and their membership Disable <group> Enable <group> Enable <group> according to failover Enable <group> on <member> Relocate <group> to member> Restart a group in place. Stop <group>

Resource Group Locking (for cluster Shutdown / Debugging): clusvcadm -l Lock local resource group manager. This prevents resource groups from starting on the local node. clusvcadm -S Show lock state clusvcadm -Z <group> Freeze group in place clusvcadm -U <group> Unfreeze/thaw group clusvcadm -u Unlock local resource group manager. This allows resource groups to start on the local node. clusvcadm -c <group> Convalesce (repair, fix) resource group. Attempts to start failed, non-critical resources within a resource group. ================================================================================= Cluster configuration system ccs_tool Online management of cluster configuration Update the cluster.conf file across the cluster ccs_tool update /etc/cluster/cluster.conf Cluster Management Page 3

Command_line cman_tool Manage cluster nodes and display the current state of the cluster Display status cman_tool status Fencing tools Eject a node from the cluster fence_node Print fence debug messages fence_tool dump Red Hat Enterprise Linux 5 starting and stopping commands: Starting order: $ $ $ $ $ $ $ service service service service service service service cman start qdiskd start clvmd start gfs start gfs2 start rgmanager start ricci start < < < < < < optional optional optional optional optional optional

Stopping order: $ $ $ $ $ $ $ service service service service service service service ricci stop rgmanager stop gfs2 stop gfs stop clvmd stop qdiskd stop cman stop

http://sourceware.org/cluster/doc/usage.txt================>reference link http://linuxcluster-tdryden.blogspot.in/ ================================ RHEL 5:ports used in RHEL cluster =============================== Typically, only the ports that Cluster Manager (cman), Distributed Lock Manager (dlm), and Cluster Configuration Page 4

Command_line System (ccsd) protocols are needed. High-availability Service Manager(rgmanager) does not use TCP or UDP sockets. ccsd (Cluster Configuration System daemon) UDP Port 50007 TCP Ports 50006, 50008, 50009 cman (Cluster Manager) UDP Ports 5404, 5405 dlm (Distributed Lock Manager) TCP Port 21064 ricci (part of Conga remote agent) TCP Port 11111 modclusterd (part of Conga remote agent) TCP Port 16851 luci (Conga User Interface server) TCP Port 8084 gnbd (Global Network Block Device) TCP Port 14567 igmp (Internet Group Management Protocol)

ON RHEL 6 cluster config using cli =================================== 1. Install the below packages yum install -y openais cman rgmanager lvm2-cluster gfs2-utils ccs 2. Create cluster configuration Syntax : ccs -h <host> --createcluster <clustername> Example : ccs -h server.examlab.com --createcluster testcluster 3. Adding node to cluster Syntax : ccs -h <host> --addnode <node1> Example : ccs -h server.examlab.com --addnode server.examlab.com ccs -h server.examlab.com --addnode server1.examlab.com ccs -h server.examlab.com --addnode server2.examlab.com 4. Creating failover domain Syntax : ccs -h <host> --addfailoverdomanin <name> orderd Page 5

<----node1 <----node2 <----node3

Command_line Example : ccs -h server.examlab.com --addfailoverdomain examlab.com ordered 5. Adding node to failover domain Syntax : ccs -h <host> --addfailoverdomannode <failoverdomain> <node> <priority> Example : ccs -h server.examlab.com --addfailoverdomainnode examlab.com server.examlab.com 1 ccs -h server.examlab.com --addfailoverdomainnode examlab.com server1.examlab.com 2 ccs -h server.examlab.com --addfailoverdomainnode examlab.com server2.examlab.com 3 6 Configuring the Fence Device Syntax : ccs -h <host> --addfencedev <fence-name> agent=<fencegent> <options> Example : ccs -h server.examlab.com --addfencedev server-con.examlab.com agent=fence_ilo ipaddr=192.168.1.23 login=ribadmin passwd=ribamin 7. Configure the Service Syntax : ccs -h <host> --addservice <service name> domain=<failover domain> options Example : ccs -h server.examlab.com --addservice lvmtest domain=examlab.com autostart=1 8. Adding sub services Syntax : ccs -h <host> --addsubservice <service name> <sub service options> Example : ccs -h server.examlab.com --addsubservice lvmtest fs name=data_fs device=/dev/dataVG/lvol01 mountpoint=/data1 fstype=ext4 <------adding file system ccs -h server.examlab.com --addsubservice lvmtest script file="/etc/cluster/ploracm7.cntl" name="ploracm7_script" <------adding script ccs -h server.examlab.com --addsubservice lvmtest ip=192.169.1.222 monitor_link=1 <------adding ip 9. Sync the cluster Syntax : ccs Example : ccs 10 Start and stop Syntax : ccs Example : ccs Syntax Example Syntax Example Syntax Example : : : : : : -h <host> --sync --activate -h server.examlab.com --syncall --activate -h <host> --start -h server.examlab.com --start

ccs -h <host> --stop ccs -h server.examlab.com --stop ccs -h <host> --startall ccs -h server.examlab.com --startall ccs -h <host> --stopall ccs -h server.examlab.com --stopall

11. View the available service options Syntax : ccs -h <host> --lsserviceopts Example : ccs -h server.examlab.com --lsserviceopts Page 6

Command_line Red Hat Enterprise Linux 6 starting and stopping commands: Starting order: $ $ $ $ $ $ service service service service service service cman start clvmd start gfs2 start rgmanager start ricci start luci start < < < < < optional optional optional optional optional

Stopping order: $ $ $ $ $ $ service service service service service service luci stop ricci stop rgmanager stop gfs2 stop clvmd stop cman stop

RHEL 6: Typically, only the ports that Cluster Manager (cman), Cluster Information(ricci) protocols are needed. Distributed Lock Manager (dlm), and Mechanism to Propagate

High-availability Service Manager(rgmanager) does not use TCP or UDP sockets cman (Cluster Manager) UDP Ports 5404, 5405 dlm (Distributed Lock Manager) TCP Port 21064 ricci (part of Conga remote agent) TCP Port 11111 modclusterd (part of Conga remote agent) TCP Port 16851 luci (Conga User Interface server) TCP Port 8084 igmp (Internet Group Management Protocol) Page 7

Command_line

Page 8