Sun Cluster 2.2 Software Installation Guide

Chapter 7 Setting Up and Administering Sun Cluster HA for Informix

This chapter provides instructions for setting up and administering the Sun Cluster HA for Informix data service on your Sun Cluster nodes.

This chapter includes the following procedures:

7.1 Preparing to Install Sun Cluster HA for Informix

Use the information in this section to prepare Sun Cluster nodes for Sun Cluster HA for Informix installation.

7.1.1 Selecting an Install Location for Sun Cluster HA for Informix

You can install the Informix binaries either on a physical host's local disks or on the shared multihost disks (logical host). Use Table 7-1, which shows the advantages and disadvantages of each install location, to determine the install location that best fits your needs.

Table 7-1 Informix Install Locations Comparison

Install Location 

Advantages 

Disadvantages 

Multihost Disks 

  • Eases administration - only one copy must be maintained

  • Sacrifices redundancy

  • In some cases, compromises availability

  • In cases of switchover or accidental removal of Informix binaries, may cause Informix to be unavailable

  • Requires a mirror, so disk space must be doubled

Local Disks 

  • Increases redundancy - each node is a copy

  • Increases administrative overhead - multiple copies must be maintained

7.1.2 Setting Up the /etc/nsswitch.conf File

On each node that can master the logical host running Sun Cluster HA for Informix, modify the /etc/nsswitch.conf file so that "group" lookups are directed to files first. For example:

...
 group: files nisplus
 ...

Sun Cluster HA for Informix uses the su informix command when starting and stopping the database server.

Adding this setting will ensure that the su informix command does not refer to NIS or NIS+ when the network information name service is not available due to a failure of the public network.

7.1.3 Setting Up Multihost Disks for Sun Cluster HA for Informix

If you are using Solstice DiskSuite, you can configure Sun Cluster HA for Informix to use UFS logging or raw mirrored metadevices. Refer to Appendix B, Configuring Solstice DiskSuite," for details about setting up metadevices.

If you are using Sun StorEdge Volume Manager, you can configure Sun Cluster HA for Informix to use VxFS logging or raw devices. Refer to your Sun StorEdge Volume Manager documentation for more information.

7.2 Installing Sun Cluster HA for Informix

Use the procedures in this section to prepare the Sun Cluster nodes, to install the Informix software, to create Informix databases, and to set up Sun Cluster HA for Informix.

Before setting up Sun Cluster HA for Informix, you must have configured the Sun Cluster software on each node by using the procedures described in Chapter 3, Installing and Configuring Sun Cluster Software.

If you are running both Sun Cluster HA for NFS and Sun Cluster HA for Informix in your cluster, you can set up the data services in any order.

7.2.1 How to Prepare the Nodes and Install the Informix Software

These are the high-level steps to prepare Sun Cluster nodes for Informix installation and install the Informix software:


Caution - Caution -

Perform all steps described in this section on all Sun Cluster nodes.


Consult your Informix documentation before performing this procedure.

