Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Cluster Data Service for MySQL Guide Oracle Solaris Cluster 3.3 3/13 |
1. Installing and Configuring HA for MySQL
A. Deployment Example: Installing MySQL in the Global Zone
B. Deployment Example: Installing MySQL in the Non-Global HA Container
C. Deployment Example: Installing MySQL in a Non-Global Zone
Installing and Configuring MySQL on Local Storage in a Non-Global Zone
Example: Preparing the Cluster for MySQL
Example: Configuring Cluster Resources for MySQL
Example: Installing the MySQL Software on Local Storage
Example: Bootstrapping the MySQL Software on Local Storage
Example: Modifying the MySQL Configuration File
D. Deployment Example: Installing MySQL in a Scalable or Multiple-Master Configuration
This task will initialize and prepare your database. It is essential that you perform it on one node only. It is assumed that you are still logged in to this zone.
zone-1# cd /usr/local/mysql zone-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 &
zone-1# /usr/local/mysql/bin/mysqladmin -S /tmp/ha-host-1.sock -uroot \ password 'root'
zone-1# /usr/local/mysql/bin/mysql -S /tmp/ha-host-1.sock -uroot -proot mysql> use mysql; mysql> GRANT ALL ON *.* TO 'root'@'zone-1' IDENTIFIED BY 'root'; mysql> GRANT ALL ON *.* TO 'root'@'zone-2' IDENTIFIED BY 'root'; mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='zone-1'; mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='zone-2'; mysql> exit
zone-1# ksh /opt/SUNWscmys/util/mysql_register -f /global/mnt3/mysql_config
When prompted for the MySQL administrative password, enter root. This is the password you set in Step 3.
When prompted for the fault monitor user password, enter a password.
zone-1# kill -TERM `cat /global/mnt3/mysql-data/mysqld.pid`
zone# ksh /opt/SUNWscmys/util/ha_mysql_register \ -f /global/mnt3/ha_mysql_config -3
Enter the same fault monitor user password that you supplied in Step 4.
phys-schost-1# cp /opt/SUNWscmys/util/ha_mysql_config /global/mnt3
The following listing shows the relevant file entries and the values to assign to each entry.
… RS=RS-MYS RG=RG-MYS PORT=5432 LH=ha-host-1 HAS_RS=RS-MYS-HAS … BASEDIR=/usr/local/mysql DATADIR=/global/mnt3/mysql-data MYSQLUSER=mysql MYSQLHOST=ha-host-1 FMUSER=fmuser FMPASS= LOGDIR=/global/mnt3/mys-data/logs CHECK=YES
phys-schost-1# ksh /opt/SUNWscmys/util/ha_mysql_register \ -f /global/mnt3/ha_mysql_config
phys-schost-1# clresource enable RS-MYS