The requirements in this section apply to Sun Cluster HA for MySQL only. You must meet these requirements before you proceed with your Sun Cluster HA for MySQL installation and configuration.
Your data service configuration might not be supported if you do not adhere to these requirements.
MySQL components and their dependencies —You can configure Sun Cluster HA for MySQL data service to protect a MySQL instance and its respective components. The components, and their dependencies between each other, are briefly described below.
In the above example the Database directory for the MySQL instance 1 is /local/mysql-data-1, whereas the Database directory for the MySQL instance 2 is /local/mysql-data-2.
Component |
Dependency |
---|---|
MySQL resource in a Solaris 10 global zone,zone or in Solaris 9. |
SUNW.HAStoragePlus This dependency is required only, if the configuration uses a failover file system or file systems in a zone. SUNW.LogicalHostName |
MySQL resource in a Solaris 10 HA container. |
Sun Cluster HA for the Solaris Container boot resource. SUNW.HAStoragePlus SUNW.LogicalHostName — This dependency is required only if the zones boot resource does not manage the zone's IP address. |
The MySQL component has two configuration and registration files in /opt/SUNWscmys/util. These files allow you to register the MySQL component with Sun Cluster and prepare a MySQL instance to be registered.
Within these files, the appropriate dependencies have been applied.
# cd /opt/SUNWscmys # more util/*config :::::::::::::: ha_mysql_config :::::::::::::: # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "@(#)ha_mysql_config.ksh 1.3 06/03/08 SMI" # This file will be sourced in by ha_mysql_register and the parameters # listed below will be used. # # These parameters can be customized in (key=value) form # # RS - name of the resource for the application # RG - name of the resource group containing RS # # To have the mysql agent local zone aware, 4 Variables are needed: # ZONE - the zone name where the Mysql Database should run in # Optional # ZONEBT - The resource name which controls the zone. # Optional # PROJECT - A project in the zone, that will be used for this service # specify it if you have an su - in the start stop or probe, # or to define the smf credentials. If the variable is not set, # it will be translated as :default for the sm and default # for the zsh component # Optional # ZUSER - A user in the the zone which is used for the smf method # credentials. Yur smf servic e will run under this user # Optional # # Mysql specific Variables # # BASEDIR - name of the Mysql bin directory # DATADIR - name of the Mysql Data directory # MYSQLUSER - name of the user Mysql should be started of # LH - name of the Logical Hostname Sun Cluster resource # MYSQLHOST - name of the host in /etc/hosts # FMUSER - name of the Mysql fault monitor user # FMPASS - name of the Mysql fault monitor user password # LOGDIR - name of the directory mysqld should store it's logfile. # CHECK - should HA-MySQL check MyISAM index files before start YES/NO. # HAS_RS - name of the MySQL HAStoragePlus Sun Cluster resource # # The following examples illustrate sample parameters # for Mysql # # BASEDIR=/usr/local/mysql # DATADIR=/global/mysqldata # MYSQLUSER=mysql # LH=mysqllh # MYSQLHOST=mysqllh # FMUSER=fmuser # FMPASS=fmuser # LOGDIR=/global/mysqldata/logs # CHECK=YES # RS= RG= PORT= LH= HAS_RS= # local zone specific options ZONE= ZONE_BT= PROJECT= # mysql specifications BASEDIR= DATADIR= MYSQLUSER= MYSQLHOST= FMUSER= FMPASS= LOGDIR= CHECK= :::::::::::::: mysql_config :::::::::::::: # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "@(#)mysql_config.ksh 1.3 06/03/08 SMI" # This file will be sourced in by mysql_register and the parameters # listed below will be used. # # Where is mysql installed (BASEDIR) MYSQL_BASE= # Mysql admin-user for localhost (Default is root) MYSQL_USER= # Password for mysql admin user MYSQL_PASSWD= # Configured logicalhost MYSQL_HOST= # Specify a username for a faultmonitor user FMUSER= # Pick a password for that faultmonitor user FMPASS= # Socket name for mysqld ( Should be /tmp/<logical-host>.sock ) MYSQL_SOCK= # Specify the physical hostname for the physical NIC that this logical hostname # belongs to for every node in the cluster this Resource group can be located on. # IE: The logicalhost lh1 belongs to hme1 for physical-node phys-1 and # hme3 for physical-node phys-2. The hostname for hme1 is phys-1-hme0 and # for hme3 on phys-2 it is phys-2-hme3. # IE: MYSQL_NIC_HOSTNAME="phys-1-hme0 phys-2-hme3" MYSQL_NIC_HOSTNAME= # Where are your databases installed? (location of my.cnf) MYSQL_DATADIR= # |
my.cnf file — The Sun Cluster HA for MySQL data service provides two sample my.cnf files, one sample file for a master configuration and one for a slave configuration. However, ensure that at least the following parameters are set.
The my.cnf file is a important file within MySQL. Refer to the MySQL Documentation for complete configuration information on the parameters that follow.
MySQL my.cnf file in [mysqld]section in a master configuration
bind address must be set to the defined logical host's IP name.
Some MySQL do not work with bind address if the name of the logical host is set. In these cases do not set the bind address parameter, or use the absolute address of the logical hostname.
socket is defined as /tmp/logical host's ip name.sock.
binlog-ignore-db contains sc3_test_database, if log-bin option is being used.
MySQL my.cnf file in [mysqld]section in a slave configuration
bind address must be set to the defined logical host's IP name.
Some MySQL builds do not work with names in the bind address parameter. In these cases do not set the bind address parameter, or use the absolute IP address of the logical hostname.
socket is defined as /tmp/logical host's IP name.sock.
binlog-ignore-db contains sc3_test_database if log-bin option is being used.
master—host is the hostname where the master instance resides.
master—user is the username the slave will use for identification to the master.
master—password is the password the slave will use for identification to the master.
master-info-file is the location of the file that remembers where MySQL left off on the master during the replication process. This file must be placed on a GFS/FFS.