HACMP常用命令及要点点播

查看cluster是否启动:
lssrc -g cluster

启动和停止cluster
 #smitty clstart  /smitty clstop
 
 ,查看cluster服务情况
# tail  –f  /var/hacmp/log/hacmp.out

查看ha ip服务情况
#/usr/sbin/cluster/clstat


# netstat –in (查看网络状态信息)

建立共享数据存储区prodvg
#smitty mkvg
然后输入要建立VG 的名字:prodvg,选择硬盘:hdisk4;按回车执行。
#smitty chvg
来改变prodvg 的状态,要把重启系统后自动激活卷组改为NO。
然后再prodvg 上建立逻辑卷和文件系统。
分别用#smitty mklv 和#smitty fs
最后要在这台机器执行:#varyoffvg prodvg 来停止这个共享卷组。
换到另一台机器,用#smitty importvg 来导入这个共享卷组,输入卷组的名字:prodvg ;选
择硬盘:hdisk7(因为在erp 这台机器有多个硬盘,看PVID 号得出hdisk7 是共享的数据盘)
导入prodvg 后,我们在这台机器也要改变VG 的属性。
#smitty chvg
要把重启系统后自动激活卷组改为NO



配置磁盘心跳:

HACMP 5.4磁盘心跳配置过程
Step1:     配置并行卷组
[dbsvr1]#smitty hacmp
 
  Initialization and Standard Configuration
  Extended Configuration
  System Management (C-SPOC)
Problem Determination Tools


  Manage HACMP Services
  HACMP Communication Interface Management
  HACMP Resource Group and Application Management
  HACMP Log Viewing and Management
  HACMP File Collection Management
  HACMP Security and Users Management
  HACMP Logical Volume Management
  HACMP Concurrent Logical Volume Management
  HACMP Physical Volume Management
  Configure GPFS


  Concurrent Volume Groups
  Concurrent Logical Volumes
  Synchronize Concurrent LVM Mirrors


  List All Concurrent Volume Groups
  Create a Concurrent Volume Group
  Create a Concurrent Volume Group with Data Path Devices
  Set Characteristics of a Concurrent Volume Group
  Import a Concurrent Volume Group
  Mirror a Concurrent Volume Group


               Node Names                               
                                                                           
 Move cursor to desired item and press Esc+7.                            
   ONE OR MORE items can be selected.                                  
  Press Enter AFTER making all selections.                                

      >dbsvr1
      >dbsvr2




                        Create a Concurrent Volume Group

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]
  Node Names                                          dbsvr1,dbsvr2
  PVID                                                0003714b1331a3ed
  VOLUME GROUP name                               [heartvg]
  Physical partition SIZE in megabytes                           4                   +
  Volume group MAJOR NUMBER                         [56]                 +#
  Enhanced Concurrent Mode                             true                 +
  Enable Cross-Site LVM Mirroring Verification               false                  +


  Warning:
  Changing the volume group major number may result
  in the command being unable to execute
  successfully on a node that does not have the
  major number currently available. Please check
[MORE...3]

F1=Help             F2=Refresh          F3=Cancel           F4=List
Esc+5=Reset         Esc+6=Command       Esc+7=Edit          Esc+8=Image


[dbsvr1]#lspv
hdisk0          0003714ba5048a99                    rootvg          active
hdisk1          0003714bd3cf768a                    rootvg          active
hdisk2          0003714b7d935335                    datavg          active
hdisk3          0003714b27d6164f                    datavg_1        active
hdisk4          none                                None
hdisk5          0003714b1331a3ed                    heartvg

[dbsvr2]#lspv
hdisk1          000531c9c977a892                    rootvg          active
hdisk2          0003714b7d935335                    datavg
hdisk3          none                                None
hdisk4          none                                None
hdisk0          000531c9a501da2a                    rootvg          active
hdisk5          0003714b1331a3ed                    heartvg

Step2:     编辑环境变量
[dbsvr1]#vi /etc/environment
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/us
r/java14/bin:/usr/sbin/rsct/bin
TZ=BEIST-8
LANG=en_US
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
LC__FASTMSG=true
[dbsvr2]#vi /etc/environment
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/us
r/java14/bin:/usr/sbin/rsct/bin
TZ=BEIST-8
LANG=en_US
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
LC__FASTMSG=true

Step3:     测试并行卷组通讯
[dbsvr1]#dhb_read -p hdisk5 -r
DHB CLASSIC MODE
 First node byte offset: 61440
Second node byte offset: 62976
Handshaking byte offset: 65024
       Test byte offset: 64512

Receive Mode:
Waiting for response . . .
Magic number = 0x87654321
Magic number = 0x87654321
Magic number = 0x87654321
Magic number = 0x87654321
Link operating normally

[dbsvr2]#dhb_read -p hdisk5 -t
DHB CLASSIC MODE
First node byte offset: 61440
Second node byte offset: 62976
Handshaking byte offset: 65024
      Test byte offset: 64512

