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 Initialize the MySQL Server
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
phys-schost-1:/ # clresourcegroup create access-rg phys-schost-1:/ # clressharedaddress create -g access-rg sa_host_1 phys-schost-1:/ # clresourcegroup online -eM access-rg phys-schost-1:/ # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 mgm-rg phys-schost-1:/ # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 ndbd-rg phys-schost-1:/ # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 \ > mysql-rg phys-schost-1:/ # clresourcegroup set -p rg_affinities=++ndbd-rg mysql-rg
Note - Setting the ++ affinity ensures that on a restart of a single node, the start order of the resources is maintained as set within the resource dependencies.
phys-schost-1:/ # mkdir /cluster-pfiles phys-schost-2:/ # mkdir /cluster-pfiles
phys-schost-1:/ # clresourcetype register gds
Use the content of mysql_ndb_mgmd_config File for the First Node phys-schost-1 for phys-schost-1 and mysql_ndb_mgmd_config File for the Second Node phys-schost-2 for phys-schost-2.
ID=1 for phys-schost-1 ID=2 for phys-schost-2
Value for phys-schost-1:
CONNECT_STRING=phys-schost-1,phys-schost-2
Value for phys-schost-2:
CONNECT_STRING=phys-schost-2,phys-schost-1
phys-schost-1:/ # ksh /opt/SUNWscmys/ndb_mgmd/util/mysql_ndb_mgmd_register \ > -f /temp/cluconfig/mysql_ndb_mgmd_config -p phys-schost-2:/ # ksh /opt/SUNWscmys/ndb_mgmd/util/mysql_ndb_mgmd_register \ > -f /temp/cluconfig/mysql_ndb_mgmd_config -p
phys-schost-1:/ # ksh /opt/SUNWscmys/ndb_mgmd/util/mysql_ndb_mgmd_register \ > -f /temp/cluconfig/mysql_ndb_mgmd_config phys-schost-1:/ # clresourcegroup online -eM mgm-rg phys-schost-1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-1-p,phys-schost-2-p -e show phys-schost-1:/ # /usr/local/mysql/bin/ndb_mgm \ > --ndb-connectstring=phys-schost-2-p,phys-schost-1-p -e show
Use the content of mysql_ndbd_config File for the First Node phys-schost-2 for phys-schost-1 and mysql_ndbd_config File for the Second Node phys-schost-2 for phys-schost-2.
ID=3 for phys-schost-1 ID=4 for phys-schost-2
phys-schost-1:/ # ksh /opt/SUNWscmys/ndbd/util/mysql_ndbd_register \ > -f /temp/cluconfig/mysql_ndbd_config -p phys-schost-2:/ # ksh /opt/SUNWscmys/ndbd/util/mysql_ndbd_register \ > -f /temp/cluconfig/mysql_ndbd_config -p
phys-schost-1:/ # ksh /opt/SUNWscmys/ndbd/util/mysql_ndbd_register \ > -f /temp/cluconfig/mysql_ndbd_config phys-schost-1:/ # clresourcegroup online -eM ndbd-rg
Note - Do not take the ndbd-rg offline until you create and enable the shutdown controller resource.
Use the content of ndbd_shutdown_config File for One Node.
phys-schost-1:/ # ksh /opt/SUNWscmys/ndbd_shutdown/util/ndbd_shutdown_register \ > -f /temp/cluconfig/ndbd_shutdown_config phys-schost-1:/ # clresourcegroup online -e ndbd-rg
Note - From this point, never take offline on all the servers only the ndbd resource. If you want to shut down the ndbd completely, either use the clresourcegroup command to take ndbd-rg offline or first disable the shutdown controller resource.
If you want to shut down an ndbd resource on one node only (performing a rolling restart), you can disable it with the clresource disable -n phys-schost-1 ndbd-rs command. In this case, re-enable the ndbd resource before you shut down another resource.
For a rolling restart, do not disable the shutdown controller resource. Doing so would lead to a restart of the ndbd without loading data, in which case your database would be unavailable.
phys-schost-1:/ # ksh /opt/SUNWscmys/util/ha_mysql_register \ > -f /temp/cluconfig/ha_mysql_config phys-schost-1:/ # clresourcegroup online -eM mysql-rg