Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Cluster Data Service for MySQL Cluster Guide Oracle Solaris Cluster 3.3 3/13 |
1. Installing and Configuring HA for MySQL Cluster
A. Files for Configuring HA for MySQL Cluster
B. Deployment Example: Installing MySQL Cluster in the Global Zone
C. Deployment Example: Installing MySQL Cluster in a Non-Global Zone
How to Install MySQL Cluster Software
Setting Up the MySQL Cluster Control
How to Configure the Management Server on Both Nodes
How to Configure the Data Nodes on Both Nodes
How to Create the HA for MySQL Cluster Configuration With Scalable Services
Example Configuration Files for Installation in a Non-Global Zone
config.ini File for Both Nodes to Store in /mgm-data
my.cnf File for the Data Nodes to Store in /ndbd-data
my.cnf File for the First SQL Node phys-schost-1 to Store in /mysql-data
my.cnf File for the Second SQL Node phys-schost-2 to Store in /mysql-data
mysql_config File for the First SQL Node phys-schost-1 to Store in /temp/cluconfig
mysql_config File for the Second SQL Node phys-schost-2 to Store in /temp/cluconfig
mysql_ndb_mgmd_config File for the First Node phys-schost-1
mysql_ndb_mgmd_config File for the Second Node phys-schost-2
mysql_ndbd_config File for the First Node phys-schost-2
mysql_ndbd_config File for the Second Node phys-schost-2
ndbd_shutdown_config File for One Node
zone1:/ # mkdir -p /mysql-data/logs /mysql-data/innodb zone2:/ # mkdir -p /mysql-data/logs /mysql-data/innodb
zone1: # cd /usr/local/mysql zone1:/usr/local/mysql # ./scripts/* --datadir=/mysql-data zone2: # cd /usr/local/mysql zone2:/usr/local/mysql # ./scripts/* --datadir=/mysql-data
Create the corresponding my.cnf file in /temp/cluconfig/my.cnf-serv, adjust the parameters as appropriate, and change the permissions.
Prepare the my.cnf-serv file in /temp/cluconfig with the example values in the my.cnf File for the First SQL Node phys-schost-1 to Store in /mysql-data for zone1 and my.cnf File for the Second SQL Node phys-schost-2 to Store in /mysql-data for zone2.
zone1:/ # cp /temp/cluconfig/my.cnf-serv /mysql-data/my.cnf zone1:/ # chmod 644 /mysql-data/my.cnf zone2:/ # cp /temp/cluconfig/my.cnf-serv /mysql-data/my.cnf zone2:/ # chmod 644 /mysql-data/my.cnf
zone1:/ # chown -R mysql:dba /mysql-data zone2:/ # chown -R mysql:dba /mysql-data
Adapt the values for your configuration.
zone1:/ # cat >/temp/cluconfig/first <<EOF /usr/local/mysql/bin/mysqld --defaults-file=/mysql-data/my.cnf \ --basedir=/usr/local/mysql --datadir=/mysql-data \ --pid-file=/mysql-data/mysqld.pid \ --user=mysql >> /mysql-data/logs/zone1.log 2>&1 & EOF zone2:/ # cat >/temp/cluconfig/first <<EOF /usr/local/mysql/bin/mysqld --defaults-file=/mysql-data/my.cnf \ --basedir=/usr/local/mysql --datadir=/mysql-data \ --pid-file=/mysql-data/mysqld.pid \ --user=mysql >> /mysql-data/logs/zone2.log 2>&1 & EOF
zone1:/ # . /temp/cluconfig/first zone2:/ # . /temp/cluconfig/first
zone1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=zone1,zone2 -e show
zone1:/ # /usr/local/mysql/bin/mysqladmin -S /tmp/zone1.sock \ > -uroot password 'root' zone2:/ # /usr/local/mysql/bin/mysqladmin -S /tmp/zone2.sock \ > -uroot password 'root'
zone1:/ # /usr/local/mysql/bin/mysql -S /tmp/zone1.sock \ > -uroot -proot mysql> use mysql; mysql> grant all on *.* to 'root'@'zone1' identified by 'root'; mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='zone1'; mysql> exit zone2:/ # /usr/local/mysql/bin/mysql -S /tmp/zone2.sock \ > -uroot -proot mysql> use mysql; mysql> grant all on *.* to 'root'@'zone2' identified by 'root'; mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='zone2'; mysql> exit
Use the content from mysql_config File for the First SQL Node phys-schost-1 to Store in /temp/cluconfig on zone1 and the content from mysql_config File for the Second SQL Node phys-schost-2 to Store in /temp/cluconfig on zone2.
On zone1, set the following value:
MYSQL_NIC_HOSTNAME=" zone1 "
On zone2, set the following value:
MYSQL_NIC_HOSTNAME=" zone2 "
zone1:/ # ksh /opt/SUNWscmys/util/mysql_register \ > -f /temp/cluconfig/mysql_config zone2:/ # ksh /opt/SUNWscmys/util/mysql_register \ > -f /temp/cluconfig/mysql_config
zone1:/ # pkill -f mysqld zone2:/ # pkill -f mysqld
zone1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1-p,phys-schost-2-p -e shutdown
zone1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=zone_1_p,zone_2_p -e show
zone1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=zone_1_p,zone_2_p -e "id stop"
Leave the non-global zone on both nodes.