Sun Java System Messaging Server 6.3 Administration Guide

3.4.3 Configuring Messaging Server with Sun Cluster HAStorage or HAStoragePlus

This section describes how to configure HAStorage and HAStoragePlus for Messaging Server for Sun Cluster. The first section describes the general steps. Subsequent sections show specific examples for symmetric and asymmetric deployments.

After configuring HA, be sure to review 3.4.4 Binding IP Addresses on a Server for additional steps associated with HA support.

The following description assumes that Messaging Server has been configured with an HA logical host name and IP address. The physical host names are assumed to be mars and venus, with an HA logical host name of meadow. Figure 3–4 depicts the nested dependencies of the different HA resources you will create in configuring Messaging Server HA support.


Note –

While we describe how to configure HAStorage and HAStoragePlus, we highly recommend HAStoragePlus better I/O performance. See 3.4.2 About HAStoragePlus.


This section contains the following subsections:

Figure 3–4 A Simple Messaging ServerHA Configuration

This image depicts a simple Messaging Server HA configuration.

ProcedureTo Configure Messaging Server with Sun Cluster HAStorage or HAStoragePlus—Generic Example

This section provides the generic steps for configuring Messaging Server for HA. After reviewing these steps, refer to the specific asymmetric or symmetric examples in the following sections. In these instructions the physical hosts are called mars and venus. The logical host name is meadow.

