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

Configuring Sun Cluster HA for mySQL in a Failover Zone

The configuration instructions in Sun Cluster Data Service for MySQL Guide for Solaris OS for release 3.1 8/05 apply to this release of Sun Cluster 3.1 8/05 software in the Sun Java Enterprise System 5 distribution except as noted in the sections that follow.

The following list describes feature additions to the Sun Cluster HA for mySQL data service:

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.

ProcedureHow to Modify Parameters in the Sun Cluster HA for mySQL Manifest

Perform this task to change parameters in theSun Cluster HA for mySQL manifest and to validate the parameters in the failover zone. Parameters for the Sun Cluster HA for mySQL manifest are stored as properties of the SMF service. To modify parameters in the manifest, change the related properties in the SMF service then validate the parameter changes.

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

  2. Change the Solaris Service Management Facility (SMF) properties for the Sun Cluster HA for mySQL manifest.


    # svccfg svc:/application/sczone-agents:resource
    

    For more information, see the svccfg(1M) man page.

  3. Validate the parameter changes.


    # /opt/SUNWscmys/bin/control_mysql validate resource
    

    Messages for this command are stored in the /var/adm/messages/ directory of the failover zone.

  4. Disconnect from the failover zone's console.

ProcedureHow to Remove a Sun Cluster HA for mySQL Resource From a Failover Zone

  1. Become superuser in the global zone.

  2. Disable and remove the resource that is used by the Sun Cluster HA for mySQL data service.


    # scswitch -n resource
    # scrgadm -r -j resource
    
  3. Log in as superuser to the failover zone's console.

  4. Unregister Sun Cluster HA for mySQL from the Solaris Service Management Facility (SMF) service.


    # /opt/SUNWscmys/ha_mysql_smf_remove -f filename
    
    -f

    Specifies the configuration file name.

    filename

    The name of the configuration file that you used to register Sun Cluster HA for mySQL with the SMF service.


    Note –

    If you no longer have the configuration file that you used to register Sun Cluster HA for mySQL with the SMF service, create a replacement configuration file:

    1. Make a copy of the default file, /opt/SUNWscmys/util/ha_mysql_config.

    2. Set the ZONE and RS parameters with the values that are used by the data service.

    3. Run the ha_mysql_smf_remove command and use the -f option to specify this configuration file.


  5. Disconnect from the failover zone's console.