Sun Cluster 2.2 Software Installation Guide

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 "How to Create an Informix Database" and "How to Set Up Sun Cluster HA for Informix".

How to Prepare Logical Hosts for Informix Databases
  1. Make sure Sun Cluster is started and the node owns the disk groups.

    To start up the cluster, use scadmin(1M) command, as root. This command starts the cluster and assigns ownership of the disk group to the node you specify.


    # scadmin startcluster physicalhost clustername
    

    If the cluster already exists and the node is in the cluster, use the following command to ensure ownership of the disk group:


    # haswitch physicalhost logicalhost
    

  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 VERITAS 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 VERITAS 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
      

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. Do not select a port number that is already reserved by Sun Cluster or Solaris. See "Default Port Numbers Reserved by Sun Cluster" for details.

    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.

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.