Figure 3–4 depicts the nested dependencies of the different HA resources you will create in configuring Messaging Server HA support.

  1. Become the superuser and open a console.

    All of the following Sun Cluster commands require that you have logged in as superuser. You will also want to have a console or window for viewing messages output to /dev/console.

  2. On all the nodes, install the required Messaging Sun Cluster Data Service Agents package (SUNWscims).

  3. On each node in the cluster create the Messaging Server runtime user and group under which the Messaging Server will run.

    The user ID and group ID numbers must be the same on all nodes in the cluster. The runtime user ID is the user name under which Messaging Server runs. This name should not be root. The default is mailsrv. The runtime Group ID is the group under which Messaging Server runs. The default is mail

    Although the configure utility can create these names for you, you can also create them before running configure as part of the preparation of each node as described in this chapter. The runtime user and group ID names must be in the following files:

    • mailsrv, or the name you select, must in /etc/passwd on all nodes in the cluster

    • mail, or the name you select, must be in /etc/group on all nodes in the cluster

    See 1.1 Creating UNIX System Users and Groups.

  4. Add required resource types to Sun Cluster.

    Configure Sun Cluster to know about the resources types we will be using. To register Messaging Server as your resource use the following command:


    # scrgadm -a -t SUNW.ims

    To register HAStoragePlus as a resource type, use this command:


    # scrgadm -a -t SUNW.HAStoragePlus

    To do the same with HAStorage as a resource type, use this command:


    # scrgadm -a -t SUNW.HAStorage
  5. Create a failover resource group for the Messaging Server.

    If you have not done so already, create a resource group and make it visible on the cluster nodes which will run the Messaging Server. The following command creates a resource group named MAIL-RG, making it visible on the cluster nodes mars and venus:

    # scrgadm -a -g MAIL-RG -h mars,venus

    You may, of course, use whatever name you wish for the resource group.

  6. Create an HA logical host name resource and bring it on-line.

    If you have not done so, create and enable a resource for the HA logical host name placing that resource in the resource group. The following command does so using the logical host name meadow. Since the -j switch is omitted, the name of the resource created will also be meadow. meadow is the logical host name by which clients communicate with the services in the resource group.


    # scrgadm -a -L -g MAIL-RG -l meadow
    # scswitch -Z -g MAIL-RG
  7. Create an HAStorage or HAStoragePlus resource.

    Next, you need to create an HA Storage or HAStoragePlus resource type for the file systems on which Messaging Server is dependent. The following command creates an HAStoragePlus resource named disk-rs, and the file system disk_sys_mount_point is placed under its control:


    # scrgadm -a -j disk-rs -g MAIL-RG \
    -t SUNW.HAStoragePlus \
    -x FilesystemMountPoints=disk_sys_mount_point-1, disk_sys_mount_point-2 -x AffinityOn=True

    SUNW.HAStoragePlus represents the device groups, cluster and local file systems which are to be used by one or more data service resources. One adds a resource of type SUNW.HAStoragePlus to a resource group and sets up dependencies between other resources and the SUNW.HAStoragePlus resource. These dependencies ensure that the data service resources are brought online after:

    • All specified device services are available (and collocated if necessary)

    • All specified file systems are mounted following their checks

    The FilesystemMountPoints extension property allows for the specification of either global or local file systems. That is, file systems that are either accessible from all nodes of a cluster or from a single cluster node. Local file systems managed by a SUNW.HAStoragePlus resource are mounted on a single cluster node and require the underlying devices to be Sun Cluster global devices. SUNW.HAStoragePlus resources specifying local file systems can only belong in a failover resource group with affinity switch overs enabled. These local file systems can therefore be termed failover file systems. Both local and global file system mount points can be specified together.

    A file system whose mount point is present in the FilesystemMountPoints extension property is assumed to be local if its /etc/vfstab entry satisfies both of the following conditions:

    • Non-global mount option

    • Mount at boot flag is set to no


    Note –

    Instances of the SUNW.HAStoragePlus resource type ignore the mount at boot flag for global file systems.


    For the HAStoragePlus resource, the comma-separated list of FilesystemMountPoints are the mount points of the Cluster File Systems (CFS) or Failover File Systems (FFS) on which Messaging Server is dependent. In the above example, only two mount points, disk_sys_mount_point-1 and disk_sys_mount_point-2, are specified. If one of the servers has additional file systems on which it is dependent, then you can create an additional HA storage resource and indicate this additional dependency in Step 15.

    For HAStorage use the following:


    # scrgadm -a -j disk-rs -g MAIL-RG \
    -t SUNW.HAStorage
    -x ServicePaths=disk_sys_mount_point-1, disk_sys_mount_point-2 -x AffinityOn=True

    For the HAStorage resource, the comma-separated list of ServicePaths are the mount points of the cluster file systems on which Messaging Server is dependent. In the above example, only two mount points, disk_sys_mount_point-1 and disk_sys_mount_point-2, are specified. If one of the servers has additional file systems on which it is dependent, then you can create an additional HA storage resource and indicate this additional dependency in Step 15.

  8. Install the required Messaging Server packages on the primary node. Choose the Configure Later option.

    Use the Communications Suite installer to install the Messaging Server packages.

    For symmetric deployments: Install Messaging Server binaries and configuration data on files systems mounted on a shared disk of the Sun Cluster. For example, for Messaging Server binaries could be under /disk_sys_mount_point-1/SUNWmsgsr and the configuration data could be under /disk_sys_mount_point-2/config.

    For asymmetric deployments: Install Messaging Server binaries on local file systems on each node of the Sun Cluster. Install configuration data on a shared disk. For example, the configuration data could be under /disk_sys_mount_point-2/config.

  9. Configure the Messaging Server. See 1.3 Creating the Initial Messaging Server Runtime Configuration.

    In the initial runtime configuration, you are asked for the Fully Qualified Host Name. You must use the HA logical hostname instead of the physical hostname.

    In the initial runtime configuration, you are asked to specify a configuration directory in 1.3 Creating the Initial Messaging Server Runtime Configuration. Be sure to use the shared disk directory path of your HAStorage or HAStoragePlus resource.

  10. Run the ha_ip_config script to set service.listenaddr and service.http.smtphost and to configure the dispatcher.cnf and job_controller.cnf files for high availability.

    The script ensures that the logical IP address is set for these parameters and files, rather than the physical IP address. It also enables the watcher process (sets local.watcher.enable to 1), and auto restart process (local.autorestart to 1).

    For instructions on running the script, see 3.4.4 Binding IP Addresses on a Server.

    The ha_ip_config script should only be run once on the primary node.

  11. Modify the imta.cnf file and replace all occurrences of the physical hostname with the logical hostname of the cluster.

  12. Fail the resource group from the primary to the secondary cluster node in order to ensure that the failover works properly.

    Manually fail the resource group over to another cluster node. (Be sure you have superuser privileges on the node to which you failover.)

    Use the scstat command to see what node the resource group is currently running on (“online” on). For instance, if it is online on mars, then fail it over to venus with the command:

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

    If you are upgrading your first node, you will install through theCommunications Suite Installer and then configure Messaging Server. You will then failover to the second node where you will install the Messaging Server package through the Communications Suite Installer, but you will not have to run the Initial Runtime Configuration Program (configure) again. Instead, you can use the useconfig utility.

  13. Install the required Messaging Server packages on the secondary node. Choose the Configure Later option.

    After failing over to the second node, install the Messaging Server packages using the Communications Suite Installer.

    For symmetric deployments: Do not install Messaging Server.

    For asymmetric deployments: Install Messaging Server binaries on local file systems on the local file system.

  14. Run useconfig on the second node of the cluster.

    The useconfig utility allows you to share a single configuration between multiple nodes in an HA environment. You don't need to run the initial runtime configure program (configure). Instead use the useconfig utility (see 3.3.3 Using the useconfig Utility.

  15. Create an HA Messaging Server resource.

    It’s now time to create the HA Messaging Server resource and add it to the resource group. This resource is dependent upon the HA logical host name and HA disk resource.

    In creating the HA Messaging Server resource, we need to indicate the path to the Messaging Server top-level directory—the msg-svr-base path. These are done with the IMS_serverroot extension properties as shown in the following command.


    # scrgadm -a -j mail-rs -t SUNW.ims -g MAIL-RG \
          -x IMS_serverroot=msg-svr-base \
          -y Resource_dependencies=disk-rs,meadow

    The above command, creates an HA Messaging Server resource named mail-rs for the Messaging Server, which is installed on IMS_serverroot in the msg-svr-base directory. The HA Messaging Server resource is dependent upon the HA disk resource disk-rs as well as the HA logical host name meadow.

    If the Messaging Server has additional file system dependencies, then you can create an additional HA storage resource for those file systems. Be sure to include that additional HA storage resource name in the Resource_dependencies option of the above command.

  16. Enable the Messaging Server resource.

    It’s now time to activate the HA Messaging Server resource, thereby bringing the messaging server online. To do this, use the command

    # scswitch -e -j mail-rs

    The above command enables the mail-rs resource of the MAIL-RG resource group. Since the MAIL-RG resource was previously brought online, the above command also brings mail-rs online.

  17. Verify that things are working.

    Use the scstat -pvv command to see if the MAIL-RG resource group is online.

    You may also want to look at the output directed to the console device for any diagnostic information. Also look in the syslog file, /var/adm/messages. For more debugging options and information, refer to 3.4.3.1 How to Enable Debugging on Sun Cluster.

