# 本文爲該系列第一部分,描述AIX 6.1實施HACMP 6.1.
# 第二部分: AIX 6.1安裝Oracle 11gR2
# 第三部分: AIX 6.1 Cloning an Oracle Home
# 第四部分: Oracle手工建庫&Oracle Net配置及Oracle雙機切換測試
環境簡介
OS: AIX 6106-SP8
HACMP: 6.1
HACMP: 6.1
Oracle: 11.2.0.3
A機:
HOSTNAME: hacmp1
永久IP: 192.168.128.99
B機:
HOSTNAME: hacmp2
永久IP: 192.168.128.100
1. 安裝必需的操作系統軟件包
bos.adt
bos.net
bos.rte.odm
bos.data
bos.cifs_fs
bos.clvm
rsct.basic
rsct.compat
rsct.core
rsct.opt
# smit安裝即可
2. 安裝操作系統補丁
# smit安裝即可
3. 安裝HACMP軟件
# smit安裝即可
# cluster.hativoli這個不用裝
4. 安裝HACMP補丁
# smit安裝即可
5. 檢查HACMP安裝
# lppchk -c cluster*
6. 重啓操作系統
# 安裝完成後重啓集羣中的每個節點,然後檢查在所有的集羣節點上是否可以啓動集羣通信守護進程clcomdES
# shutdown -Fr
7. 啓動集羣通信守護進程
# shutdown -Fr
7. 啓動集羣通信守護進程
# startsrc -s clcomdES
0513-059 The clcomdES Subsystem has been started. Subsystem PID is 10027126.
# l***c -g cluster
Subsystem Group PID Status
clstrmgrES cluster 6619382 active
#
二. 共享存儲配置
HACMP的共享存儲主要有兩個用途: 存儲數據和心跳檢測
首先是數據存儲配置部分:
1. A機創建數據卷組datavg
smit mkvg
Add an Original Volume Group
VOLUME GROUP name [datavg]
Physical partition SIZE in megabytes 128
PHYSICAL VOLUME names [hdisk3]
Force the creation of a volume group? yes
Activate volume group AUTOMATICALLY no
at system restart?
Volume Group MAJOR NUMBER []
Create VG Concurrent Capable? no
2. A機創建文件系統/oradata
smit crfs
Add an Enhanced Journaled File System
Add an Enhanced Journaled File System
Volume group name datavg
SIZE of file system
Unit Size Gigabytes
Number of units [28]
MOUNT POINT [/oradata]
Mount AUTOMATICALLY at system restart? no
PERMISSIONS read/write
Mount OPTIONS []
Block Size (bytes) 4096
Logical Volume for Log
Inline Log size (MBytes) []
Extended Attribute Format
ENABLE Quota Management? no
Enable EFS? no
Allow internal snapshots? no
Mount GROUP []
3. A機掛載文件系統/oradata
# mount /oradata
4. A機禁止數據卷組datavg自動掛載
# chvg -a n datavg
5. A機卸載文件系統/oradata
# umount /oradata
6. A機冷卻數據卷組datavg
# varyoffvg datavg
7. A機查看數據卷組major
# ls -l /dev/datavg
crw-rw---- 1 root system 41, 0 Jun 22 22:55 /dev/datavg
#
8. B機導入數據卷組datavg
# importvg -y datavg -V 41 hdisk3
datavg
#
9. B機掛載文件系統/oradata
# mount /oradata
10. B機禁止數據卷組datavg自動掛載
# chvg -a n datavg
11. B機卸載文件系統/oradata
# umount /oradata
12. B機冷卻數據卷組datavg
# varyoffvg datavg
接着是心跳磁盤配置部分:
1. A機創建心跳卷組heartvg
smit mkvg
Add an Original Volume Group
VOLUME GROUP name [heartvg]
Physical partition SIZE in megabytes 128
PHYSICAL VOLUME names [hdisk7]
Force the creation of a volume group? yes
Activate volume group AUTOMATICALLY no
at system restart?
Volume Group MAJOR NUMBER []
Create VG Concurrent Capable? enhanced concurrent
2. A機查看心跳卷組major
# ls -l /dev/heartvg
crw-rw---- 1 root system 42, 0 Jun 22 23:08 /dev/heartvg
#
3. B機導入心跳卷組
# importvg -y heartvg -V 42 hdisk7
synclvodm: No logical volumes in volume group heartvg.
heartvg
0516-783 importvg: This imported volume group is concurrent capable.
Therefore, the volume group must be varied on manually.
#
4. B機禁止心跳卷組自動掛載
# varyonvg heartvg
# chvg -a n heartvg
# varyoffvg heartvg
# 自此HACMP共享存儲就配置完成了
三. 配置HACMP
1. 編輯/etc/hosts添加IP標籤(A機和B機均需操作)
10.10.0.1 hacmp1_boot
10.10.0.2 hacmp2_boot
192.168.3.1 hacmp1_std
192.168.3.2 hacmp2_std
192.168.128.99 hacmp1_per hacmp1
192.168.128.100 hacmp2_per hacmp2
192.168.128.103 hacmp_svc
2. 創建應用服務器啓停腳本(A機和B機均需操作)
# touch start.sh stop.sh;chmod u+x start.sh stop.sh
3. 定義HACMP集羣(此步開始如無特別說明均在A機操作)
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure an HACMP Cluster
Add/Change/Show an HACMP Cluster
Cluster Name [oraha]
4. 添加節點
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Nodes
Add a Node to the HACMP Cluster
Node Name [hacmp1]
Communication Path to Node [hacmp1_boot]
# 以同樣的方式添加另一個節點
Node Name [hacmp2]
Communication Path to Node [hacmp2_boot]
5. 定義IP網絡
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Networks
Add a Network to the HACMP Cluster
ether
Network Name [net_ether_01]
Network Type ether
Netmask(IPv4)/Prefix Length(IPv6) [255.255.252.0]
Enable IP Address Takeover via IP Aliases [Yes]
IP Address Offset for Heartbeating over IP Aliases []
6. 定義非IP網絡
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Networks
Add a Network to the HACMP ClusterExtended Configuration
Extended Topology Configuration
Configure HACMP Networks
diskhb
Network Name [net_diskhb_01]
Network Type diskhb
7. 添加通訊接口
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication Interfaces/Devices
Add Communication Interfaces/Devices
Add Pre-defined Communication Interfaces and Devices
Communication Interfaces
net_ether_01
IP Label/Address [hacmp1_boot]
Network Type ether
Network Name net_ether_01
Node Name [hacmp1]
Network Interface []
# 以同樣的方式添加剩餘的通訊接口
IP Label/Address [hacmp2_boot]
Network Type ether
Network Name net_ether_01
Node Name [hacmp2]
Network Interface []
IP Label/Address [hacmp1_std]
Network Type ether
Network Name net_ether_01
Node Name [hacmp1]
Network Interface []
IP Label/Address [hacmp2_std]
Network Type ether
Network Name net_ether_01
Node Name [hacmp2]
Network Interface []
8. 添加通訊設備
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication Interfaces/Devices
Add Communication Interfaces/Devices
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication Interfaces/Devices
Add Communication Interfaces/Devices
Add Pre-defined Communication Interfaces and Devices
Communication Devices
net_diskhb_01
Device Name [hacmp1_heartdisk]
Network Type diskhb
Network Name net_diskhb_01
Device Path [/dev/hdisk7]
Node Name [hacmp1]
# 以同樣方式添加剩餘的通訊設備
Device Name [hacmp2_heartdisk]
Network Type diskhb
Network Name net_diskhb_01
Device Path [/dev/hdisk7]
Node Name [hacmp2]
9. 添加永久IP
smit hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Persistent Node IP Label/Addresses
Add a Persistent Node IP Label/Address
hacmp1
Node Name hacmp1
Network Name [net_ether_01]
Node IP Label/Address [hacmp1_per]
Netmask(IPv4)/Prefix Length(IPv6) []
# 以同樣的方式添加另一個
hacmp2
Node Name hacmp2
Network Name [net_ether_01]
Node IP Label/Address [hacmp2_per]
Netmask(IPv4)/Prefix Length(IPv6) []
10. 配置應用服務器
smit hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resources Configuration
Configure HACMP Applications Servers
Configure HACMP Application Servers
Add an Application Server
Server Name [ora]
Start Script [/start.sh]
Stop Script [/stop.sh]
Application Monitor Name(s)
11. 配置Service IP
Extended Configuration
Extended Resource Configuration
HACMP Extended Resources Configuration
Configure HACMP Applications Servers
Configure HACMP Application Servers
Add an Application Server
Server Name [ora]
Start Script [/start.sh]
Stop Script [/stop.sh]
Application Monitor Name(s)
11. 配置Service IP
smit hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resources Configuration
Configure HACMP Service IP Labels/Addresses
Add a Service IP Label/Address
Configurable on Multiple Nodes
net_ether_01 (192.168.0.0/22 10.10.0.0/22)
IP Label/Address hacmp_svc
Netmask(IPv4)/Prefix Length(IPv6) []
Network Name net_ether_01
Alternate Hardware Address to accompany IP Label/A []
ddress
12. 配置資源組
smit hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resource Group Configuration
Add a Resource Group
Resource Group Name [rg]
Participating Nodes (Default Node Priority) [hacmp1 hacmp2]
Startup Policy Online On Home Node Only
Fallover Policy Fallover To Next Priority Node In The List
Fallback Policy Never Fallback
13. 更改資源組屬性
smit hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resource Group Configuration
Change/Show Resources and Attributes for a Resource Group
rg
Resource Group Name rg
Participating Nodes (Default Node Priority) hacmp1 hacmp2
Startup Policy Online On Home Node Only
Fallover Policy Fallover To Next Priority Node In The List
Fallback Policy Never Fallback
Service IP Labels/Addresses [hacmp_svc]
Application Servers [ora]
Volume Groups [datavg]
Use forced varyon of volume groups, if necessary false
Automatically Import Volume Groups false
Filesystems (empty is ALL for VGs specified) []
Filesystems Consistency Check fsck
Filesystems Recovery Method sequential
Filesystems mounted before IP configured false
Filesystems/Directories to Export (NFSv2/3) []
Filesystems/Directories to Export (NFSv4) []
Stable Storage Path (NFSv4) []
Filesystems/Directories to NFS Mount []
Network For NFS Mount []
Tape Resources []
Raw Disk PVIDs []
Fast Connect Services []
Communication Links []
Primary Workload Manager Class []
Secondary Workload Manager Class []
Miscellaneous Data []
WPAR Name []
SVC PPRC Replicated Resources []
EMC SRDF(R) Replicated Resources []
四. 同步集羣節點
smit hacmp
Extended Configuration
Extended Verification and Synchronization
Verify, Synchronize or Both [Both]
Automatically correct errors found during [No]
verification?
Force synchronization if verification fails? [No]
Verify changes only? [No]
Logging [Standard]
五. 啓動HACMP
Start now, on system restart or both now
Start Cluster Services on these nodes [hacmp1,hacmp2]
Manage Resource Groups Automatically
BROADCAST message at startup? false
Startup Cluster Information Daemon? false
Ignore verification errors? false
Automatically correct errors found during Interactively
cluster start?
2. A機查看卷組和網絡狀態
# lspv
hdisk0 00c74e1411a46c32 rootvg active
hdisk1 00c74e141179c8e0 rootvg active
hdisk3 00c74e146a3f0996 datavg active
hdisk7 00c74e146a3f3348 heartvg
# ifconfig -a
en0: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
inet 192.168.3.1 netmask 0xfffffc00 broadcast 192.168.3.255
inet 192.168.128.103 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en1: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN>
inet 10.10.0.1 netmask 0xfffffc00 broadcast 10.10.3.255
inet 192.168.128.99 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
#
# datavg已經激活,Service IP也已經生成
六. HACMP切換測試
smit clstop
Stop now, on system restart or both now
Stop Cluster Services on these nodes [hacmp1]
BROADCAST cluster shutdown? true
Select an Action on Resource Groups Move Resource Groups
2. B機查看卷組和網絡狀態
# ifconfig -a
en2: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
inet 192.168.3.2 netmask 0xfffffc00 broadcast 192.168.3.255
inet 192.168.128.100 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en3: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
inet 10.10.0.2 netmask 0xfffffc00 broadcast 10.10.3.255
inet 192.168.128.103 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
# lspv
hdisk0 00c74e149860376d rootvg active
hdisk1 00c74e1412044d23 rootvg active
hdisk3 00c74e146a3f0996 datavg active
hdisk7 00c74e146a3f3348 heartvg
#
# Service IP已經投靠過來了,datavg也已經激活.
hdisk3 00c74e146a3f0996 datavg active
hdisk7 00c74e146a3f3348 heartvg
#
# Service IP已經投靠過來了,datavg也已經激活.
smit clstart
Start now, on system restart or both now
Start Cluster Services on these nodes [hacmp1]
Manage Resource Groups Automatically
BROADCAST message at startup? false
Startup Cluster Information Daemon? false
Ignore verification errors? false
Automatically correct errors found during Interactively
cluster start?
4. 關閉B機上的集羣
smit clstop
Stop now, on system restart or both now
Stop Cluster Services on these nodes [hacmp2]
BROADCAST cluster shutdown? true
Select an Action on Resource Groups Move Resource Groups
5. A機查看卷組和網絡狀態
# ifconfig -a
en0: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
inet 192.168.3.1 netmask 0xfffffc00 broadcast 192.168.3.255
inet 192.168.128.103 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en1: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN>
inet 10.10.0.1 netmask 0xfffffc00 broadcast 10.10.3.255
inet 192.168.128.99 netmask 0xfffffc00 broadcast 192.168.131.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
# lspv
hdisk0 00c74e1411a46c32 rootvg active
hdisk1 00c74e141179c8e0 rootvg active
hdisk3 00c74e146a3f0996 datavg active
hdisk7 00c74e146a3f3348 heartvg
#
# 此時Service IP又飄回A機,卷組也在A機上激活了
6. 開啓B機集羣
smit clstart
Start now, on system restart or both now
Start Cluster Services on these nodes [hacmp2]
Manage Resource Groups Automatically
BROADCAST message at startup? false
Startup Cluster Information Daemon? false
Ignore verification errors? false
Automatically correct errors found during Interactively
cluster start?
# 自此HACMP配置完成
下接第二部分AIX 6.1 + HACMP 6.1 + Oracle 11g雙機實施 (2) --- AIX 6.1安裝Oracle 11gR2