These are the detailed steps to prepare Sun Cluster nodes and install the Informix software.

  1. Prepare the environment for Informix installation.

    Choose a location for the $INFORMIXDIR directories, on either a local or multihost disk.


    Note -

    If you choose to install $INFORMIXDIR on a local disk, install it as a file system on its own disk, separate from the operating environment, if possible. This prevents Informix from being overwritten if the operating environment is reinstalled.


  2. On each node, create an entry for the informix group in the /etc/group file.

    The group normally is named informix. Verify that users root and informix are members of the informix group. For example:

    informix:*:520:root,informix 

    While you can make the name service entries in a network name service (for example, NIS or NIS+) so that the information is available to Sun Cluster HA for Informix clients, you also should make entries in the local /etc files to eliminate dependency on the network name service.


    Note -

    You must replicate this information on each cluster node.


  3. On each node, create an entry for the informix user (informix_id) group in the /etc/passwd file.

    This entry normally is named informix. For example:

    # useradd -u 135 -g informix -d /informix informix
    
  4. Verify that the $INFORMIXDIR directory is owned by informix_id and is included in the informix group.

    # chown informix $INFORMIXDIR
     # chgrp informix $INFORMIXDIR
    

    If $INFORMIXDIR is a symbolic link to the Informix home directory, then use the following command:

    # chown informix $INFORMIXDIR
     # chgrp informix $INFORMIXDIR
     # chown -h $INFORMIXDIR
     # chgrp -h $INFORMIXDIR
    
  5. Note the requirements for Informix installation.

    Informix binaries can be installed on either the local disks of the physical host or the multihost disks. See "7.1.1 Selecting an Install Location for Sun Cluster HA for Informix"," for more information.


    Note -

    If you plan to install Informix software on the multihost disks, you first must start Sun Cluster and take ownership of the disk group. You also must install the INFORMIX_ESQL Embedded Languages Runtime Facility product in the /var/opt/informix file on all nodes running Sun Cluster HA for Informix by using the installesql command. See "7.2.2 Creating an Informix Database and Setting Up Sun Cluster HA for Informix"," for details.


  6. Install the Informix software.

    Log in as informix to ensure ownership of the entire directory before performing this step. If Informix is installed on a multihost disk, verify that the /var/opt/informix/bin directory is owned by Informix owner informix_id on all cluster nodes; this is not necessary if Informix is installed on the local disk.

    For complete instructions on installing Informix, refer to the Informix installation documentation.

7.2.2 Creating an Informix Database and Setting Up Sun Cluster HA for Informix

Use the following procedures to create and set up the initial Informix database in a Sun Cluster configuration. If you are creating and setting up additional databases, perform only the procedures described in "7.2.4 How to Create an Informix Database" and "7.2.5 How to Set Up Sun Cluster HA for Informix".

7.2.3 How to Prepare Logical Hosts for Informix Databases

  1. Make sure Sun Cluster is started and the node owns the disk groups.

    If necessary, as root, use the scadmin(1M) command.

    # scadmin startcluster
    

    This command causes the node to take disk group ownership.

  2. Configure the disk devices for use by your volume manager.

    1. If you are using Solstice DiskSuite, set up UFS logging devices or raw mirrored metadevices on all nodes that will be running Sun Cluster HA for Informix.

      If you will be using raw mirrored metadevices to contain the databases, change the owner, group, and mode of each of the raw mirrored metadevices. If you are not using raw mirrored metadevices, skip this step.


      Caution - Caution -

      While Informix supports raw I/O to both raw physical devices and raw metadevices (mirrored or nonmirrored), Sun Cluster only supports raw Informix I/O on raw mirrored volumes or metadevices. You cannot use devices such as /dev/rdsk/c1t1d1s2 to contain Informix data under Sun Cluster.


      Instructions for creating mirrored metadevices are provided in Appendix B, Configuring Solstice DiskSuite."

      If you are creating raw mirrored metadevices, type the following commands for each metadevice.

      # vxvol set owner=informix_id group=dba_id mode=600 \
       /dev/vx/rdsk/diskgroup_name/volume_name
      
      # chown informix_id /dev/md/diskset/rdsk/dn
       # chgrp informix_id /dev/md/diskset/rdsk/dn
       # chmod 600 /dev/md/diskset/rdsk/dn
      
    2. If you are using Sun StorEdge Volume Manager, set up VxFS logs or raw devices on all Sun Cluster nodes.

      If you will be using raw devices to contain the databases, change the owner, group, and mode of each device. If you are not using raw mirrored metadevices, skip this step. See your Sun StorEdge Volume Manager documentation for further details. Type the following commands for each raw device:

      # chown informix_id /dev/vx/rdsk/diskgroup_name/volume_name
       # chgrp informix_id /dev/vx/rdsk/diskgroup_name/volume_name
       # chmod 600 /dev/vx/rdsk/diskgroup_name/volume_name
      