ProcedureTo Unconfigure Messaging Server HA Support for Sun Cluster 3.x—Generic Example

This section describes how to undo the HA configuration for Sun Cluster. This section assumes the simple example configuration (described in the 3.4 Sun Cluster Installation (for example, Step 3) may be different but will otherwise follow the same logical order.

  1. Become the superuser.

    All of the following Sun Cluster commands require that you be running as user superuser.

  2. Bring the resource group offline.

    To shut down all of the resources in the resource group, issue the command

    # scswitch -F -g MAIL-RG

    This shuts down all resources within the resource group (for example, the Messaging Server and the HA logical host name).

  3. Disable the individual resources.

    Next, remove the resources one-by-one from the resource group with the commands:


    # scswitch -n -j mail-rs
    # scswitch -n -j disk-rs
    # scswitch -n -j budgie
    
  4. Remove the individual resources from the resource group.

    Once the resources have been disabled, you may remove them one-by-one from the resource group with the commands:


    # scrgadm -r -j mail-rs
    # scrgadm -r -j disk-rs
    # scrgadm -r -j budgie
    
  5. Remove the resource group.

    Once the all the resources have been removed from the resource group, the resource group itself may be removed with the command:

    # scrgadm -r -g MAIL-RG

  6. Remove the resource types (optional).

    Should you need to remove the resource types from the cluster, issue the commands:


    # scrgadm -r -t SUNW.ims
    # scrgadm -r -t SUNW.HAStoragePlus
    

ProcedureTo Configure a Two-node Symmetric Messaging Server—Example

In this example we assume two cluster nodes with the physical hostnames mars.red.siroe.com and venus.red.siroe.com. The installation and configuration directory locations need to be unique. A contention problem will occur if the installation and configuration directories on each node have the same directory names, for example /opt/SUNWmsgsr and /var/opt/SUNWmsgsr. The contention problem occurs when venus does a failover to mars, and two instances of Messaging Server compete with the same install and configuration directories.

A good practice for creating unique names for the installation and configuration directories would be to use the format /opt/NodeMember/SUNWmsgsr for the installation directory and /var/opt/NodeMember/SUNWmsgsr for the configuration directory. You can use any directory to install your binaries and configuration data as long as they are unique.

In this example we assume two cluster nodes with physical hostnames mars.red.siroe.com and venus.red.siroe.com.

For mars.red.siroe.com, binaries are installed at /opt/mars/SUNWmsgsr and configuration data is installed at /var/opt/mars/SUNWmsgsr.

For venus.red.siroe.com, binaries are installed at /opt/venus/SUNWmsgsr and configuration data is installed at /var/opt/venus/SUNWmsgsr.

We have two logical hostnames called meadow and pasture with their respective logical IP addresses. For example, the /etc/hosts file on both nodes look like this:


192.18.75.155 meadow.red.siroe.com meadow 
192.18.75.157 pasture.red.siroe.com pasture
  1. Install the Messaging Server Sun Cluster agent package (SUNWscims) on both nodes.

  2. Create four file systems.

    These files systems can either be Cluster File Systems or local file systems (Failover File Systems).


    /var/opt/mars/SUNWmsgsr
    /var/opt/venus/SUNWmsgsr
    /opt/mars/SUNWmsgsr
    /opt/venus/SUNWmsgsr

    These files systems should be mounted on a shared disk. For example below we show four Cluster File Systems. The contents of the/etc/vfstab shown below should be similar on all nodes of the cluster.


    # cat /etc/vfstab
    #device  device  mount  FS  fsck  mount  mount  to  mount  to  fsck  point  type 
    pass at_boot_options
    /dev/md/penguin/dsk/d500 /dev/md/penguin/rdsk/d500 /opt/mars/SUNWmsgsr ufs 2 yes 
    logging,global
    /dev/md/penguin/dsk/d400 /dev/md/penguin/rdsk/d400 /var/opt/mars/SUNWmsgsr ufs 2 
    yes logging,global
    /dev/md/polarbear/dsk/d200 /dev/md/polarbear/rdsk/d200 /opt/venus/SUNWmsgsr ufs 2 
    yes  logging,global
    /dev/md/polarbear/dsk/d300 /dev/md/polarbear/rdsk/d300 /var/opt/venus/SUNWmsgsr 
    ufs 2 yes logging,global

    If you want to make the four file systems shown above as local file systems (Fail Over File Systems), set the mount at boot option to no and remove the mount option global keyword:


    
    
  3. Configure the primary node

    1. Add the required resource types on the primary node.

      This configures Sun Cluster to know about the resources types that will be used. To register Messaging Server and the HAStoragePlus resource, use the following commands:


      # scrgadm -a -t SUNW.HAStoragePlus
      # scrgadm -a -t SUNW.ims 
    2. Create a fail over resource group for Messaging Server called MS_RG_MARS.


      # scrgadm -a -g MS_RG_MARS -h mars,venus
    3. Create one logical hostname resource called meadow, add it to the resource group and bring it on-line.


      # scrgadm -a -L -g MS_RG_MARS -l meadow
      # scrgadm -c -j meadow -y R_description="LogicalHostname resource for meadow"
      # scswitch -Z -g MS_RG_MARS
    4. Create a HAStoragePlus resource called ms-hasp-mars with the file systems created earlier.


      # scrgadm -a -j ms-hasp-mars -g MS_RG_MARS -t SUNW.HAStoragePlus -x 
      FileSystemMountPoints ="/opt/mars/SUNWmsgsr, /var/opt/mars/SUNWmsgsr" -x 
      AffinityOn=TRUE
    5. Enable the HAStoragePlus resource:


      # scswitch -e -j ms-hasp-mars
  4. Install the Messaging Server on the primary node.

    Install the Messaging Server packages using Communications Suite installer. Make sure you install the Messaging Server binaries and configuration data on the shared file system (see Step 2). For example, for this instance of Messaging Server, the messaging binaries are under /opt/mars/SUNWmsgsr and the configuration data is under /var/opt/mars/SUNWmsgsr.

  5. Install and configure the Messaging Server on the primary node (see 1.3 Creating the Initial Messaging Server Runtime Configuration).

    The initial runtime configuration program asks for the Fully Qualified Host Name. Enter the logical hostname meadow.red.siroe.com. The program also asks to specify a configuration directory. Enter /var/opt/mars/SUNWmsgsr.

  6. Run the ha_ip_config script on the primary node and provide the logical IP address.

    This is only run on the primary node and not on the secondary node. The ha_ip_config script is located under the installation directory under the sbin directory. For example:


    # /opt/mars/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/mars/SUNWmsgsr
    
    . . . 
    
    Updating the file /opt/mars/SUNWmsgsr/config/dispatcher.cnf
    Updating the file /opt/mars/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
  7. Modify the imta.cnf file and replace all occurrences of the physical hostname, that is, mars, with the HA logical host name (meadow).

  8. Fail over the resource group to the secondary node (venus).

    After failing over, you will then configure the secondary node (venus).


    # scswitch -z -g MS_RG_VENUS -h mars
  9. On the secondary node (venus) run useconfig utility. See 3.3.3 Using the useconfig Utility

    You do not have to run the initial runtime configuration program (configure) or install the Messaging Server packages.

    In the following example, /var/opt/mars/SUNWmsgsr is the shared configuration directory.


    # useconfig /var/opt/mars/SUNWmsgsr/setup/configure_20061201124116
    cp /var/opt/mars/SUNWmsgsr/setup/configure_20061201124116/Devsetup.properties
    /opt/mars/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/mars/SUNWmsgsr:" 
    /opt/mars/SUNWmsgsr/lib/config-templates/devtypes.txt.template > 
    /opt/mars/SUNWmsgsr/lib/config-templates/devtypes.txt
    sed -e "s/local.serveruid/mailsrv/" -e "s/local.serveruid/mail/" -e 
    "s:<msg·RootPath>:/opt/mars/SUNWmsgsr:" 
    /opt/mars/SUNWmsgsr/lib/config-templates/config.ins.template > 
    /opt/mars/SUNWmsgsr/lib/config-templates/config.ins
    /opt/mars/SUNWmsgsr/lib/devinstall -l sepadmsvr:pkgcfg:config -v -m -i 
    /opt/mars/SUNWmsgsr/lib/config-templates/config.ins 
    /opt/mars/SUNWmsgsr/lib/config-templates 
    /opt/mars/SUNWmsgsr/lib/jars /opt/mars/SUNWmsgsr/lib
    devinstall returned 0
    crle -c /var/ld/ld.config -s
     /usr/lib/secure:/opt/SUNWmsgsr/lib:/opt/venus/SUNWmsgsr/lib:/opt/mars/SUNWmsgsr/lib 
    -s /opt/mars/SUNWmsgsr/lib
    See /opt/mars/SUNWmsgsr/install/useconfiglog_20061211155037 for more details
  10. Create the HA Messaging Server Resource and enable it.


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

    The above command, creates an HA Messaging Server resource named ms-rs-mars for the Messaging Server, which is installed on /opt/mars/SUNWmsgsr. This HA Messaging Server resource is dependent upon the HA disk resource, that is, the file systems created earlier as well as the HA logical host name meadow.

  11. Verify that everything is working.

    Failover the Messaging Server resource back to the primary node.


     # scswitch -z -g MAIL-RG -h mars
  12. Similarly, create another failover resource group for the second instance of Messaging Server with venus as the primary and mars as the secondary (or standby node).

    Repeat the steps from 3 to 10 with venus as the primary node for this resource group, MS_RG_VENUS as the resource group, pasture as the logical hostname and ms-hasp-venus as the HAStoragePlus resource. Thus the commands will look like this:

    To create the resource group MS_RG_VENUS:


    # scrgadm -a -g MS_RG_VENUS -h venus,mars

    To create a logical hostname resource called pasture, add it to the resource group and bring it on-line;


    # scrgadm -a -L -g MS_RG_VENUS -l pasture
    # scrgadm -c -j pasture -y R_description="LogicalHostname resource for pasture"
    # scswitch -Z -g MS_RG_VENUS

    To create an HAStoragePlus resource called ms-hasp-venus with the file systems created earlier:


    # scrgadm -a -j ms-hasp-venus -g MS_RG_VENUS -t SUNW.HAStoragePlus -x 
    FileSystemMountPoints ="/opt/venus/SUNWmsgsr, /var/opt/venus/SUNWmsgsr" -x 
    AffinityOn=TRUE

    To enable the HAStoragePlus resource:


    # scswitch -e -j ms-hasp-venus

    To run the ha_ip_config script on the primary node and provide the logical IP address:


    # /opt/venus/SUNWmsgsr/sbin/ha_ip_config

    To create the HA Messaging Server Resource and enable it:


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

    To fail over the resource group to the secondary node (venus):


    # scswitch -z -g MS_RG_MARS -h venus

    To run useconfig on the secondary node (mars) run useconfig utility:


    # useconfig /var/opt/venus/SUNWmsgsr/setup/configure_20061201124116

    To verify that everything is working by failing over the Messaging Server resource back to the primary node:


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

ProcedureTo Unconfigure an HA Symmetric Deployment

Unconfiguring is done when you need to upgrade the Messaging Server or the Sun Cluster, or when you need to uninstall the Messaging Server. It is assumed that the system was configured the using the previous example.

The first step is to remove each resource group in the cluster. In the example, there are two resource groups, MS_RG_MARS and MS_RG_VENUS. Both must be removed.

  1. Remove resource group MS_RG_MARS from the cluster.

    Use the following commands on just one node. You do not have to do this on each node.

    1. Brings the resource group off-line on all nodes of the cluster:


      # scswitch -F -g MS_RG_MARS
    2. Disable all the specific Messaging Server resources:


      # scswitch -n -j ms-rs-mars
      # scswitch -n -j meadow
      # scswitch -n -j ms-hasp-mars
    3. Remove all the specific MS resources:


      # scrgadm -r -j ms-rs-mars
      # scrgadm -r -j meadow
      # scrgadm -r -j ms-hasp-mars
    4. Remove the resource group:


      scrgadm -r -g MS_RG_MARS
  2. Remove resource group MS_RG_VENUS from the cluster.

    Use the following commands on just one node. You do not have to do this on each node.

    1. Brings the resource group off-line on all nodes of the cluster:


      # scswitch -F -g MS_RG_VENUS
    2. Disable all the specific Messaging Server resources:


      # scswitch -n -j ms-rs-venus 
      # scswitch -n -j pasture
      # scswitch -n -j ms-hasp-venus
    3. Remove all the specific MS resources:


      # scrgadm -r -j ms-rs-venus
      # scrgadm -r -j pasture
      # scrgadm -r -j ms-hasp-venus
    4. Remove the resource group:


      scrgadm -r -g MS_RG_VENUS
  3. Unregister the Resource Types that are not in use.


    # scrgadm -r -t SUNW.HAStoragePlus
    # scrgadm -r -t SUNW.ims

ProcedureTo Configure a Two-node HA Asymmetric Messaging Server—Example

In this example we assume two node cluster with physical hostnames daisy.red.siroe.com and lavender.red.siroe.com with a logical hostname called budgie.

For daisy.red.siroe.com, binaries are installed at /opt/SUNWmsgsr and configuration data is installed at /var/opt/SUNWmsgsr.

The logical hostname budgie is assigned logical IP address. For example, the /etc/hosts file could look like this:


192.18.75.157 budgie.red.siroe.com budgie
  1. Install the Messaging Sun Cluster agents (SUNWscims) on both nodes.

  2. Create the file system.

    In this example, the file system /var/opt/SUNWmsgsr is mounted on a shared disk. This file system can either be a Cluster File System or local file systems (Failover File Systems).

  3. Configure the primary node (daisy).

    1. Add the required resource types on the primary node.

      This configures Sun Cluster to know about the resources types that will be used. To register Messaging Server and the HAStoragePlus resource, use the following commands:


      # scrgadm -a -t SUNW.HAStoragePlus
      # scrgadm -a -t SUNW.ims 
    2. Create a resource group for the Messaging Server instance called MS_RG_DAISY.


      # scrgadm -a -g MS_RG_daisy -h daisy,lavender
    3. Create a logical hostname resource called meadow, add it to the resource group and bring it on-line.


      # 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. Create an HAStoragePlus resource called ms-hasp-daisy with the file systems created earlier.


      # scrgadm -a -j ms-hasp-daisy -g MS_RG_DAISY -t SUNW.HAStoragePlus -x 
      FileSystemMountPoints ="/var/opt/SUNWmsgsr" -x 
      AffinityOn=TRUE
    5. Enable the HAStoragePlus resource:


      # scswitch -e -j ms-hasp-daisy
  4. Install and configure the Messaging Server on the primary node (see 1.3 Creating the Initial Messaging Server Runtime Configuration).

    The initial runtime configuration program asks for the Fully Qualified Host Name. Enter the logical hostname meadow.red.siroe.com. The program also asks to specify a configuration directory. Enter /var/opt/SUNWmsgsr.

  5. Run the ha_ip_config script on the primary node and provide the logical IP address.

    This is only run on the primary node and not on the secondary node. The ha_ip_config script is located under the installation directory under the sbin directory. For Example:


    # /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. Modify the imta.cnf file and replace all occurrences of the physical hostname (daisy) with the HA logical host name (meadow).

  7. Fail over the resource group to the secondary node (lavender).

    After failing over, you will then configure the secondary node (lavender).


    # scswitch -z -g MS_RG_LAVENDER -h daisy
  8. On the secondary node (lavender) install Messaging Server and run the useconfig utility. See 3.3.3 Using the useconfig Utility

    You do not have to run the initial runtime configuration program (configure).

    In the following example, /var/opt/SUNWmsgsr is the shared configuration directory.


    # 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. Create the HA Messaging Server Resource and enable it.


    # 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

    The above command creates an HAMessaging Server resource named ms-rs-daisy for the Messaging Server, which is installed on /opt/SUNWmsgsr. This HAMessaging Server resource is dependent upon the HA disk resource, that is, the file system created earlier as well as the HA logical host name meadow.

  10. Verify that everything is working.

    Failover the Messaging Server resource back to the primary node.


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

3.4.3.1 How to Enable Debugging on Sun Cluster

Messaging Server Data Service Sun Cluster agents uses two APIs to log debug messages:

scds_syslog_debug()writes a debugging message to the system log at 1 level.

scds_syslog() writes a message to the system log at daemon.notice, daemon.info and daemon.error levels.

All syslog messages are prefixed with the following:


SC[resourceTypeName, resourceGroupName, resourceName,methodName]

For example:


Dec 11 18:24:46 mars SC[SUNW.ims,MS-RG,mail-rs,ims_svc_start]: [ID 831728daemon.debug]
Groupname mail exists. 
Dec 11 18:24:46 mars SC[SUNW.ims,MS-RG,mail-rs,ims_svc_start]: [ID 383726daemon.debug] 
Username mailsrv exists.
Dec 11 18:24:46 mars SC[SUNW.ims,MS-RG,mail-rs,ims_svc_start]: [ID 244341daemon.debug] 
IMS_serverroot = /opt/mars/SUNWmsgsr
Dec 11 15:55:52 mars SC[SUNW.ims,MS_RG,MessagingResource,ims_svc_validate]: 
[ID 855581daemon.error] Failed to get the configuration info
Dec 11 18:24:46 mars SC[SUNW.ims,MS-RG,mail-rs,ims_svc_start]: [ID 833212daemon.info]
Attempting to start the data service under process monitor facility.

To log messages from the Messaging Server Resource Type SUNW.ims, create the Resource Type Directory under /var/cluster as shown below:


mkdir -p /var/cluster/rgm/rt/SUNW.ims

To see all debugging messages for resource type SUNW.ims, issue the following command on all the nodes of your cluster:


echo 9 > /var/cluster/rgm/rt/SUNW.ims/loglevel

To suppress debugging messages for resource type SUNW.iws, issue the following command on all nodes of your cluster:


echo 0 > /var/cluster/rgm/rt/SUNW.ims/loglevel

To log debug messages from the Sun Cluster Data services and the most common debugging information from the Messaging Server Agents, edit the syslog.conf file. For example, to log all syslog messages to the file /var/adm/clusterlog, add the following line to the syslog.conf file:


daemon.debug /var/adm/clusterlog

This will log all messages at the following levels (emerg, alert, critical, error, warning, notice, information, debug). See syslog.conf man page for more information

Now restart the syslogd daemon:


pkill -HUP syslogd