JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Data Service for MySQL Guide     Oracle Solaris Cluster 4.1
search filter icon
search icon

Document Information

Preface

1.  Installing and Configuring HA for MySQL

A.  Deployment Example: Installing MySQL in the Global Zone

Target Cluster Configuration

Software Configuration

Assumptions

Installing and Configuring MySQL on Local Storage in the Global Zone

Example: Preparing the Cluster for MySQL

Example: Configuring Cluster Resources for MySQL

Example: Installing and Bootstrapping the MySQL Software on Local Storage

Example: Modifying the MySQL Configuration Files

Example: Enabling the MySQL Software to Run in the Cluster

B.  Deployment Example: Installing MySQL in the Non-Global HA Zone

C.  Deployment Example: Installing MySQL in a Scalable or Multiple-Master Configuration

Index

Example: Enabling the MySQL Software to Run in the Cluster

  1. Start the MySQL database manually on the node where the resource group is online.
    phys-schost-1# cd /usr/local/mysql
    phys-schost-1# ./bin/mysqld --defaults-file=/global/mnt3/mysql-data/my.cnf \
    --basedir=/usr/local/mysql --datadir=/global/mnt3/mysql-data \
    --pid-file=/global/mnt3/mysql-data/mysqld.pid \
    --user=mysql >> /global/mnt3/mysql-data/logs/ha-host-1.log 2>&1 &
  2. Set the password for localhost in MySQL to root.
    phys-schost-1# /usr/local/mysql/bin/mysqladmin -S /tmp/ha-host-1.sock -uroot \
    password 'root'
  3. Add an administrative user in the MySQL database for the logical host.
    phys-schost-1# /usr/local/mysql/bin/mysql -S /tmp/ha-host-1.sock -uroot -proot
    mysql> use mysql;
    mysql> GRANT ALL ON *.* TO 'root'@'phys-schost-1' IDENTIFIED BY 'root';
    mysql> GRANT ALL ON *.* TO 'root'@'phys-schost-2' IDENTIFIED BY 'root';
    mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='phys-schost-1';
    mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='phys-schost-2';
    mysql> exit
  4. Prepare the Oracle Solaris Cluster specific test database.
    phys-schost-1# ksh /opt/SUNWscmys/util/mysql_register \
    -f /global/mnt3/mysql_config
    1. Enter root when you are asked for the MySQL admin password.

      You set it to root in Step 3.

    2. Enter a password when you are prompted for the fault monitor user password.
  5. Stop the MySQL database.
    phys-schost-1# kill -TERM `cat /global/mnt3/mysql-data/mysqld.pid`
  6. Make the /global/mnt3/ha_mysql_config file available on all nodes to run the MySQL database.
  7. Encrypt the fault monitor user password on all nodes to run the MySQL database.
    phys-schost-1# ksh /opt/SUNWscmys/util/ha_mysql_register \
    -f /global/mnt3/ha_mysql_config -e
    phys-schost-2# ksh /opt/SUNWscmys/util/ha_mysql_register \
    -f /global/mnt3/ha_mysql_config -e

    Enter the same password you provided in Step 4 when you are prompted for the fault monitoring user password.

  8. Run the ha_mysql_register script to register the resource.
    phys-schost-1# ksh /opt/SUNWscmys/util/ha_mysql_register \
    -f /global/mnt3/ha_mysql_config
  9. Enable the resource.
    phys-schost-1# clresource enable RS-MYS