Sun Java System Messaging Server 6.3 管理指南

Procedure配置双节点 HA 不对称 Messaging Server—示例

在本示例中,我们假设两个群集节点具有物理主机名 daisy.red.siroe.comlavender.red.siroe.com,具有逻辑主机名 budgie

对于 daisy.red.siroe.com,二进制文件安装在 /opt/SUNWmsgsr 中,配置数据安装在 /var/opt/SUNWmsgsr 中。

我们为逻辑主机名 budgie 指定了逻辑 IP 地址。例如,/etc/hosts 文件可能如下所示:


192.18.75.157 budgie.red.siroe.com budgie
  1. 在两个节点上安装 Messaging Sun Cluster 代理 (SUNWscims)。

  2. 创建文件系统。

    在本示例中,文件系统 /var/opt/SUNWmsgsr 安装在共享磁盘上。此文件系统可以是群集文件系统,也可以是本地文件系统(故障转移文件系统)。

  3. 配置主节点 (daisy)。

    1. 在主节点上添加所需的资源类型。

      此操作配置 Sun Cluster 以了解要使用的资源类型。要注册 Messaging Server 和 HAStoragePlus 资源,请使用以下命令:


      # scrgadm -a -t SUNW.HAStoragePlus
      # scrgadm -a -t SUNW.ims 
    2. 为名为 MS_RG_DAISY 的 Messaging Server 实例创建资源组。


      # scrgadm -a -g MS_RG_daisy -h daisy,lavender
    3. 创建名为 meadow 的逻辑主机名资源、将其添加到资源组中并使其联机。


      # scrgadm -a -L -g MS_RG_DAISY -l meadow
      # scrgadm -c -j meadow -y R_description="LogicalHostname resource for meadow"
      # scswitch -Z -g MS_RG_DAISY
    4. 使用以前创建的文件系统创建一个名为 ms-hasp-daisy 的 HAStoragePlus 资源。


      # scrgadm -a -j ms-hasp-daisy -g MS_RG_DAISY -t SUNW.HAStoragePlus -x 
      FileSystemMountPoints ="/var/opt/SUNWmsgsr" -x 
      AffinityOn=TRUE
    5. 启用 HAStoragePlus 资源:


      # scswitch -e -j ms-hasp-daisy
  4. 在主节点上安装并配置 Messaging Server(请参见1.3 创建初始 Messaging Server 运行时配置)。

    初始运行时配置程序要求输入全限定主机名。输入逻辑主机名 meadow.red.siroe.com。该程序还要求指定配置目录。输入 /var/opt/SUNWmsgsr

  5. 在主节点上运行 ha_ip_config 脚本,并提供逻辑 IP 地址。

    此脚本仅在主节点上运行,而不在辅助节点上运行。ha_ip_config 脚本位于 sbin 目录下的安装目录中。例如:


    # /opt/SUNWmsgsr/sbin/ha_ip_config
    
    Please specify the IP address assigned to the HA logical host name. 
    Use dotted decimal form, a.b.c.d
    
    Logical IP address: 192.18.75.155 
    # This value is the logical IP address of the logical hostname. Refer 
    # to the /etc/hosts file.
    Please specify the path to the top level directory in which iMS is
    installed.
    
    iMS server root: /opt/SUNWmsgsr
    
    . . . 
    
    Updating the file /opt/SUNWmsgsr/config/dispatcher.cnf
    Updating the file /opt/SUNWmsgsr/config/job_controller.cnf
    Setting the service.listenaddr configutil parameter
    Setting the local.snmp.listenaddr configutil parameter
    Setting the service.http.smtphost configutil parameter
    Setting the local.watcher.enable configutil parameter
    Setting the local.autorestart configutil parameter
    Setting the metermaid.config.bindaddr configutil parameters
    Setting the metermaid.config.serveraddr configutil parameters
    Setting the local.ens.port parameter
    Configuration successfully updated
  6. 修改 imta.cnf 文件,并用 HA 逻辑主机名 (meadow) 替换出现的所有物理主机名 (daisy)。

  7. 将资源组故障转移到辅助节点 (lavender)。

    进行故障转移后,您将随后配置辅助节点 (lavender)。


    # scswitch -z -g MS_RG_LAVENDER -h daisy
  8. 在辅助节点 (lavender) 上安装 Messaging Server,然后运行 useconfig 实用程序。请参见3.3.3 使用 useconfig 实用程序

    您不必运行初始运行时配置程序 (configure)。

    在以下示例中,/var/opt/SUNWmsgsr 是共享配置目录。


    # useconfig /var/opt/SUNWmsgsr/setup/configure_20061201124116
    cp /var/opt/SUNWmsgsr/setup/configure_20061201124116/Devsetup.properties
    /opt/SUNWmsgsr/lib/config-templates/Devsetup.properties
    /usr/sbin/groupadd mail
    /usr/sbin/useradd -g mail -d / mailsrv
    /usr/sbin/usermod -G mail mailsrv
    sed -e "s/local.serveruid/mailsrv/" -e "s/local.serveruid/mail/" -e "s:<msg·RootPath>:/opt/SUNWmsgsr:" 
    /opt/SUNWmsgsr/lib/config-templates/devtypes.txt.template > 
    /opt/SUNWmsgsr/lib/config-templates/devtypes.txt
    sed -e "s/local.serveruid/mailsrv/" -e "s/local.serveruid/mail/" -e 
    "s:<msg·RootPath>:/opt/SUNWmsgsr:" 
    /opt//SUNWmsgsr/lib/config-templates/config.ins.template > 
    /opt/SUNWmsgsr/lib/config-templates/config.ins
    /opt/SUNWmsgsr/lib/devinstall -l sepadmsvr:pkgcfg:config -v -m -i 
    /opt/SUNWmsgsr/lib/config-templates/config.ins 
    /opt/SUNWmsgsr/lib/config-templates 
    /opt/SUNWmsgsr/lib/jars /opt/SUNWmsgsr/lib
    devinstall returned 0
    crle -c /var/ld/ld.config -s
     /usr/lib/secure:/opt/SUNWmsgsr/lib:/opt/SUNWmsgsr/lib:/opt/SUNWmsgsr/lib 
    -s /opt/SUNWmsgsr/lib
    See /opt/SUNWmsgsr/install/useconfiglog_20061211155037 for more details
  9. 创建 HA Messaging Server 资源并将其启用。


    # scrgadm -a -j ms-rs-daisy -t SUNW.ims -g MS_RG_DAISY -x IMS_serverroot 
    =/opt/SUNWmsgsr -y Resource_dependencies=meadow,ms-hasp-daisy
    # scswitch -e -j mail-rs-daisy

    以上命令为 Messaging Server 创建一个名为 ms-rs-daisy 的 HAMessaging Server 资源,它将安装在 /opt/SUNWmsgsr 上。此 HAMessaging Server 资源依赖于 HA 磁盘资源,即,以前创建的文件系统以及 HA 逻辑主机名 meadow

  10. 确保所有功能均正常工作。

    将 Messaging Server 资源故障转移回主节点。


     # scswitch -z -g MAIL-RG -h daisy