1、HP MC /ServicesGuaid A11。16版本安装手册 文档版本 v1。4 作者: ********************************************************************************************************************** HP的MC软件是一个使用的比较广泛的CLUSTER成熟版本,以LICENSE核算,IBM的最高,下来就是HP的MC,但是下来的SUN的CLUSTER数量只相当于HP的七分之一. 做双机热备的时候需要提前准备: 准备工作 A-1:编辑/.r
2、hosts ,MC/ServiceGuard将使用/.rhosts 文件验证2机之间的信任关系. A-1-1命令 vi /。rhosts (oracle 用户需在安装oracle后 加入) 示列: hp1 root hp2 root 验证双方关系是否成立 在HP1号机上 rlogin hp2 A-1—2 分发 /.rhosts到所有群集结点 rcp /。rhosts hp2:/.rhosts A-2 在所有节点上编辑 /etc/nsswitch.conf 文件,确保有下面一行. A—2—1命令 vi /etc/nsswitch。co
3、nf hosts: files [NOTFOUND=continue] dns A—2-2分发 /etc/nsswitch.conf 到所有群集节点 rcp /etc/nsswitch。conf hp2 /etc/nsswitch.conf A-3在所有节点上编辑 /etc/hosts 文件,解析所有节点的IP和name。 A-3-1命令 vi /etc/hosts 注意:在安腾的操作系统,要非常规范的写hosts文件,(主机的IP地址,主机名) 10.0.0.1 hp1 10.0.0.2 hp2 (注意:本处建议不要将心跳地址、浮动I
4、P地址写入) 2:在HP主机上安装MC的步骤 首先,必须根据HP对所安装的软件提供的License(Customer Identifier) 在 http://上申请该软件的Codeword。 然后,将光盘(光盘的驱动是/dev/dsk/c3t2d0)放入驱动器中,MOUNT以后,在超级用户提示符下执行 # swinstall –s /dev/dsk/c3t2d0 (如果未建立CD-ROM文件系统 则 mkdir /cdrom Ioscan –funCdisk Issf -e 找到对应硬件路径 Mount /dev/dsk/c3t2d0 /cdrom
5、 (假设当前为c3t2d0) 用ls 命令查看CDROM里面的文件 cd cdrom ls 进入交互式界面后,先加Codeword,才能在列表见到需安装的软件。最后,按其提示完成该软件的安装。需要注意,两台机器需要不同的密码.(MC的补丁请根据机型及HP—UX OS的版本进行选择) 3:网络准备 关于网络的准备,一定要仔细,有图纸,IP规划,对应的机器主板结构示意图,如果网络有蹊跷,最好不要做MC 。 IP的网段要隔绝好,不要出现局域网有重名的IP地址. 推荐使用HP的三大底层法宝命令 #lanscan 看主机的底层物理状况,是否UP,(注意这个命令无法看到
6、IP层) #netstat –in 看IP地址绑定是否正确 #nslookup hp1 看自己可不可以解析自己 在配置机上的操作 1、 在HP1(配置机)创建卷组、缩盘 2、 强调:做这个前要先复制/etc/lvmtab文件, cp /etc/lvmtab /etc/lvmtab。old 在HP2(非配置机)上一样先备份 lvmtab fstab 请注意:在存储上的共享卷组是不需要加入到fstab。如果ORALCE建立在数据库服务器上的,其/oracle . /backup(如果有)应该在fstab。 A:在主机hp1上创建卷组vgdata 和vglock
7、 # mkdir /dev/vglock # mkdir /dev/vgdata1 # mkdir /dev/vgdata2 # ls -l /dev/*/group ( 查看group文件 确定使用 0x010000中的X数值) # mknod /dev/vglock/group c 64 0x0A0000 # mknod /dev/vgdata/group c 64 0x0B0000 # mknod /dev/vgdata/group c 64 0x0C0000 2、格式化硬盘: #pvcreate /dev/rdsk/c5t0d
8、0 创建VG #vgcreate /dev/vglock /dev/dsk/c5t0d0 #vgcreate –e 65534 –s 16 /dev/vgdata /dev/dsk/c5t0d1 #vgcreate –e 65534 –s 16 /dev/vgdata2 /dev/dsk/c5t1d1 3、在主机hnyb01上执行,创建逻辑卷。(如数据库建立在裸设备则不需要) #对于VGLOCK卷组来说, 我们一般不建议在VGLOCK 锁盘上划分卷组 # lvcreate –L 300000 –n oradata1 –s 16 /dev/vgdata1
9、划分名字问oradata1大小为300000MB,属于VGDATA1的卷) # lvcreate –L 300000 –n oradata2 –s 16 /dev/vgdata2 (划分名字问oradata2,大小为300000MB,属于VGDATA2的卷) 4、创建文件系统 (如数据库建立在裸设备则不需要) # newfs –F vxfs –o largefiles /dev/vgdata1/roradata (如果系统有超过2GB的文件 需要加—o的参数,一般用于装ORACLE数据的卷 才加本参数) 请注意 newfs命令一般用于RAW设备,请在前面加r # newfs
10、 –F vxfs /dev/vgdata2/roralog1 5、挂载文件系统到目录 (如数据库建立在裸设备则不需要) # cd/ # mkdir /oradata # mkdir /oralog1 # mount /dev/vgdata1/oradata /oradata # mount /dev/vgdata2/oralog1 /oralog1 自动MOUNT 文件目录 # vi /etc/fstab 加入 磁阵上所划的卷 # mount –a 挂起所有/etc/fstab 下的所有卷 # mount –v 显示所有的已经mount上的设备(或者用
11、bdf查看) 6、关闭vg属性(请关闭所有除开与VG00相关的卷组) 在hp1上去激活卷组: # umount /oradata # umount /oralog1 # vgchange -a n /dev/vglock # vgchange -a n /dev/vgdata1 # vgchange —a n /dev/vgdata2 7、将主机hp1号的vg信息导出 # vgexport –p –s –m /tmp/vgdata.map /dev/vgdata1 # vgexport –p –s –m /tmp/vglock.map /dev/vgda
12、ta2 # vgexport –p –s –m /tmp/vglock.map /dev/vglock 8、在HP1(配置机)上将VG信息文件复制到HP2(非配置机)上 在hp1号机将文件复制到hp2上: # rcp /tmp/vgdata1.map hnyb01:/tmp/vgdata1。map # rcp /tmp/vglock。map hnyb01:/tmp/vglock。map # rcp /tmp/vgdata2。map hnyb01:/tmp/vgdata2。map 在非配置机上的操作 9、在HP2(非配置机)建立文件目录 在主机hp2上创建g
13、roup文件 # mkdir /dev/vglock # mkdir /dev/vgdata1 # mkdir /dev/vgdata2 # ls /dev/*/group ( 查看group文件 确定使用 0x0F0000中的X数值) # mknod /dev/vglock/group c 64 0x010000 # mknod /dev/vgdata1/group c 64 0x020000 # mknod /dev/vgdata2/group c 64 0x020000 这两个命令使用的0x0A0000,0x0B0000一定要和主机hny01要严格
14、符合,否则会有错误。 10、在HP2(非配置机)上将VG信息导入 将映射文件导入卷组数据,在HP2上输入: # vgimport –s —v –m /tmp/vgdata1。map /dev/vgdata1 # vgimport –s –v —m /tmp/vglock.map /dev/vglock # vgimport –s —v –m /tmp/vgdata2。map /dev/vgdata2 注意:hp2上的cXtYdz可能会和hp1上的不同,检查一下,确保整个集群中physical volume names是正确的。例如: #vgimport–s –v -m /
15、tmp/vgdata.map /dev/vgdata /dev/dsk/c1t2d0 (假设vgdata在磁阵上对应的PV名c1t2d0) 请注意:本处可能也不需要本步 11、在HP2(非配置机)上将VG激活(请不要激活除开锁磁盘以外的数据VG) # vgchange -a y /dev/vglock 12、在HP2(非配置机)上建立mount点、文件系统等 创建mount目录点 # mkdir /oradata # mkdir /oralog1 Mount文件系统以检查正确性 # mount /dev/vgdata1/oradata /oradata
16、 mount /dev/vgdata2/oralog1 /oralog1 # mount –a 挂起所有/etc/fstab 下的所有卷 # mount –v 显示所有的已经mount上的设备(或者用bdf查看) 13、备份VG信息(可选择不要) # vgcfgbackup /dev/vgdata1 # vgcfgbackup /dev/vglock # vgcfgbackup /dev/vgdata2 14、UMOUNT文件系统 # umount /oradata # umount /oralog1 ===================下面红色
17、标记的不是太安全============= 15、改变VG的控制属性(锁磁盘不加了) #chmod 777 /dev/vgdata1 #chmod 777 /dev/vgdata2 17、改变卷组的控制属性(数据lv) chmod 660 /dev/vgdata1/roradata chmod 660 /dev/vgdata2/roralog1 可以参见实际系统: 18、改变卷组的用户使用者(一般在ORACLE安装完毕后使用,目前不用) chown oracle:oracle /dev/vgdata1/roradata chown oracle:orac
18、le /dev/vgdata2/roralog1 19、对卷组属性的更改 编辑/etc/lvmrc文件,保证在系统启动时不自动激活与CLUSTER有关的卷组(将AUTO_VG_ACTIVATE置为0,并确认root卷组包含在custom_vg_activation函数内.实际上,Vg00自动处于激活状态),这些卷组将在应用包的control。sh脚本中激活。实际上只需要更改AUTO_VG_ACTIVATE=0 20、在HP1上去激活所有卷组(请关闭所有除开VG00以外的VG) # vgchange -a n /dev/vglock # vgchange -a n /dev/vgd
19、ata1 # vgchange -a n /dev/vgdata2 到这里,我们所有的准备工作已经做完了;开始正式配置MC.请保证2套机器上的VGDATA VGLOCK都处于非激活状态. A。系统级别的MC配置 A-1: 指定群集节点和生成群集配置模版文件并改动模版文件 # cmquerycl –v –C /etc/cmcluster/cmclconf。ascii –n hp1–n hp2 注意:有时候系统的CLUSTER里面主机不止两个,要在—n跟上各个主机的名字. 两个主机版本不同,密码不同有时候会有问题 生成文件后,用vi改动,粽色表示需要人工干预的参数
20、 #vi /etc/cmcluster/cmclconf。ascii 脚本 # ************************************************************************************* # ********* HIGH AVAILABILITY CLUSTER CONFIGURATION FILE # # ***** For complete details about cluster parameters and how to # # ***** set them, consu
21、lt the Serviceguard manual。 # # ************************************************************************************ # # Enter a name for this cluster. This name will be used to identify the # cluster when viewing or manipulating it。 CLUSTER_NAME cluster1 (
22、集群名字) # Cluster Lock Parameters # The cluster lock is used as a tie—breaker for situations # in which a running cluster fails, and then two equal-sized # sub-clusters are both trying to form a new cluster。 The # cluster lock may be configured using only one of the # following alternatives
23、 on a cluster: # the LVM lock disk # the quorom server # # # Consider the following when configuring a cluster. # For a two—node cluster, you must use a cluster lock。 For # a cluster of three or four nodes, a cluster lock is strongly # recommended. For a cluster of more t
24、han four nodes, a # cluster lock is recommended. If you decide to configure # a lock for a cluster of more than four nodes, it must be # a quorum server。 # Lock Disk Parameters。 Use the FIRST_CLUSTER_LOCK_VG and # FIRST_CLUSTER_LOCK_PV parameters to define a lock disk。 # The FIRST_CLUSTER_
25、LOCK_VG is the LVM volume group that # holds the cluster lock. This volume group should not be # used by any other cluster as a cluster lock device. # Quorum Server Parameters。 Use the QS_HOST, QS_POLLING_INTERVAL, # and QS_TIMEOUT_EXTENSION parameters to define a quorum server。 # The QS_HOST
26、 is the host name or IP address of the system # that is running the quorum server process. The # QS_POLLING_INTERVAL (microseconds) is the interval at which # Serviceguard checks to make sure the quorum server is running。 # The optional QS_TIMEOUT_EXTENSION (microseconds) is used to increase #
27、 the time interval after which the quorum server is marked DOWN. # # The default quorum server timeout is calculated from the # Serviceguard cluster parameters, including NODE_TIMEOUT and # HEARTBEAT_INTERVAL。 If you are experiencing quorum server # timeouts, you can adjust these parameters, o
28、r you can include # the QS_TIMEOUT_EXTENSION parameter. # # The value of QS_TIMEOUT_EXTENSION will directly effect the amount # of time it takes for cluster reformation in the event of failure. # For example, if QS_TIMEOUT_EXTENSION is set to 10 seconds, the cluster # reformation will take 10
29、seconds longer than if the QS_TIMEOUT_EXTENSION # was set to 0。 This delay applies even if there is no delay in # contacting the Quorum Server. The recommended value for # QS_TIMEOUT_EXTENSION is 0, which is used as the default # and the maximum supported value is 30000000 (5 minutes). # # Fo
30、r example, to configure a quorum server running on node # "qshost” with 120 seconds for the QS_POLLING_INTERVAL and to # add 2 seconds to the system assigned value for the quorum server # timeout, enter: # # QS_HOST qshost # QS_POLLING_INTERVAL 120000000 # QS_TIMEOUT_EXTENSION 2000000 FIRS
31、T_CLUSTER_LOCK_VG /dev/vglock(锁盘VG) # Definition of nodes in the cluster。 # Repeat node definitions as necessary for additional nodes。 # NODE_NAME is the specified nodename in the cluster. # It must match the hostname and both cannot contain full domain name. # Each NETWORK_INTERF
32、ACE, if configured with IPv4 address, # must have ONLY one IPv4 address entry with it which could # be either HEARTBEAT_IP or STATIONARY_IP。 # Each NETWORK_INTERFACE, if configured with IPv6 address(es) # can have multiple IPv6 address entries(up to a maximum of 2, # only one IPv6 address entry
33、 belonging to site-local scope # and only one belonging to global scope) which must be all # STATIONARY_IP。 They cannot be HEARTBEAT_IP. NODE_NAME hp1 (1号机名字) NETWORK_INTERFACE lan0 (心跳网卡) HEARTBEAT_IP 192.168.0.1(心跳IP地址,请注意,请改成HEARTBEAT_IP) NETWORK_INTERFAC
34、E lan2 (业务网卡) HEARTBEAT_IP 10。157.166。1(1号机业务用IP地址) NETWORK_INTERFACE lan3(不需要配置) FIRST_CLUSTER_LOCK_PV /dev/dsk/c8t0d0 (LOCK VG 物理地址) # List of serial device file names # For example: # SERIAL_DEVICE_FILE /dev/tty0p0 # Warning: There are no standby network interface
35、s for lan0. # Possible standby Network Interfaces for lan2: lan3. NODE_NAME hp2 (2号机名字) NETWORK_INTERFACE lan0 (心跳网卡) HEARTBEAT_IP 192.168.0.2 (心跳IP地址,请注意,请改成HEARTBEAT_IP) NETWORK_INTERFACE lan2 (业务网卡) HEARTBEAT_IP 10.157.166。2 (1号机业务用IP地址)
36、NETWORK_INTERFACE lan3(不需要配置) FIRST_CLUSTER_LOCK_PV /dev/dsk/c8t0d0 (LOCK VG 物理地址) #注意:物理路径要符合,不要把vgdb和vglock两个vg的物理地址混淆 # List of serial device file names # For example: # SERIAL_DEVICE_FILE /dev/tty0p0 # Warning: There are no standby network interfaces for lan0. # Possible standby
37、 Network Interfaces for lan2: lan3。 # Cluster Timing Parameters (microseconds)。 # The NODE_TIMEOUT parameter defaults to 2000000 (2 seconds)。 # This default setting yields the fastest cluster reformations。 # However, the use of the default value increases the potential # for spurious refo
38、rmations due to momentary system hangs or # network load spikes。 # For a significant portion of installations, a setting of # 5000000 to 8000000 (5 to 8 seconds) is more appropriate. # The maximum value recommended for NODE_TIMEOUT is 30000000 # (30 seconds)。 HEARTBEAT_INTERVAL
39、1000000 NODE_TIMEOUT 2000000 #注意:节点轮询时间和超时设置,一般不动,毫秒为单位 # Configuration/Reconfiguration Timing Parameters (microseconds). AUTO_START_TIMEOUT 600000000 NETWORK_POLLING_INTERVAL 2000000 #注意:网络启动时间,失败时候的顺序,一般不动, 毫秒为单位 # Network Monitor Configuration Parameters
40、 # The NETWORK_FAILURE_DETECTION parameter determines how LAN card failures are d etected. # If set to INONLY_OR_INOUT, a LAN card will be considered down when its inbound # message count stops increasing or when both inbound and outbound # message counts stop increasing. # If set to INOUT, b
41、oth the inbound and outbound message counts must # stop increasing before the card is considered down。 NETWORK_FAILURE_DETECTION INOUT # Package Configuration Parameters。 # Enter the maximum number of packages which will be configured in the cluster. # You can not add packages b
42、eyond this limit. # This parameter is required。 MAX_CONFIGURED_PACKAGES 3 注意:MC里面需要预留几个程序包,有的环境是2个,3个,多个程序包多会耗费一定的内存 如果程序包只预留了一个,以后要加程序包,这个参数不可逆,所以要重新做MC生成模版 # Access Control Policy Parameters。 # # Three entries set the access control policy for the cluster: # First line must be
43、USER_NAME, second USER_HOST, and third USER_ROLE。 # Enter a value after each. # # 1. USER_NAME can either be ANY_USER, or a maximum of # 8 login names from the /etc/passwd file on user host。 # 2. USER_HOST is where the user can issue Serviceguard commands. # If using Serviceguard Manager
44、 it is the COM server。 # Choose one of these three values: ANY_SERVICEGUARD_NODE, or # (any) CLUSTER_MEMBER_NODE, or a specific node。 For node, # use the official hostname from domain name server, and not # an IP addresses or fully qualified name. # 3. USER_ROLE must be one of thes
45、e three values: # * MONITOR: read—only capabilities for the cluster and packages # * PACKAGE_ADMIN: MONITOR, plus administrative commands for packages # in the cluster # * FULL_ADMIN: MONITOR and PACKAGE_ADMIN plus the administrative # commands for the cluster。 # # Access c
46、ontrol policy does not set a role for configuration # capability. To configure, a user must log on to one of the # cluster’s nodes as root (UID=0). Access control # policy cannot limit root users' access。 # # MONITOR and FULL_ADMIN can only be set in the cluster configuration file, # and they
47、apply to the entire cluster。 PACKAGE_ADMIN can be set in the # cluster or a package configuration file。 If set in the cluster # configuration file, PACKAGE_ADMIN applies to all configured packages. # If set in a package configuration file, PACKAGE_ADMIN applies to that # package only。 # # Conf
48、licting or redundant policies will cause an error while applying # the configuration, and stop the process. The maximum number of access # policies that can be configured in the cluster is 200。 # # Example: to configure a role for user john from node noir to # administer a cluster and all its p
49、ackages, enter: # USER_NAME john # USER_HOST noir # USER_ROLE FULL_ADMIN # List of cluster aware LVM Volume Groups. These volume groups will # be used by package applications via the vgchange —a e command。 # Neither CVM or VxVM Disk Groups should be used here. # For example: # VOLUME_GROUP /dev/vgdatabase # VOLUME_GROUP /dev/vg02 VOLUME_GROUP /dev/vglock 与集群有关的VG请全部列出 VOLUME_GROUP /dev/vgdata1 VOLUME_GROUP /dev/vgdata2 1-2: 验正群集配置 # cmcheckconf –k –v –C /etc/cmcluster/cmclconf.ascii 如果没有报错信息,






