Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Cluster Data Service for MySQL Cluster Guide Oracle Solaris Cluster 4.1 |
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
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 the 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
Create the directory structure and configuration by performing the following steps on both nodes
phys-schost-1:/ # mkdir -p /mysql-data/logs /mysql-data/innodb phys-schost-2:/ # mkdir -p /mysql-data/logs /mysql-data/innodb
phys-schost-1: # cd /usr/local/mysql phys-schost-1:/usr/local/mysql # ./scripts/* --datadir=/mysql-data phys-schost-2: # cd /usr/local/mysql phys-schost-2:/usr/local/mysql # ./scripts/* --datadir=/mysql-data
Use the example values in the my.cnf File for the First SQL Node phys-schost-1 to Store in /mysql-data for phys-schost-1, and my.cnf File for the Second SQL Node phys-schost-2 to Store in /mysql-data for phys-schost-2.
phys-schost-1:/ # cp /temp/cluconfig/my.cnf-serv /mysql-data/my.cnf phys-schost-1:/ # chmod 644 /mysql-data/my.cnf phys-schost-2:/ # cp /temp/cluconfig/my.cnf-serv /mysql-data/my.cnf phys-schost-2:/ # chmod 644 /mysql-data/my.cnf
phys-schost-1:/ # chown -R mysql:dba /mysql-data phys-schost-2:/ # chown -R mysql:dba /mysql-data
phys-schost-1:/ # 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/phys-schost-1.log 2>&1 & EOF phys-schost-2:/ # 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/phys-schost-2.log 2>&1 &EOF
phys-schost-1:/ # . /temp/cluconfig/first phys-schost-2:/ # . /temp/cluconfig/first
phys-schost-2:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1,phys-schost-2 -e show
phys-schost-1:/ # /usr/local/mysql/bin/mysqladmin -S /tmp/phys-schost-1.sock \ > -uroot password 'root' phys-schost-2:/ # /usr/local/mysql/bin/mysqladmin -S /tmp/phys-schost-2.sock \ > -uroot password 'root'
phys-schost-1:/ # /usr/local/mysql/bin/mysql -S /tmp/phys-schost-1.sock \ > -uroot -proot mysql> use mysql; mysql> grant all on *.* to 'root'@'phys-schost-1' identified by 'root'; mysql> UPDATE user SET Grant_priv='Y' WHERE User='root' AND Host='phys-schost-1'; mysql> exit phys-schost-2:/ # /usr/local/mysql/bin/mysql -S /tmp/phys-schost-2.sock \ > -uroot -proot mysql> use mysql; 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-2'; mysql> exit
Use the content from mysql_config File for the First SQL Node phys-schost-1 to Store in /temp/cluconfig on phys-schost-1, and the content from mysql_config File for the Second SQL Node phys-schost-2 to Store in /temp/cluconfig on phys-schost-2.
On phys-schost-1
MYSQL_NIC_HOSTNAME=" phys-schost-1 "
On phys-schost-2
MYSQL_NIC_HOSTNAME=" phys-schost-2 "
phys-schost-1:/ # ksh /opt/SUNWscmys/util/mysql_register \ > -f /temp/cluconfig/mysql_config phys-schost-2:/ # ksh /opt/SUNWscmys/util/mysql_register \ > -f /temp/cluconfig/mysql_config
phys-schost-1:/ # pkill -f mysqld phys-schost-2:/ # pkill -f mysqld
phys-schost-1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1-p,phys-schost-2-p -e shutdown
phys-schost-1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1-p,phys-schost-2-p -e show phys-schost-2:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-2-p,phys-schost-1-p -e show
phys-schost-1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1-p,phys-schost-2-p -e "id stop"