Transmit Mode:
Magic number = 0x87654321
Detected remote utility in receive mode.  Waiting for response . . .
Magic number = 0x87654321
Magic number = 0x87654321
Link operating normally

Step4:     配置磁盘心跳网络
[dbsvr1]#smitty hacmp
  Initialization and Standard Configuration
  Extended Configuration
  System Management (C-SPOC)
Problem Determination Tools

  Discover HACMP-related Information from Configured Nodes
  Extended Topology Configuration
  Extended Resource Configuration
  Extended Cluster Service Settings
  Extended Event Configuration
  Extended Performance Tuning Parameters Configuration
  Security and Users Configuration
  Snapshot Configuration
  Export Definition File for Online Planning Worksheets

  Configure an HACMP Cluster
  Configure HACMP Nodes
  Configure HACMP Sites
  Configure HACMP Networks
  Configure HACMP Communication Interfaces/Devices
  Configure HACMP Persistent Node IP Label/Addresses
  Configure HACMP Global Networks
  Configure HACMP Network Modules
  Configure Topology Services and Group Services
  Show HACMP Topology

  Add a Network to the HACMP Cluster
  Change/Show a Network in the HACMP Cluster
  Remove a Network from the HACMP Cluster



                            Select a Network Type         
                                                          
   Move cursor to desired item and press Enter.           
                                                          
   [TOP]                                                  
     # Discovery last performed: (Apr 03 15:13)           
     # Discovered IP-based Network Types                  
     ether                                                
                                                          
     # Discovered Serial Device Types                     
     rs232                                                
                                                          
     # Pre-defined IP-based Network Types                 
     XD_data                                              
     XD_ip                                                
     atm                                                  
     ether                                                
     fddi                                                 
     hps                                                  
     ib                                                   
     token                                                
                                                          
     # Pre-defined Serial Device Types                    
     XD_rs232                                             
     diskhb                                               


                  Add a Serial Network to the HACMP Cluster

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* Network Name                                       [net_diskhb_01]
* Network Type                                       diskhb


  Configure an HACMP Cluster
  Configure HACMP Nodes
  Configure HACMP Sites
  Configure HACMP Networks
  Configure HACMP Communication Interfaces/Devices
  Configure HACMP Persistent Node IP Label/Addresses
  Configure HACMP Global Networks
  Configure HACMP Network Modules
  Configure Topology Services and Group Services
  Configure HACMP Networks

                            Select a category         
                                                      
 Move cursor to desired item and press Enter.         
                                                      
   Add Discovered Communication Interface and Devices 
   Add Pre-defined Communication Interface and Devices 


Communication Interfaces
Communication devices

                         Select a Device Network    
                                                    
 Move cursor to desired item and press Enter.       
                                                    
   net_diskhb_01                                    


* Device Name                                        [heartdbsvr1]
* Network Type                                        diskhb
* Network Name                                        net_diskhb_01
* Device Path                                        [/dev/hdisk5]
*Node name                                            [dbsvr1]

* Device Name                                        [heartdbsvr2]
* Network Type                                        diskhb
* Network Name                                        net_diskhb_01
* Device Path                                        [/dev/hdisk5]
*Node name                                            [dbsvr2]

Step5:     检查集群网络结构
  Show Cluster Topology
  Show Cluster Definition
  Show Topology Information by Node
  Show Topology Information by Network
  Show Topology Information by Communication Interface


Cluster Name: gyjt                                                                  
Cluster Connection Authentication Mode: Standard                                    
Cluster Message Authentication Mode: None                                           
Cluster Message Encryption: None                                                    
Use Persistent Labels for Communication: No                                         
                                                                                    
NODE dbsvr1:                                                                        
                heartdbsvr1     /dev/hdisk5                                         
                dbsvr1_svc      158.1.1.126                                         
                dbsvr1_boot     158.1.1.127                                         
                dbsvr1_stb      192.168.1.1                                         
        Network net_diskhb_01                                                       
                heartdbsvr1     /dev/hdisk5                                         
        Network net_ether_01                                                        
                dbsvr1_stb      192.168.1.1                                         
        Network net_rs232_01                                                        
                dbsvr1_tty0     /dev/tty0                                           
                                                                                    
                                                                                    
NODE dbsvr2:                                                                        
                heartdbsvr2     /dev/hdisk5                                         
                dbsvr2_svc      158.1.1.124                                         
                dbsvr2_boot     158.1.1.125                                         
                dbsvr2_stb      192.168.1.3                                         
       Network net_diskhb_01                                                        
                heartdbsvr2     /dev/hdisk5                                         
        Network net_ether_01                                                        
                dbsvr2_stb      192.168.1.3                                         
        Network net_rs232_01                                                        
                dbsvr2_tty0     /dev/tty0                                           
                                                                                    