7.2.4 How to Create an Informix Database

These are the high-level steps to create an Informix database:

These are the detailed steps to create an Informix database:

  1. Prepare the Informix environment.

    Prepare the Informix environment using the following commands. In csh:

    # setenv INFORMIXDIR base_dir
     # setenv INFORMIXSERVER server_name
     # setenv ONCONFIG file_name
     # setenv INFORMIXSQLHOSTS $INFORMIXDIR/etc/sqlhosts
    
  2. Create and customize the $ONCONFIG file, and copy it to all other nodes in the cluster.

    Place the $ONCONFIG file in the $INFORMIXDIR/etc directory. Customize the ROOTPATH, ROOTSIZE, and PHYSFILE variables in the $ONCONFIG file, and set DBSERVERNAME=$INFORMIXSERVER. Once the $ONCONFIG file is customized, copy it to the other nodes in the cluster, if $INFORMIXDIR is on the local disk of the physical host.

  3. Create Informix entries in the $INFORMIXSQLHOSTS file.

    Entries in the sqlhosts file are composed of four fields:

    • DBSERVERNAME - This is the $INFORMIXSERVER.

    • NETTYPE - Select ONSOCTCP or ONTLITCP.

    • HOSTNAME - This is the logical host name.

    • SERVICENAME - This must match the SERVICENAME entry in the /etc/services file.

    If you are installing the Informix binaries on the multihost disks, replicate the sqlhosts file on both local disks and on the multihost disks under /var/opt/informix. If you are installing the Informix binaries on the local disks, replicate the sqlhosts file on both local disks.

  4. Configure the /etc/services file.

    You must be root to perform this step. Edit the /etc/services file; add the SERVICENAME and listener port number. The listener port number must be unique.

    When you use the TCP/IP connection protocol, the SERVICENAME entry in the sqlhosts file must correspond to the SERVICENAME entry in the /etc/services file.

7.2.5 How to Set Up Sun Cluster HA for Informix

These are the high-level steps to set up Sun Cluster HA for Informix:

