Cluster Define

Embed Size (px)

DESCRIPTION

hacmp cluster

Citation preview

  • 6/2/2014 Google Translate

    http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://candon123.blog.51cto.com/704299/933711&prev=/search%3Fq%3Ddefining%2Bpowerha 1/5

    Copyright: original works, declined reproduced! Otherwise it will be held liable.

    PowerHA SystemMirror 7.1 has many new features.In this article, i just show you how to use clmgr

    command to manage PowerHA 7.1.

    A. Installing PowerHA 7.1

    1.Verify following packages on both nodes:

    01. [Dbserv1 @ root] # lslpp-L rsct.basic.rte rsct.compat.basic.hacmp rsct.compat.clients.hacmp bos.adt.lib bos.adt.libm bos.adt.syscalls bos.ahafs bos.clvm. enh bos.cluster bos.data bos.net.tcp.client bos.net.tcp.server bos.rte.SRC bos.rte.libc bos.rte.libcfg bos.rte.libcur bos.rte.libpthreads bos.rte. lvm bos.rte.odm cas.agent

    2.Edit / etc / hosts file:

    01. # For Persistent 02. 192.168.0.129 dbserv1-pers 03. 192.168.0.130 dbserv2-pers 04. # For Boot IP 05. 192.168.1.130 dbserv2-boot 06. 192.168.1.129 dbserv1-boot 07. # For Node 08. 10.20.144.129 dbserv1 09. 10.20.144.130 dbserv2 10. # For Service 11. 10.20.144.251 oracle 12. 10.20.144.252 db2

    3.Installing PowerHA 7.1 file sets on both nodes:

    01. [Root @ dbserv1 /] # loopmount-i PowerHA_v7.1.iso-o "-V cdrfs-o ro"-m / mnt 02. [Root @ dbserv1 /] # installp-aXYg-d / mnt all

    4.Adding boot and persistent ip to / etc / cluster / rhosts file on both nodes:

    In PowerHA 7.1, the / usr / es / sbin / cluster / etc / rhosts file replaced by / etc / cluster /

    rhosts file.

    01. [Dbserv1 @ root] # cat / etc / cluster / rhosts 02. 192.168.1.130 03. 192.168.1.129 04. 192.168.0.129 05. 192.168.0.130 06. 10.20.144.129 07. 10.20.144.130

    5.Creating share volume group:

    01. / / On dbserv1 do following steps 02. [Root @ dbserv1 /] # mkvg-V 48-y datavg hdisk2 03. 0516-1254 mkvg: Changing the PVID in the ODM. 04. datavg 05. [Root @ dbserv1 /] # mklv-y lv02-t jfs2 datavg 10G 06. lv02 07. [Root @ dbserv1 /] # crfs-v jfs2-d / dev/lv02-m / oradata 08. [Root @ dbserv1 /] # chvg-c datavg / / change the datavg to Enhanced Concurrent Capable volume

    group when you create volume group by mkvg don't with-c option. 09. [Root @ dbserv1 /] # chvg-an datavg 10. [Root @ dbserv1 /] # varyoffvg datavg 11. [Root @ dbserv1 /] # exportvg datavg 12. / / On dbserv2 import datavg volume group 13. [Root @ dbserv2 /] # importvg-V 48-y datavg hdisk2 14. datavg

  • 6/2/2014 Google Translate

    http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://candon123.blog.51cto.com/704299/933711&prev=/search%3Fq%3Ddefining%2Bpowerha 2/5

    6.Verifying the installed PowerHA filesets consistency on both nodes:

    01. [Dbserv1 @ root] # lppchk-v 02. [Dbserv1 @ root] # lppchk-c cluster *

    Second Creating a cluster:

    1.Create a cluster:

    01. [Dbserv1 @ root] # clmgr add cluster MySysMirror nodes = dbserv1, dbserv2 repositories = hdisk4

    02. Cluster Name: MySysMirror 03. Cluster Connection Authentication Mode: Standard 04. Cluster Message Authentication Mode: None 05. Cluster Message Encryption: None 06. Use Persistent Labels for Communication: No 07. Repository Disk: None 08. Cluster IP Address: 09. There are 2 node (s) and 2 network (s) defined 10. 11. NODE dbserv1: 12. Network net_ether_01 13. dbserv1 10.20.144.129 14. Network net_ether_02 15. dbserv1-boot 192.168.1.129 16. 17. NODE dbserv2: 18. Network net_ether_01 19. dbserv2 10.20.144.130 20. Network net_ether_02 21. dbserv2-boot 192.168.1.130 22. 23. No resource groups defined 24. Initializing .. 25. Gathering cluster information, which may take a few minutes ... 26. Processing ... 27. Storing the following information in file 28. / Usr / es / sbin / cluster / etc / config / clvg_config 29. .................. 30. Cluster Name: MySysMirror 31. Cluster Connection Authentication Mode: Standard 32. Cluster Message Authentication Mode: None 33. Cluster Message Encryption: None 34. Use Persistent Labels for Communication: No 35. Repository Disk: hdisk4 36. Cluster IP Address: 37. There are 2 node (s) and 2 network (s) defined 38. 39. NODE dbserv1: 40. Network net_ether_01 41. dbserv1 10.20.144.129 42. Network net_ether_02 43. dbserv1-boot 192.168.1.129 44. 45. NODE dbserv2: 46. Network net_ether_01 47. dbserv2 10.20.144.130 48. Network net_ether_02 49. dbserv2-boot 192.168.1.130 50. 51. No resource groups defined 52. 53. Warning: There is no cluster found. 54. cllsclstr: No cluster defined. 55. cllsclstr: Error reading configuration. 56. Communication path dbserv1 discovered a new node. Hostname is dbserv1. Adding it to the config

    uration with Nodename dbserv1. 57. Communication path dbserv2 discovered a new node. Hostname is dbserv2. Adding it to the config

    uration with Nodename dbserv2. 58. Discovering IP Network Connectivity

  • 6/2/2014 Google Translate

    http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://candon123.blog.51cto.com/704299/933711&prev=/search%3Fq%3Ddefining%2Bpowerha 3/5

    59. 60. Retrieving data from available cluster nodes. This could take a few minutes. 61. 62. Start data collection on node dbserv1 63. Start data collection on node dbserv2 64. Collector on node dbserv2 completed 65. Collector on node dbserv1 completed 66. Data collection complete 67. Completed 10 percent of the verification checks 68. Completed 20 percent of the verification checks 69. Completed 30 percent of the verification checks 70. Completed 40 percent of the verification checks 71. Completed 50 percent of the verification checks 72. Completed 60 percent of the verification checks 73. Completed 70 percent of the verification checks 74. Discovered [6] interfaces 75. Completed 80 percent of the verification checks 76. Completed 90 percent of the verification checks 77. Completed 100 percent of the verification checks 78. IP Network Discovery completed normally

    The cluster name is MySysMirror and the disk hdisk4 as a repositories disk.The repositories disk

    is a new feature in PowerHA 7.1.

    2.Adding Service IP:

    Here i just use one ip for oracle database, it called oracle.

    01. [Dbserv1 @ root] # clmgr add service_ip oracle NETWORK = net_ether_01 NETMASK = 255 .255.255.0

    3.Adding persistent IP:

    01. [Dbserv1 @ root] # clmgr add persistent_ip dbserv1-pers NETWORK = net_ether_02 NODE = dbserv1

    02. [Dbserv1 @ root] # clmgr add persistent_ip dbserv2-pers NETWORK = net_ether_02 NODE = dbserv2

    4.Adding application_controller:

    01. [Dbserv1 @ root] # clmgr add application_controller oradb STARTSCRIPT = "/ etc / Smydb" STOPSCRIPT = "/ etc / Kmydb"

    5.Adding Resource Group:

    01. [Dbserv1 @ root] # clmgr add resource_group oraRG VOLUME_GROUP = datavg NODES = dbserv1, dbserv2 SERVICE_LABEL = oracle APPLICATIONS = oradb

    02. 03. Auto Discover / Import of Volume Groups was set to true. 04. Gathering cluster information, which may take a few minutes.

    6.Syncing cluster:

    01. [Dbserv1 @ root] # clmgr sync cluster verify = yes fix = yes 02. Saving existing / var / hacmp / clverify / ver_mping / ver_mping.log to / var / hacmp / clveri

    fy / ver_mping / ver_mping.log.bak 03. Verifying clcomd communication, please be patient. 04. 05. Verifying multicast communication with mping. 06. 07. 08. Committing any changes, as required, to all available nodes ... 09. Adding any necessary PowerHA SystemMirror entries to / etc / inittab and / etc / rc.net for IP

    AT on node dbserv1. 10. Adding any necessary PowerHA SystemMirror entries to / etc / inittab and / etc / rc.net for IP

    AT on node dbserv2. 11. 12. Verification has completed normally.

  • 6/2/2014 Google Translate

    http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://candon123.blog.51cto.com/704299/933711&prev=/search%3Fq%3Ddefining%2Bpowerha 4/5

    13. ........................... 14. Remember to redo automatic error notification if configuration has changed. 15. 16. Verification has completed normally.

    7.Starting cluster on both nodes:

    01. [Dbserv1 @ root] # clmgr online cluster start_cluster BROADCAST = false CLINFO = true

    8.Verifying cluster and resource group status:

    01. [Dbserv1 @ root] # clmgr-a state query cluster 02. STATE = "STABLE" 03. [Dbserv2 @ root] # clmgr-a state query cluster 04. STATE = "STABLE"

    01. [Dbserv1 @ root] # clmgr-a state, current_node query rg oraRG 02. STATE = "ONLINE" 03. CURRENT_NODE = "dbserv1"

    9.Switching resource group to another node:

    01. [Dbserv1 @ root] # clmgr move rg oraRG node = dbserv2 02. Attempting to move resource group oraRG to node dbserv2. 03. 04. Waiting for the cluster to process the resource group movement request .... 05. 06. Waiting for the cluster to stabilize ......... 07. 08. Resource group movement successful. 09. Resource group oraRG is online on node dbserv2. 10. 11. 12. Cluster Name: MySysMirror 13. 14. Resource Group Name: oraRG 15. Primary instance (s): 16. The following node temporarily has the highest priority for this instance: 17. dbserv2, user-requested rg_move performed on Tue Jul 17 15:23:11 2012 18. 19. Node State 20. ------------------------------------------- 21. dbserv1 OFFLINE 22. dbserv2 ONLINE

    Three. Testing the PowerHA 7.1 cluster

    Here i just simulation of a group service failure.This scenario consists of a hot-standby cluster

    configuration with participating nodes dbserv1 and dbserv2 with only one Ethernet network. Each

    node has two Ethernet interfaces. I'm going to kill the cthags process in the dbserv2 node that

    was hosting the resource group.

    The resource group current on dbserv2:

    01. [Dbserv1 @ root] # clmgr-a state, current_node query rg oraRG 02. STATE = "ONLINE" 03. CURRENT_NODE = "dbserv2"

    When i killed the cthags service on dbserv2 what will be happen?

    01. [Dbserv2 @ root] # ps-ef | grep cthags 02. root 17629232 2949152 0 15:18:00 - 0:00 / usr / sbin / rsct / bin / hagsd cthags 03. [Dbserv2 @ root] # kill -9 17629232

  • 6/2/2014 Google Translate

    http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://candon123.blog.51cto.com/704299/933711&prev=/search%3Fq%3Ddefining%2Bpowerha 5/5

    After killed cthags service, the dbserv2 will be halt immediately:

    01. Jul 17 16:26:57 dbserv2 daemon: notice cthags [15728736]: (Recorded using libct_ffdc.a cv 2) ::: Error ID: 63Y7ej0F5G/E/kK41v1738 .............. ...... ::: Reference ID :::: Template ID: afa89905 ::: Details File :::: Location: RSCT, pgsd.C, 1.62.1.23,695 ::: GS_START_ST Group Services daemon started DIAGNOSTIC EXPLANATION HAGS daemon started by SRC. Log file is / var/ct/1rA_5YpzyHuO0ZxZ06xeuB/log/cthags/trace.

    02. Jul 17 16:26:57 dbserv2 user: notice PowerHA SystemMirror for AIX: clexit.rc: Unexpected termination of clstrmgrES.

    03. Jul 17 16:26:57 dbserv2 user: notice PowerHA SystemMirror for AIX: clexit.rc: Halting system immediately!!!

    And the resource group oraRG move to dbserv1:

    01. tail-f / var / hacmp / adm / cluster.log 02. Jul 17 16:27:08 dbserv1 user: notice PowerHA SystemMirror for AIX: NOTE: While the sync is goi

    ng on, volume group can be used 03. Jul 17 16:27:09 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT COMPLETED: rg_move db

    serv1 1 ACQUIRE 0 04. Jul 17 16:27:09 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT COMPLETED: rg_move_ac

    quire dbserv1 1 0 05. Jul 17 16:27:09 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT START: rg_move_comple

    te dbserv1 1 06. Jul 17 16:27:09 dbserv1 user: notice PowerHA SystemMirror for AIX: NOTE: While the sync is goi

    ng on, volume group can be used 07. Jul 17 16:27:10 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT START: start_server o

    radb 08. Jul 17 16:27:10 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT COMPLETED: start_serv

    er oradb 0 09. Jul 17 16:27:10 dbserv1 user: notice PowerHA SystemMirror for AIX: EVENT COMPLETED: rg_move_co

    mplete dbserv1 1 0

    01. [Dbserv1 @ root] # clmgr-a state, current_node query rg oraRG 02. STATE = "ONLINE" 03. CURRENT_NODE = "dbserv1"

    For more information:

    1. Using clmgr command to manage PowerHA 7.1

    2. IBM PowerHA SystemMirror 7.1 for AIX

    This article comes from " candon123 "blog, declined reproduced!