Step6:     同步集群配置
                                                                                    
                             Extended Configuration                                 
                                                                                    
Move cursor to desired item and press Enter.                                        
                                                                                    
  Discover HACMP-related Information from Configured Nodes                          
  Extended Topology Configuration                                                   
  Extended Resource Configuration                                                   
  Extended Cluster Service Settings                                                 
  Extended Event Configuration                                                      
  Extended Performance Tuning Parameters Configuration                              
  Security and Users Configuration                                                  
  Snapshot Configuration                                                            
  Export Definition File for Online Planning Worksheets                             
                                                                                    
  Extended Verification and Synchronization                                         
  HACMP Cluster Test Tool                            





查看心跳:
#lssrc –ls topsvcs

用于心跳的进程:
# ps -ef|grep nim

更改心跳相关的参数:
  Extended Configuration----àExtended Topology Configuration----à
Configure HACMP Network Modules----à
Change a Network Module using Predefined Values
分别选择ether,diskhb,rs232



串口做心跳:
Smitty tty
选择“Add a TTY”

lsdev –Cc tty 查看新增串口,会有如下显示:
tty0 Available 00-00-S3-00 Asynchronous Terminal


串口测试:


1.    
   

主机A
   

stty
2.    
   

主机B
   

stty
这时在两台主机的命令行下会有内容的显示,否则,tty配置失败。示例如下:

speed 9600 baud; -parity hupcl

eol2 = ^?

brkint -inpck -istrip icrnl -ixany ixoff onlcr tab3

echo echoe echok

3.    
   

主机A
   

cat /etc/hosts > /dev/tty0

4.    
   

主机B
   

cat < /dev/tty0

这时在主机2的命令行下有主机1的/etc/hosts文件的内容,否则,tty配置失败。

完成串口测试




配置HACMP (以下我们以主机A作为主机,B作为备用机)


(cluster name-cluster node-discover 发现-HACMP networks-添加HACMP IP地址或hacmp communication interfaces/deves 接口和串口设备-hacmp persistent NODE ip label/address 添加现有节点的IP及标识,地址。)HACMP的配置都是在一台主机上做配置,作完之后,只需要同步另外一台主机即可。节点名两台主机要分别添加。

详细配置

<1>配置CLUSTER NAME 及节点;分别将NODE加入CLUSTER集群中,然后在发现一下。

Communication path to node 这一步选择通过发现方式来选择node对应的主机(boot1/boot2),分两次来完成,不同的node来对应不同的主机

<2>给HACMP添加IP网络

Smit/smitty hacmp—Extended Topology Configuration--&gtConfigure HACMP Networks->Add a Network to the HACMP cluster

选择ETHERNET,添加IP网络(该信息都是自动获取无需修改任何参数设置,只需要修改最后一项,选择YES OR NO)

其中Enable IP Takeover via IP Aliases项,如果SVC IP地址与boot1地址在同一网段,则选择“NO”,反之选择“YES

<3>添加非IP网络,即串口心跳网络

Extended Configuration>Extended Topology Configuration>

Configure HACMP Networks>Add a Network to the HACMP Cluster

选择RS232,添加串口心跳。(自动获取网络名和类型)

<4>添加IP地址(HACMP IP地址和串口地址)即网络接口和,心跳或磁盘设备

Extended Configuratin>Extended Topology Configuration>

Configure HACMP Communication interfaces/Devices(HACMP通信接口或串口设备配置)

>Add Communication interfaces/Devices

添加串口设备IP地址

Extended Configuratin>Extended Topology Configuration>

Configure HACMP Communication interfaces/Devices(HACMP通信接口或串口设备配置)

>Add Communication interfaces/Devices

Device Name 自己自定义名称。如:hisser1_tty0

Device path 一般都是:/dev/tty0

Node name 选择主机A作为NODE A,如图就是hisser1

 

<5>添加对外IP 也就是服务IP即:server(添加资源组之前必须先添加服务IP,否则资源组就无法和SERVER IP绑定在一起)

Extended Configuration>Extended Resource Configuration>

HACMP Extended Resources Configuration>Configure HACMP server IP

Labels /Addresses >Add a Service IP Label/Address



#查看HACMP拓扑结构
/usr/es/sbin/cluster/utilities/cltopinfo
/usr/es/sbin/cluster/utilities/cltopinfo -c
/usr/es/sbin/cluster/utilities/cltopinfo -n
/usr/es/sbin/cluster/utilities/cltopinfo -i

#查看HACMP状态
/usr/es/sbin/cluster/utilities/clshowsrv -v

添加pv到concurrent vg中
smitty hacmp->
System Management (C-SPOC)->
HACMP Concurrent Logical Volume Management->
Concurrent Volume Groups->
Set Characteristics of a Concurrent Volume Group->
Add a Volume to a Concurrent Volume Group->
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-759747/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/27042095/viewspace-759747/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值