These are the detailed steps to set up Sun Cluster HA for Informix.

  1. Update the /var/opt/informix/inftab file with $ONCONFIG information.

    You must include entries for all $ONCONFIG files associated with your databases in the /var/opt/informix/inftab file on all nodes running Sun Cluster HA for Informix. You must keep this file current on all nodes running Sun Cluster HA for Informix for a failover to succeed. Update the file manually as database servers are added or removed.

    Entries in the /var/opt/informix/inftab file have the following format:

    $ONCONFIG:$INFORMIXDIR

    $ONCONFIG is the name of the ONCONFIG file. $INFORMIXDIR is the path to the Informix installation directory. For example, the inftab file might look similar to the following:

    onconfig.node1:/export/home/informix
  2. Activate the Informix data service.

    Log in as user informix and invoke the oninit command, which formats or "cooks" the raw disk or UFS filespace assigned in the $ONCONFIG file as specified by the ROOTPATH variable.

    # oninit -iy
    
  3. Create entries in the /etc/hosts.equiv file or the ~informix/.rhosts file that grant permissions to the informix user to access the database from other cluster nodes.

    These entries have the following format:

    hostname informix
    

    where hostname is the name of the other cluster nodes and informix is the user name.

  4. Enable access for the user and password to be used for fault monitoring.

    Invoke the dbaccess dbname command and add the following lines to the appropriate dbaccess screen.

    # dbaccess dbname -
    ...
     grant connect to root;
     grant resource to root;
     grant dba root;
     grant select on sysprofile to root;

    The database to be probed by the HA fault monitor is identified by the database name (dbname). If that dbname is not defined as sysmaster, use the dbaccess dbname command to add the following line to the appropriate dbaccess screen:

    create synonym sysprofile for sysmaster:informix_owner.sysprofile;
  5. Shut down the Informix database.

    As user informix, use the onmode command to shut down the Informix database:

    # onmode -ky
    
  6. Verify that Sun Cluster is installed and running on all nodes that will run Sun Cluster HA for Informix.

    As root, verify the configuration with the hastat command:

    # hastat
    

    If the cluster nodes are not running already, start them. The first node must be started using the scadmin startcluster command and all other nodes are then started using the scadmin startnode command. Refer to the scadmin(1M) man page for more information on starting the cluster.

  7. Register and activate the Informix data service by using the hareg(1M) command.

    Run the hareg(1M) command on only one host.

    If the Informix data service is not yet registered, use the hareg(1M) command to register it. To register the data service only on the logical host, include the -h option and logical host name:

    # hareg -s -r informix [-h logicalhost]

    If the cluster is running already, use the hareg(1M) command to activate the Informix data service:

    # hareg -y informix
    
  8. Bring Informix under control of Sun Cluster HA for Informix.

    Run the following command so that the instance will be monitored by Sun Cluster.

    # hainformix insert $ONCONFIG logicalhost 60 10 120 300 \
     dbname $INFORMIXSERVER
    

    The above command line includes the following:

    • hainformix insert - Command and subcommand

    • $ONCONFIG - Name of the Informix configuration file

    • logicalhost - Logical host serving $ONCONFIG (not the physical host)

    • -60 -10 -120 -300 - Parameters which specify a probe cycle time of 60 seconds, a connectivity probe cycle count of 10, a probe time out of 120 seconds, and a restart delay of 300 seconds

    • dbname - Name of the database that Sun Cluster 2.2 is to monitor

    • $INFORMIXSERVER - Name of the Informix server

    See the hainformix(1M) man page for details on all options to hainformix(1M).

  9. Bring the Sun Cluster HA for Informix database into service.

    Bring the Sun Cluster HA for Informix database into service by using the hainformix(1M)command.

    # hainformix start $ONCONFIG
    

    Note -

    If you did not start the Informix OnLine server before this step, then Sun Cluster will start the Informix OnLine Server for you when you issue the hainformix start command.


7.2.6 Setting Up Sun Cluster HA for Informix Clients

Clients always must refer to the database using the logical host name and not the physical host name. Except during start-up, the database always should be available if the logical host is responding on the network.


Note -

Informix client-server connections will not survive a Sun Cluster HA for Informix switchover. The client application must be prepared to handle disconnection and reconnection or recovery as appropriate. A transaction monitor might simplify the application. Further, Sun Cluster HA for Informix server recovery time is application-dependent.


If your application uses functions from RDBMS dynamic link libraries, you must ensure that these libraries are available in the event of failover. To do so:

7.3 Verifying the Sun Cluster HA for Informix Installation

Perform the following verification tests to ensure the Sun Cluster HA for Informix installation was performed correctly.

The purpose of these sanity checks is to ensure that the Informix OnLine server can be started by all Sun Cluster nodes running Sun Cluster HA for Informix and can be accessed successfully by the other nodes in the configuration.

7.3.1 How to Verify the Sun Cluster HA for Informix Installation

  1. Log in to the Sun Cluster node mastering the logical host, and set the Informix environment variables.

    Log in as informix to the node that currently masters the logical host. Set the environment variables INFORMIXDIR, INFORMIXSERVER, ONCONFIG, and INFORMIXSQLHOSTS.

    1. Confirm that you can start the Informix OnLine server from this host.

    2. Confirm that you can connect to the Informix OnLine server from this host:

      # dbaccess sysmaster@$INFORMIXSERVER
      
    3. Shut down the Informix OnLine server.

  2. Transfer the logical host to another node in the cluster.

    Use the haswitch(1M) command to transfer the logical host containing the Informix OnLine server to another node.

  3. Log in to the node now mastering the logical host, and repeat the checks listed in Step 1.

    Log in as informix to the new master node, and confirm interactions with the Informix OnLine server.