This procedure uses the configuration file to register Sun Cluster HA for mySQL in a failover zone.
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.
Install Sun Cluster HA for Containers and Sun Cluster HA for mySQL data-service packages in the global zone of each cluster node that you want to run the failover zone.
Create the failover zone.
Inherit at least the directory that will contain the Sun Cluster HA for mySQL data service. To have all the data service directories in one location, inherit the /opt directory.
Configure the boot component to control your failover zone.
Become superuser in the global zone.
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.
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:
Set the name of the zone where Sun Cluster HA for mySQL should run.
Set the name of the resource that controls the zone.
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.
Keep this modified configuration file for possible future use.
Log in as superuser to the failover zone's console.
Install MySQL software in the zone.
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.
Register Sun Cluster HA for mySQL with SMF.
# ksh /opt/SUNWscmys/util/ha_mysql_register -f filename |
Specifies the configuration file name.
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.
Shut down the mySQL database.
# kill -TERM `cat MySQL-Databasedirectory/mysqld.pid |
Disconnect from the failover zone's console.