Sun Cluster 3.1 8/05 With Sun Java Enterprise System 5 Special Instructions

ProcedureHow to Register Sun Cluster HA for mySQL in a Failover Zone

This procedure uses the configuration file to register Sun Cluster HA for mySQL in a failover zone.

Before You Begin

Before you register Sun Cluster HA for mySQL in a failover zone, perform the following tasks. Follow procedures in Sun Cluster Data Service for Solaris Containers Guide and Sun Cluster Data Service for MySQL Guide for Solaris OS.

  1. Become superuser in the global zone.

  2. Make a copy of the /opt/SUNWscmys/util/ha_mysql_config file to use as your configuration file.

    You can place this configuration file in any directory that is accessible to the failover zone.

  3. Open your configuration file for editing and modify the variables for non-global zones.

    These variables are used only when the data service is installed in a non-global zone. Set the values of these variables as follows:

    ZONE

    Set the name of the zone where Sun Cluster HA for mySQL should run.

    ZONE_BT

    Set the name of the resource that controls the zone.

    PROJECT

    Set the name of the Sun Resource Manager Project in the failover zone. If the PROJECT variable is omitted from the configuration file, the data service uses the default project of the user, :default, in a Solaris Service Management Facility (SMF) context. This project name is placed in the start/project property and the stop/project property of the SMF service.


    Note –

    Keep this modified configuration file for possible future use.


  4. Log in as superuser to the failover zone's console.

  5. Install MySQL software in the zone.

  6. Prepare the mySQL database.

    Follow instructions in How to Verify the Installation and Configuration of MySQL in Sun Cluster Data Service for MySQL Guide for Solaris OS and How to Register and Configure Sun Cluster HA for MySQL as a Failover Service in Sun Cluster Data Service for MySQL Guide for Solaris OS. This step includes the following tasks:

    • Start the mySQL database.

    • Configure the access rights of the mySQL database.

    • Make a copy of the /opt/SUNWscmys/util/mysql_config file.

    • Modify the configuration file.

    • Register the database by using the modified configuration file.

  7. Register Sun Cluster HA for mySQL with SMF.


    # ksh /opt/SUNWscmys/util/ha_mysql_register -f filename
    
    -f

    Specifies the configuration file name.

    filename

    The configuration file name.

    The registration of Sun Cluster HA for mySQL generates an SMF manifest and registers an SMF service in the failover zone that is specified by the ZONE variable in the configuration file. The manifest is named resourcename.xml, where resource is the name that is specified by the RS variable in the configuration file. This manifest is placed in the /var/svc/manifest/application/sczone-agents/ directory. The SMF service is named svc:/application/sczone-agents/resource.

    The Sun Cluster HA for mySQL data service uses the SMF component of the Sun Cluster HA for Containers data service to control and probe this SMF service of the Sun Cluster HA for mySQL. It registers a Sun Cluster HA for Containers SMF component on top of the already-created SMF service. The name of the script that starts and stops the manifest as well as probes the SMF component is control_sctomcat.

  8. Shut down the mySQL database.


    # kill -TERM `cat MySQL-Databasedirectory/mysqld.pid
    
  9. Disconnect from the failover zone's console.