免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3344 | 回复: 0
打印 上一主题 下一主题

单节点配置MC/ServiceGuard [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-27 20:47 |只看该作者 |倒序浏览
    作者:陈求文
    E-mail:
crystal.chen.cc@gmail.com
    MSN:
cqwlyh@263.net

    按照以下方法,将可以在一个节点上(也就是一台主机上)配置MC/ServiceGuard。这个实验的成功,说明了MC/ServiceGuard配置所需要的最小环境,其实不是两台主机,而是仅仅只需要台安装了MC/ServiceGuard的主机,和一块网卡。

    1. 收集主机名
        #hostname
        rx1600

    2. 查看/etc/hosts文件
        #more /etc/hosts
        以下为/etc/hosts文件的内容:
        # @(#)B11.23_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $
        #
        # The form for each entry is:
        #      
        #
        # For example:
        # 192.1.2.34    hpfcrm  loghost
        #
        # See the hosts(4) manual page for more information.
        # Note: The entries cannot be preceded by a space.
        #       The format described in this file is the correct format.
        #       The original Berkeley manual page contains an error in
        #       the format description.
        #
        192.168.0.8     rx1600
        127.0.0.1       localhost       loopback

    3. 备份/etc/hosts文件,并且将备份文件的权限和所有者/组修改为和原文件/etc/hosts一样
        #cp /etc/hosts /etc/hosts.20060227
        #chown root:root /etc/hosts.20060227
        然后查看一下:
        #ls -l /etc/hosts*
        -rw-r--r--   1 root       root           504 Feb 24 20:42 hosts
        -rw-r--r--   1 root       root           504 Feb 27 14:03 hosts.20060227

    4. 修改/etc/hosts文件,将其中127.0.0.1这一行注释掉(就是最前面加一个#号)

    5. 和上面两步差不多,备份/etc/lvmrc文件,并修改AUTO_VG_ACTIVATE=0
        #cp /etc/lvmrc /etc/lvmrc.20060227
        #chown bin:bin /etc/lvmrc.20060227
        #ls -l /etc/lvmrc*
        -rw-rw-r--   1 bin        bin           1490 Feb 27 13:55 /etc/lvmrc
        -rw-rw-r--   1 bin        bin           1423 Feb 27 13:53 /etc/lvmrc.20060227
        然后修改/etc/lvmrc文件,并且将修改AUTO_VG_ACTIVATE=1为AUTO_VG_ACTIVATE=0,意思是,除了vg00以外,其他的vg要靠MC启动的时候才激活,而不是操作系统启动的时候激活。

    6. 创建和修改.rhosts文件
        在根目录/下创建.rhosts文件
        #touch .rhosts
        修改该文件的权限为644
        #chmod 644 .rhosts
        使用vi编辑器为该文件添加内容如下:
        rx1600    root

    7. 生成cmcluster.ascii文件
        #cmquerycl -v -C /etc/cmcluster/cmcluster.ascii -n rx1600
        相应的生成过程如下:
        Begin checking the nodes...
        Warning: Unable to determine local domain name for rx1600
        Looking for other clusters ... Done
        Gathering configuration information ..
        Gathering storage information ..
        Found 7 devices on node rx1600
        Analysis of 7 devices should take approximately 2 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Found 1 volume groups on node rx1600
        Analysis of 1 volume groups should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        .....
        Gathering Network Configuration ...... Done
        Note: Disks were discovered which are not in use by either LVM or VxVM.
              Use pvcreate(1M) to initialize a disk for LVM or,
              use vxdiskadm(1M) to initialize a disk for VxVM.
        
        Node Names:    rx1600         
        
        Bridged networks (local node information only - full probing was not performed):
        
        1       lan0           (rx1600)
        
        IP subnets:
        
        IPv4:
        
        192.168.0.0        lan0      (rx1600)
        
        IPv6:
        
        Possible Heartbeat IPs:
        
        192.168.0.0                       192.168.0.8         (rx1600)
        
        Possible Cluster Lock Devices:
        
        /dev/dsk/c2t0d0s2  /dev/vg00            66 seconds
        
        LVM volume groups:
        
        /dev/vg00               rx1600         
        
        LVM physical volumes:
        
        /dev/vg00         
        /dev/dsk/c2t0d0s2  0/1/1/0.0.0                   rx1600            
        
        LVM logical volumes:
        
        Volume groups on rx1600:
        /dev/vg00/lvol1                           FS MOUNTED   /stand
        /dev/vg00/lvol2                                       
        /dev/vg00/lvol3                           FS MOUNTED   /
        /dev/vg00/lvol4                           FS MOUNTED   /home
        /dev/vg00/lvol5                           FS MOUNTED   /opt
        /dev/vg00/lvol6                           FS MOUNTED   /tmp
        /dev/vg00/lvol7                           FS MOUNTED   /
        /dev/vg00/lvol8                           FS MOUNTED   /var
        Warning: Failed to find a configuration that satisfies the minimum network configuration requirements.
        Minimum network configuration requirements are:
         - 2 or more heartbeat networks OR
         - 1 heartbeat network with local switch (HP-UX Only) OR
         - 1 heartbeat network using APA with 2 trunk members (HP-UX Only) OR
         - 1 heartbeat network with serial line (HP-UX Only) OR
         - 1 heartbeat network using bonding (mode 1) with 2 slaves (Linux Only)
        
        Writing cluster data to /etc/cmcluster/cmcluster.ascii.

    8. 根据自己的实际配置和需要,修改cmcluster.ascii文件
        这次仅仅只是一个测试而已,因此按照最简便的方法来进行修改如下:
        # **********************************************************************
        # ********* HIGH AVAILABILITY CLUSTER CONFIGURATION FILE ***************
        # ***** For complete details about cluster parameters and how to *******
        # ***** set them, consult 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
        
        
        # 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 us
        # following alternatives 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 than four nodes, a
        # cluster lock is recommended.  If
        # 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_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 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
        # 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, or you can include
        # the QS_TIMEOUT_EXTENSION parameter.
        #
        # The value of QS_TIMEOUT_EXTENSION
        # 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 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).
        #
        # For 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
        
        
        
        # Definition of nodes in the cluste
        # 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 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               rx1600
          NETWORK_INTERFACE     lan0
            HEARTBEAT_IP        192.168.0.8
        # List of serial device file names
        # For example:
        # SERIAL_DEVICE_FILE    /dev/tty0p0
        
        # Warning: There are no standby network interfaces for lan0.
        
        
        # 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 reformations 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              1000000
        NODE_TIMEOUT            2000000
        
        
        # Configuration/Reconfiguration Timing Parameters (microseconds).
        
        AUTO_START_TIMEOUT      600000000
        NETWORK_POLLING_INTERVAL        2000000
        
        # Network Monitor Configuration Parameters.
        # The NETWORK_FAILURE_DETECTION parameter determines how LAN card failures are detected.
        # 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, both 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 beyond this limit.
        # This parameter is required.
        MAX_CONFIGURED_PACKAGES         5
        
        
        # Access Control Policy Parameters.
        #
        # Three entries set the access control policy for the cluster:
        # First line must be 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, 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 these 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 control 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 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
        # If set in a package configuration file, PACKAGE_ADMIN applies to that
        # package only.
        #
        # Conflicting or redundant policies will cause an error while applying
        # the configuration, and stop the p
        # 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 packages, enter:
        # USER_NAME  john
        # USER_HOST  noir
        # USER_ROLE  FULL_ADMIN
        
        
        # List of cluster aware LVM Volume
        # 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

    9. 然后检查修改的cmcluster.ascii文件是否符合要求
        #cmcheckconf -v -C /etc/cmcluster/cmcluster.ascii
        检查的结果如下:
        Checking cluster file: /etc/cmcluster/cmcluster.ascii
        Note : a NODE_TIMEOUT value of 2000000 was found in line 109. For a
        significant portion of installations, a higher setting is more appropriate.
        Refer to the comments in the cluster configuration ascii file or Serviceguard
        manual for more information on this parameter.
        Checking nodes ... Done
        Checking existing configuration ... Done
        Warning: Unable to get configuration for cluster cluster1.
        Gathering configuration information ... Done
        Gathering configuration information ..
        Gathering storage information ..
        Found 1 devices on node rx1600
        Analysis of 1 devices should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Found 1 volume groups on node rx1600
        Analysis of 1 volume groups should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        .....
        Gathering Network Configuration ........ Done
        Checking for inconsistencies .. Done
        Maximum configured packages parameter is 5.
        Configuring 0 package(s).
        5 package(s) can be added to this cluster.
        200 access policies can be added to this cluster.
        Creating the cluster configuration for cluster cluster1.
        Adding node rx1600 to cluster cluster1.
        
        Verification completed with no errors found.
        Use the cmapplyconf command to apply the configuration.

        Verification completed with no errors found.这句话表明其配置文件没有任何错误,如果有错误产生,检查会有提示,并且可以根据提示和相应的日志文件来检查错误产生的原因。

    10. 编译配置文件
        #cmapplyconf -v -C /etc/cmcluster/cmcluster.ascii
        编译的过程和结果如下:
        Checking cluster file: /etc/cmcluster/cmcluster.ascii
        Note : a NODE_TIMEOUT value of 2000000 was found in line 109. For a
        significant portion of installations, a higher setting is more appropriate.
        Refer to the comments in the cluster configuration ascii file or Serviceguard
        manual for more information on this parameter.
        Checking nodes ... Done
        Checking existing configuration ... Done
        Warning: Unable to get configuration for cluster cluster1.
        Gathering configuration information ... Done
        Gathering configuration information ..
        Gathering storage information ..
        Found 1 devices on node rx1600
        Analysis of 1 devices should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Found 1 volume groups on node rx1600
        Analysis of 1 volume groups should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        .....
        Gathering Network Configuration ........ Done
        Checking for inconsistencies .. Done
        Maximum configured packages parameter is 5.
        Configuring 0 package(s).
        5 package(s) can be added to this cluster.
        200 access policies can be added to this cluster.
        Marking/unmarking volume groups for use in the cluster
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Creating the cluster configuration for cluster cluster1.
        Adding node rx1600 to cluster cluster1.
        Completed the cluster creation.

    11. 检查运行状态
        #cmviewcl
        CLUSTER      STATUS      
        cluster1     down         
        
          NODE         STATUS       STATE        
          rx1600       down         unknown

    12. 生成包配置和控制文件
        #cmmakepkg -p /etc/cmcluster/pkg/pkg_ora/pkg_ora.config
        #cmmakepkg -s /etc/cmcluster/pkg/pkg_ora/pkg_ora.script

    13. 修改pkg_ora.config
        根据自己的需求,修改此配置文件。此次的修改后的结果如下:
        # **********************************************************************
        # ****** HIGH AVAILABILITY PACKAGE CONFIGURATION FILE (template) *******
        # **********************************************************************
        # ******* Note: This file MUST be edited before it can be used. ********
        # * For complete details about package parameters and how to set them, *
        # * consult the Serviceguard Extension for RAC manuals.
        # **********************************************************************
        
        # Enter a name for this package.  This name will be used to identify the
        # package when viewing or manipulating it.  It must be different from
        # the other configured package names.
        
        PACKAGE_NAME                    pkg_ora
        
        # Enter the package type for this package. PACKAGE_TYPE indicates
        # whether this package is to run as a FAILOVER or SYSTEM_MULTI_NODE
        # package.
        #
        #    FAILOVER     package runs on one node at a time and if a failure
        #                 occurs it can switch to an alternate node.
        #
        #    SYSTEM_MULTI_NODE
        #                 package runs on multiple nodes at the same time.
        #                 It can not be started and halted on individual nodes.
        #                 Both NODE_FAIL_FAST_ENABLED and AUTO_RUN must be set
        #                 to YES for this type of package. All SERVICES must
        #                 have SERVICE_FAIL_FAST_ENABLED set to YES.
        #
        # NOTE: Packages which have a PACKAGE_TYPE of SYSTEM_MULTI_NODE are
        #       not failover packages and should only be used for applications
        #       provided by Hewlett-Packard.
        #
        #       Since SYSTEM_MULTI_NODE packages run on multiple nodes at
        #       one time, following parameters are ignored:
        #
        #          FAILOVER_POLICY
        #          FAILBACK_POLICY
        #
        #       Since an IP address can not be assigned to more than node at a
        #       time, relocatable IP addresses can not be assigned in the
        #       package control script for multiple node packages. If
        #       volume groups are assigned to multiple node packages they must
        #       activated in a shared mode and data integrity is left to the
        #       application. Shared access requires a shared volume manager.
        #
        #
        # Examples : PACKAGE_TYPE   FAILOVER (default)
        #            PACKAGE_TYPE   SYSTEM_MULTI_NODE
        #
        
        PACKAGE_TYPE                    FAILOVER
        
        
        # Enter the failover policy for this package. This policy will be used
        # to select an adoptive nod
        # The default policy unless otherwise specified is CONFIGURED_NODE.
        # This policy will select nodes in priority order from the list of
        # NODE_NAME entries specified below.
        #
        # The alternative policy is MIN_PACKAGE_NODE. This policy will select
        # the node, from the list of NODE_NAME entries below, which is
        # running the least number of packages at the time this package needs
        # to start.
        
        FAILOVER_POLICY                 CONFIGURED_NODE
        
        
        # Enter the failback policy for this package. This policy will be used
        # to determine what action to take when a package is not running on
        # its primary node and its primary node is capable of running the
        # package. The default policy unless otherwise specified is MANUAL.
        # The MANUAL policy means no attempt will be made to move the package
        # back to its primary node when it is running on an adoptive node.
        #
        # The alternative policy is
        # move the package back to its primary node whenever the primary node
        # is capable of running the package.
        
        FAILBACK_POLICY                 MANUAL
        
        
        # Enter the names of the nodes configured for this package.  Repeat
        # this line as necessary for additional adoptive nodes.
        #
        # NOTE:   The order is relevant.
        #         Put the second Adoptive Node after the first one.
        #
        # Example : NODE_NAME  original_node
        #           NODE_NAME  adoptive_node
        #
        # If all nodes in the cluster are to be specified and order is not
        # important, "NODE_NAME *" may be specified.
        #
        # Example : NODE_NAME  *
        
        
        
        # Enter the value for AUTO_RUN. Possible values are YES and NO.
        # The default for AUTO_RUN is YES. When the cluster is started the
        # package will be automatically started. In the event of a failure the
        # package will be started on an adoptive node. Adjust as necessary.
        #
        # AUTO_RUN replaces obsolete PKG_SWITCHING_ENABLED.
        
        AUTO_RUN                        YES
        
        
        # Enter the value for LOCAL_LAN_FAILOVER_ALLOWED.
        # Possible values are YES and NO.
        # The default for LOCAL_LAN_FAILOVER_ALLOWED is YES.  In the event of a
        # failure, this permits the cluster software to switch LANs locally
        # (transfer to a standby LAN card).  Adjust as necessary.
        #
        # LOCAL_LAN_FAILOVER_ALLOWED replaces obsolete NET_SWITCHING_ENABLED.
        
        LOCAL_LAN_FAILOVER_ALLOWED      YES
        
        
        # Enter the value for NODE_
        
        
        # Enter the complete path for the run and halt scripts.  In most cases
        # the run script and halt script specified here will be the same script,
        # the package control script generated by the cmmakepkg command.  This
        # control script handles the run(ning) and halt(ing) of the package.
        # Enter the timeout, specified in seconds, for the run and halt scripts.
        # If the script has not completed by the specified timeout value,
        # it will be terminated.  The default for each script timeout is
        # NO_TIMEOUT.  Adjust the timeouts as necessary to permit full
        # execution of each script.
        # Note: The HALT_SCRIPT_TIMEOUT should be greater than the sum of
        # all SERVICE_HALT_TIMEOUT values specified for all services.
        
        RUN_SCRIPT              /etc/cmcluster/pkg/pkg_ora/pkg_ora.script      
        RUN_SCRIPT_TIMEOUT              NO_TIMEOUT
        HALT_SCRIPT             /etc/cmcluster/pkg/pkg_ora/pkg_ora.script      
        HALT_SCRIPT_TIMEOUT             NO_TIMEOUT
        
        
        # Enter the names of the storage groups configured for this package.
        # Repeat this line as necessary for additional storage groups.
        #
        # By specifying a CVM disk group with the STORAGE_GROUP keyword
        # this package will not run until the VxVM-CVM-pkg package is
        # running and thus the CVM shared disk groups are ready for
        # activation.
        #
        # NOTE: Should only be used by applications provided by
        #       Hewlett-Packard.
        #
        # Example : STORAGE_GROUP  dg01
        #           STORAGE_GROUP  dg02
        #           STORAGE_GROUP  dg03
        #           STORAGE_GROUP  dg04
        #
        
        
        # Enter the SERVICE_NAME, the SERVICE_FAIL_FAST_ENABLED and the
        # SERVICE_HALT_TIMEOUT values for this package.  Repeat these  
        # three lines as necessary for additional service names.  All  
        # service names MUST correspond to the SERVICE_NAME[] entries in
        # the package control script.
        #
        # The value for SERVICE_FAIL_FAST_ENABLED can be either YES or
        # NO.  If set to YES, in th
        # cluster software will halt the node on which the service is  
        # running.  If SERVICE_FAIL_FAST_ENABLED is not specified, the
        # default will be NO.
        #
        # SERVICE_HALT_TIMEOUT is r
        # halt before a SIGKILL signal is sent to force the termination
        # of the service.  In the event of a service halt, the cluster
        # software will first send a SIGTERM signal to terminate the   
        # service.  If the service does not halt, after waiting for the
        # specified SERVICE_HALT_TIMEOUT, the cluster software will send
        # out the SIGKILL signal to the service to force its termination.
        # This timeout value should be large enough to allow all cleanup
        # processes associated with the service to complete.  If the   
        # SERVICE_HALT_TIMEOUT is not specified, a zero timeout will be
        # assumed, meaning the cluster software will not wait at all   
        # before sending the SIGKILL signal to halt the service.      
        #
        # Example: SERVICE_NAME                   DB_SERVICE           
        #          SERVICE_FAIL_FAST_ENABLED      NO                  
        #          SERVICE_HALT_TIMEOUT           300                  
        #
        # To configure a service, uncomment the following lines and   
        # fill in the values for all of the keywords.                  
        #
        #SERVICE_NAME                                    
        #SERVICE_FAIL_FAST_ENABLED                             
        #SERVICE_HALT_TIMEOUT                       
        SERVICE_NAME               
        SERVICE_FAIL_FAST_ENABLED      NO                     
        SERVICE_HALT_TIMEOUT           300         
        
        
        # Enter the network subnet
        # Repeat this line as necessary for additional subnet names.  If any of
        # the subnets defined goes down, the package will be switched to another
        # node that is configured for this package and has all the defined subnets
        # available.
        # The subnet names could be
        # names that are to be monitored for this package could be a mix
        # of IPv4 or IPv6 subnet names
        
        #SUBNET                 
        SUBNET                  192
        
        
        # The keywords RESOURCE_NAME, RESOURCE_POLLING_INTERVAL,               
        # RESOURCE_START, and RESOURCE_UP_VALUE are used to specify Package   
        # Resource Dependencies.  To define a package Resource Dependency, a   
        # RESOURCE_NAME line with a fully qualified resource path name, and   
        # one or more RESOURCE_UP_VALUE lines are required.  The               
        # RESOURCE_POLLING_INTERVAL and the RESOURCE_START are optional.      
        #
        # The RESOURCE_POLLING_INTERVAL indicates how often, in seconds, the   
        # resource is to be monitored.  It will be defaulted to 60 seconds if  
        # RESOURCE_POLLING_INTERVAL is not specified.                          
        #
        # The RESOURCE_START option can be set to either AUTOMATIC or DEFERRED.
        # The default setting for R
        # is specified, Serviceguard will start up resource monitoring for     
        # these AUTOMATIC resources automatically when the node starts up.     
        # If DEFERRED is selected, Serviceguard will not attempt to start      
        # resource monitoring for these resources during node start up.  User  
        # should specify all the DE
        # so that these DEFERRED resources will be started up from the package
        # run script during package run time.                                 
        #                                                                     
        # RESOURCE_UP_VALUE requires an operator and a value.  This defines   
        # the resource 'UP' condition.  The operators are =, !=, >, =,     
        # and  or >= may be used
        # for the first operator, a
        # For example,
        #                                       Resource is up when its value is
        #                                       --------------------------------
        #       RESOURCE_UP_VALUE     = 5               5                   (threshold)
        #       RESOURCE_UP_VALUE  
        #       RESOURCE_UP_VALUE     > -5 and
        #RESOURCE_POLLING_INTERVAL  
        #RESOURCE_START            
        #RESOURCE_UP_VALUE            [and  ]
        
        # Access Control Policy Parameters.
        #
        # Three entries set the access control policy for the package:
        # First line must be 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
        #    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 PACK
        #    to MONITOR, plus for administrative commands for the package.
        #
        # These policies do not effect root users. Access Policies here
        # should not conflict with policies defined in the cluster configuration file.
        #
        # Example: to configure a role for user john from node noir to
        # administer the package, enter:
        # USER_NAME  john
        # USER_HOST  noir
        # USER_ROLE  PACKAGE_ADMIN

    14. 修改pkg_ora.script
        根据自己的需要修改控制脚本,此次的修改结果如下:
        #"(#) A.11.16.00    $Date: 03/15/04 $"
        # **********************************************************************
        # *                                                                    *
        # *        HIGH AVAILABILITY PACKAGE CONTROL SCRIPT (template)         *
        # *                                                                    *
        # *       Note: This file MUST be edited before it can be used.        *
        # *                                                                    *
        # **********************************************************************
        
        # The PACKAGE and NODE environment variables are set by
        # Serviceguard at the time the control script is executed.
        # Do not set these environment variables yourself!
        # The package may fail to start or halt if the values for
        # these environment variables are altered.
        
        . ${SGCONFFILE:=/etc/cmcluster.conf}
        
        # UNCOMMENT the variables as you set them.
        
        # Set PATH to reference the appropriate directories.
        PATH=$SGSBIN:/usr/bin:/usr/sbin:/etc:/
        -exclusive activation.
        #
        # VGCHANGE="vgchange -a e -q n"
        # VGCHANGE="vgchange -a e -q n -s"
        # VGCHANGE="vgchange -a y"
        VGCHANGE="vgchange -a e"                # Default
        
        # CVM DISK GROUP ACTIVATION:
        # Specify the method of activation for CVM disk groups.
        # Leave the default
        # (CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=exclusivewrite")
        # if you want disk groups activated in the exclusive write mode.
        #
        nt out the default, if you want disk groups activated in the
        # shared write mode.
        #
        # CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=readonly"
        # CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=sharedread"
        # CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=sharedwrite"
        CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=exclusivewrite"
                       
        # VOLUME GROUPS
        # Specify which volume groups are used by this package. Uncomment VG[0]=""
        # and fill in the name of your first volume group. You must begin with
        # VG[0], and increment the list in sequence.
        #
        
        #VG[0]=""
        VG[0]=vg_ora
        
        # CVM DISK GROUPS
        # Specify which cvm disk groups are used by this package. Uncomment
        # CVM_DG[0]="" and fill in the name of your first disk group. You must
        # begin with CVM_DG[0], and increment the list in sequence.
        #
        # For example, if this package uses your disk groups dg01 and dg02, enter:
        #         CVM_DG[0]=dg01
        #         CVM_DG[1]=dg02
        #
        # The cvm disk group activation method
        
        # The cvm disk group activation method is defined above.
        #
        #VXVM_DG[0]=""
        
        #
        # NOTE: A package could have LVM volume groups, CVM disk groups and VxVM
        #       disk groups.
        #
        # NOTE: When VxVM is initialized it will store the hostname of the
        #       local node in its volboot file in a variable called 'hostid'.
        #       The Serviceguard package contr
        #       the hostname(1m) command and the VxVM hostid. As a result
        #       the VxVM hostid should always match the value of the
        #       hostname(1m) command.
        #
        #       If you modify the local host n
        sult in the package failing to start.
        
        # FILESYSTEMS
        # Filesystems are defined as entries specifying the logical volume, the
        # mount point, the mount, umount and fsck options and type of the file system.
        # Each filesystem will be fsck'd prior to being mounted. The filesystems
        # will be mounted in the order specified during package startup and will
        # be unmounted in reverse order during package shutdown. Ensure that
        # volume groups referenced by the logical volume definitions below are
        # included in volume group definitions above.
        #
        # Specify the filesystems which are us
         Specifying a particular FS_TYPE will improve package failover time.  
        # The FSCK_OPT and FS_UMOUNT_OPT parameters can be used to include the
        # -s option with the fsck and umount commands to improve performance for
        # environments that use a large number of filesystems. (An example of a
        # large environment is given below following the decription of the
        # CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS parameter.)
        #
        # Example: If a package uses two JFS filesystems, pkg01a and pkg01b,
        # which are mounted on LVM logical volumes lvol1 and lvol2 for read and
        # write operation, you would enter the following:
        #      LV[0]=/dev/vg01/lvol1; FS[0]=/pkg01a; FS_MOUNT_OPT[0]="-o rw";
        #      FS_UMOUNT_OPT[0]=""; FS_FSCK_OP
        #
        #      LV[1]=/dev/vg01/lvol2; FS[1]=/pkg01b; FS_MOUNT_OPT[1]="-o rw"
        #      FS_UMOUNT_OPT[1]=""; FS_FSCK_OPT[1]=""; FS_TYPE[1]="vxfs"
        #
        #LV[0]=""; FS[0]=""; FS_MOUNT_OPT[0]="
        mance for starting up or halting a package.  The maximum value for
        # each concurrent operation parameter is 1024.  Set these values carefully.  
        # The performance could actually decrease if the values are set too high
        # for the system resources available on your cluster nodes.  Some examples
        # of system resources that can affect the optimum number of concurrent
        # operations are: number of CPUs, amount of available memory, the kernel
        # configuration for nfile and nproc. In some cases, if you set the number
        # of concurrent operations too high, the package may not be able to start
        # or to halt.  For example, if you set CONCURRENT_VGCHANGE_OPERATIONS=5
        # and the node where the package is started has only one processor, then
        # running concurrent volume group acti
        # It is suggested that the number of concurrent operations be tuned
        # carefully, increasing the values a little at a time and observing the
        # effect on the performance, and the values should never be set to a value
        # where the performance levels off or declines.  Additionally, the values
        # used should take into account the no
        # cluster, and how many other packages may be running on the node.  
        # For instance, if you tune the concurrent operations for a package so
        # that it provides optimum performance for the package on a node while
        # no other packages are running on that node, the package performance
        # may be significantly reduced, or may
        NT_VGCHANGE_OPERATIONS=1
        
        # CONCURRENT FSCK OPERATIONS
        # Specify the number of concurrent fsck to allow during package startup.
        # Setting this value to an appropriate number may improve the performance
        # while checking a large number of file systems in the package. If the
        # specified value is less than 1, the script defaults it to 1 and proceeds
        # with a warning message in the package control script logfile.
        CONCURRENT_FSCK_OPERATIONS=1
        
        ENT MOUNT AND UMOUNT OPERATIONS
        # Specify the number of concurrent mounts and umounts to allow during
        # package startup or shutdown.
        # Setting this value to an appropriate number may improve the performance
        # while mounting or un-mounting a large number of file systems in the package.
        # If the specified value is less than 1, the script defaults it to 1 and
        # proceeds with a warning message in the package control script logfile.
        CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS=1
        
        # Example:  If a package uses 50 JFS f
        # which are mounted on the 50 logical volumes lvol1..lvol50 for read and write
        # operation, you may enter the following:
        #
        #      CONCURRENT_FSCK_OPERATIONS=50
        #      CONCURRENT_MOUNT_AND_UMOUNT_OPE
        #
        #      LV[0]=/dev/vg01/lvol1; FS[0]=/pkg01aa; FS_MOUNT_OPT[0]="-o rw";
        #      FS_UMOUNT_OPT[0]="-s"; FS_FSCK_OPT[0]="-s"; FS_TYPE[0]="vxfs"
        #
        #      LV[1]=/dev/vg01/lvol2; FS[1]=/p
        #      FS_UMOUNT_OPT[1]="-s"; FS_FSCK_OPT[1]="-s"; FS_TYPE[0]="vxfs"
        #         :           :          :
        #         :           :          :
        #         :           :          :
        #      LV[49]=/dev/vg01/lvol50; FS[49]
        #      FS_UMOUNT_OPT[49]="-s"; FS_FSCK_OPT[49]="-s"; FS_TYPE[0]="vxfs"
        #
        # IP ADDRESSES
        # Specify the IP and Subnet address pairs which are used by this package.
        # You could specify IPv4 or IPv6 IP an
        # Uncomment IP[0]="" and SUBNET[0]="" and fill in the name of your first
        # IP and subnet address. You must begin with IP[0] and SUBNET[0] and
        # increment the list in sequence.
        #
        # For example, if this package uses an
        # 192.10.25.0 enter:
        #          IP[0]=192.10.25.12
        #          SUBNET[0]=192.10.25.0
        #          (netmask=255.255.255.0)
        #
        P[0]=2001::1
        #          SUBNET[0]=2001::
        #          (netmask=ffff:ffff:ffff:ffff::)
        #
        # Hint: Run "netstat -i" to see the available IPv6 subnets by looking
        # at the address prefixes
        # IP/Subnet address pairs for each IP address you want to add to a subnet
        # interface card.  Must be set in pairs, even for IP addresses on the same
        # subnet.
        
        #SUBNET[0]=""
        IP[0]="192.168.0.199"
        SUBNET[0]="192.168.0.0"
        
        # SERVICE NAMES AND COMMANDS.
        # Specify the service name, command, and restart parameters which are
        # used by this package. Uncomment SERVICE_NAME[0]="", SERVICE_CMD[0]="",
        # SERVICE_RESTART[0]="" and fill in th
        # and restart parameters. You must begin with SERVICE_NAME[0], SERVICE_CMD[0],
        # and SERVICE_RESTART[0] and increment the list in sequence.
        #
        # For example:
        #          SERVICE_NAME[0]=pkg1a
        #          SERVICE_CMD[0]="/usr/bin/X11/xclock -display 192.10.25.54:0"
        #          SERVICE_RESTART[0]=""  # Will not restart the service.
        #
        #          SERVICE_NAME[1]=pkg1b
        #          SERVICE_CMD[1]="/usr/bin/X1
        #          SERVICE_RESTART[1]="-r 2"   # Will restart the service twice.
        #
        #          SERVICE_NAME[2]=pkg1c
        #          SERVICE_CMD[2]="/usr/sbin/ping"
        #          SERVICE_RESTART[2]="-R" # W
        #                                    number of times.
        #
        # Note: No environmental variables will be passed to the command, this
        # includes the PATH variable. Absolute path names are required for the
        # service command definition.  Default
        #
        #SERVICE_NAME[0]=""
        #SERVICE_CMD[0]=""
        #SERVICE_RESTART[0]=""
        
        # DEFERRED_RESOURCE NAME
        # Specify the full path name of the 'DEFERRED' resources configured for
        # this package.  Uncomment DEFERRED_RESOURCE_NAME[0]="" and fill in the
        # full path name of the resource.
        #
        #DEFERRED_RESOURCE_NAME[0]=""
               
        # DTC manager information for each DTC.
        # Example: DTC[0]=dtc_20
        #DTC_NAME[0]=
        # control script.  This allows multiple packages to be run out of the
        # same directory, as needed by SGeSAP.
        #HA_NFS_SCRIPT_EXTENSION=""
         
               
        # START OF CUSTOMER DEFINED FUNCTIONS
        之后的内容都是MC自动生成的脚本文件,暂时不需要关心了。

    15. 再次检查
        #cmcheckconf -v -C /etc/cmcluster/cmcluster.ascii -P /etc/cmcluster/pkg/pkg_ora/pkg_ora.config
        检查的过程和结果如下:
        Checking cluster file: /etc/cmcluster/cmcluster.ascii
        Note : a NODE_TIMEOUT value of 2000000 was found in line 109. For a
        significant portion of installations, a higher setting is more appropriate.
        Refer to the comments in the cluster configuration ascii file or Serviceguard
        manual for more information on this parameter.
        Checking nodes ... Done
        Checking existing configuration ... Done
        Gathering configuration information ... Done
        Gathering configuration information ... Done
        Gathering configuration information ..
        Gathering storage information ..
        Found 2 devices on node rx1600
        Analysis of 2 devices should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Found 2 volume groups on node rx1600
        Analysis of 2 volume groups should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        .....
        Gathering Network Configuration ....... Done
        Cluster cluster1 is an existing cluster
        Parsing package file: /etc/cmcluster/pkg/pkg_ora/pkg_ora.config.
        Attempting to add package pkg_ora.
        Checking for inconsistencies .. Done
        Cluster cluster1 is an existing cluster
        Maximum configured packages parameter is 5.
        Configuring 1 package(s).
        4 package(s) can be added to this cluster.
        200 access policies can be added to this cluster.
        Modifying configuration on node rx1600
        Modifying the cluster configuration for cluster cluster1.
        Adding the package configuration for package pkg_ora.
        
        Verification completed with no errors found.
        Use the cmapplyconf command to apply the configuration.

    16. 再次编译
        #cmapplyconf -v -C /etc/cmcluster/cmcluster.ascii -P /etc/cmcluster/pkg/pkg_ora/pkg_ora.config
        编译的过程和结果如下:
        Checking cluster file: /etc/cmcluster/cmcluster.ascii
        Note : a NODE_TIMEOUT value of 2000000 was found in line 109. For a
        significant portion of installations, a higher setting is more appropriate.
        Refer to the comments in the cluster configuration ascii file or Serviceguard
        manual for more information on this parameter.
        Checking nodes ... Done
        Checking existing configuration ... Done
        Gathering configuration information ... Done
        Gathering configuration information ... Done
        Gathering configuration information ..
        Gathering storage information ..
        Found 2 devices on node rx1600
        Analysis of 2 devices should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Found 2 volume groups on node rx1600
        Analysis of 2 volume groups should take approximately 1 seconds
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        .....
        Gathering Network Configuration ....... Done
        Cluster cluster1 is an existing cluster
        Parsing package file: /etc/cmcluster/pkg/pkg_ora/pkg_ora.config.
        Attempting to add package pkg_ora.
        Checking for inconsistencies .. Done
        Cluster cluster1 is an existing cluster
        Maximum configured packages parameter is 5.
        Configuring 1 package(s).
        4 package(s) can be added to this cluster.
        200 access policies can be added to this cluster.
        Modifying configuration on node rx1600
        
        Modify the cluster configuration ([y]/n)? y
        Marking/unmarking volume groups for use in the cluster
        0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
        Modifying the cluster configuration for cluster cluster1.
        Adding the package configuration for package pkg_ora.
        Completed the cluster creation.

    17. 运行
        #cmruncl -v
        cmruncl  : Validating network configuration...
        Gathering configuration information ..
        Gathering Network Configuration ...... Done
        cmruncl  : Network validation complete
        cmruncl  : Waiting for cluster to form....
        cmruncl  : Cluster successfully formed.
        cmruncl  : Check the syslog files on all nodes in the cluster
        cmruncl  : to verify that no warnings occurred during startup.

    18. 检查运行结果
        #cmviewcl
        运行结果如下:
        CLUSTER      STATUS      
        cluster1     up           
        
          NODE         STATUS       STATE        
          rx1600       up           running      
        
            PACKAGE      STATUS       STATE        AUTO_RUN     NODE         
            pkg_ora      up           running      disabled     rx1600

    经过以上步骤,就配置了一个最少节点(一个)和最少网卡(一块)和最小包(一个)的最小的MC/ServiceGuard了。
    需要注意的是,这些步骤中没有包括建立VG(vg_ora)的步骤。这些就假定你在开始配置之前就已经建立好了。或者可以简单的参考以下步骤:
        #mkdir /dev/vg_ora
        #mknod /dev/vg_ora/group c 64 0x050000
        #pvcreate -f /dev/rdsk/c2t1d0
        #vgcreate /dev/vg_ora /dev/dsk/c2t1d0
        #lvcreate -L 1024 /dev/vg_ora
        #newfs -F vxfs -o largefiles /dev/vg_ora/rlvol1
        #mkdir /oracle
        #mount /dev/vg_ora/lvol1 /oracle
        #bdf
        #umount /oracle
        #vgchange -a n /dev/vg_ora
        #vgchange -c n /dev/vg_ora

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12718/showart_79118.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP