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

Document Information

Preface

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

Target Cluster Configuration

Software Configuration

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

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

ha_mysql_config File for One Node

Index

How to Create the HA for MySQL Cluster Configuration With Scalable Services

  1. On one node, create the resource groups.
    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.


  2. On both nodes, create a configuration directory for the parameter file.
    phys-schost-1:/ # mkdir /cluster-pfiles
    phys-schost-2:/ # mkdir /cluster-pfiles
  3. On one node, register gds.
    phys-schost-1:/ # clresourcetype register gds
  4. Create the resource for the management daemon.
    1. Create a configuration file on both nodes under /temp/cluconfig/mysql_ndb_mgmd_config.

      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.

    2. Ensure that the ID parameter on each node reflects the ID in the config.ini file.
      ID=1 for phys-schost-1
      ID=2 for phys-schost-2
    3. Ensure that the connect string contains the global-cluster node name.

      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
    4. On both nodes, create the parameter file.
      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
    5. On one node, create the resource and start the mgm-rg.
      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
  5. Create the resource for the ndbd daemon.
    1. Create a configuration file on both nodes under /temp/cluconfig/mysql_ndbd_config.

      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.

    2. Ensure that the ID parameter on each node reflects the ID in the config.ini file.
      ID=3 for phys-schost-1 
      ID=4 for phys-schost-2
    3. On both nodes, create the parameter file.
      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
    4. On one node, create the resource and start the ndbd-rg resource.
      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.


  6. Create the resource for the shutdown controller.
    1. On one node, create a configuration file under /temp/cluconfig/ndbd_shutdown_config.

      Use the content of ndbd_shutdown_config File for One Node.

    2. On one node, create the resource and start the ndbd-rg resource.
      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.


  7. On one node, create the resource for the MySQL server.
    1. Create a configuration file under /temp/cluconfig/ha_mysql_config using the content shown in ha_mysql_config File for One Node.
    2. Create the resource and start the ndbd-rg resource group.
      phys-schost-1:/ # ksh /opt/SUNWscmys/util/ha_mysql_register \
      > -f /temp/cluconfig/ha_mysql_config 
      phys-schost-1:/ # clresourcegroup online -eM mysql-rg