Skip Navigation Links
Exit Print View
| Oracle Solaris Cluster Data Service for MySQL Cluster Guide Oracle Solaris Cluster 4.1

Search Scope:

- This Document
- Entire Library

## Installing and Configuring MySQL Cluster

This section explains the special requirements for installing MySQL Cluster for use with HA for MySQL Cluster. For complete information about installing and configuring MySQL Cluster, see http://www.mysql.com/.

The MySQL version delivered with the Oracle Solaris OS is a pure MySQL server version. It does not include MySQL Cluster. You must obtain MySQL Cluster software from http://www.mysql.com/.

Determine whether you have to configure HA for MySQL Cluster to run in a global zone or a zone cluster configuration.

To install and configure MySQL Cluster in a global zone configuration or in a zone-cluster configuration, complete the following tasks:

- How to Enable a MySQL Cluster Database to Run in a Global Zone Configuration

- How to Install and Configure MySQL Cluster in a Global Zone

## How to Enable a MySQL Cluster Database to Run in a Global Zone Configuration

For a complete example of deploying in a global zone, see Appendix B, Deployment Example: Installing MySQL Cluster in the Global Zone.

1. (Optional) Adjust the `heartbeat_quantum` and the `heartbeat_timeout` parameter if appropriate.

       # cluster set -p heartbeat_quantum=50%-of-heartbeat-timeout \
       -p heartbeat-timeout=value-in-milliseconds

2. (Optional) If you want to configure MySQL Cluster in a zone cluster, log in to the target zone.

       # zlogin zone-name

3. As superuser in the target zone register the `SUNW.gds` resource types.

       # clresourcetype register SUNW.gds

4. (Optional) Create a failover resource group to contain the shared-address resource.

       # clresourcegroup create Shared-Address-resource-group

5. (Optional) Create the shared-address resource.

       # clressharedaddress create -g Shared-Address-resource-group Shared-Address-resource

6. (Optional) Enable the shared-address resource group.

       # clresourcegroup online -eM Shared-Address-resource-group

7. Create the management server resource group.

       # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 \
       mgmd-resource-group

8. Create the `ndbd` daemon resource group.

       # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 \
       ndbd-resource-group

9. Create the MySQL server resource group.

       # clresourcegroup create -p maximum_primaries=2 -p desired_primaries=2 \
       mysql-resource-group

10. (Optional) Set the affinities for the MySQL server resource group.

        # clresourcegroup set -p rg_affinities=++ndbd-resource-group mysql-resource-group

## How to Install and Configure MySQL Cluster in a Global Zone

Before You Begin

Ensure that the Oracle Solaris Cluster HA for MySQL package (`ha-cluster/data-service/mysql`) is installed during your initial Oracle Solaris Cluster installation, if not then proceed to Installing the HA for MySQL Cluster Package to install it on your cluster. Return here to continue Installing and Configuring MySQL Cluster.

Note - For complete information about installing MySQL Cluster, go to http://www.mysql.com/.

For a complete example of deployment in a global zone, see Appendix B, Deployment Example: Installing MySQL Cluster in the Global Zone.

The sample commands in this task assume the following values:

- The user and the group that owns the MySQL Cluster are named `mysql`.

- The MySQL Cluster data is installed in the root file system. This system can be any file system, including ZFS.

1. Install the MySQL Cluster binaries on all nodes.

       # cd dir-path
       # /usr/sfw/bin/gtar xzvf downloaded-MySQL-Cluster-version
       # ln -s ./created-dir ./mysql

2. Create the MySQL user and group on all nodes.

       # groupadd -g 1000 mysql
       # useradd -u 1000 -g 1000 -d /local/mysql -s /bin/sh mysql

3. Change the owner of the MySQL Cluster on all nodes.

       # chown -RL mysql:mysql ./mysql

4. Create the data directory for the management server on all nodes to host the management server.

       # mkdir MySQL-Cluster-management-server-data-directory

5. Create the MySQL Cluster management server `config.ini` file according to your requirements.

   The Oracle Solaris Cluster HA for MySQL data service provides a sample `config.ini` file for the MySQL Cluster management server.

   The contents of `/opt/SUNWscmys/ndb_mgmd/etc/config.ini_sample` provides a sample MySQL Cluster configuration file that you can use to create your MySQL Cluster instance MySQL Cluster Management Server `Datadirectory/config.ini`. You must still edit that file to reflect your configuration values.

       # cp /opt/SUNWscmys/ndb_mgmd/etc/config.ini_sample \
       MySQL-Cluster-Management-Server-Data-Directory/config.ini

6. Create the MySQL Cluster `ndb` daemon `my.cnf` file.

   The Oracle Solaris Cluster HA for MySQL data service provides a sample `my.cnf` file for the MySQL Cluster `ndb` daemon.

   The content of `/opt/SUNWscmys/ndbd/etc/my.cnf_sample` provides a sample MySQL Cluster configuration file for the `ndb` daemons, that you can use to create your MySQL Cluster instance MySQL Cluster `ndb` Daemon `Datadirectory/my.cnf`. You must still edit that file to reflect your configuration values.

       # cp /opt/SUNWscmys/ndbd/etc/my.cnf_sample \
       MySQL-Cluster-ndb-Daemon-Data-Directory/my.cnf

7. Install a MySQL server on all nodes to host the MySQL server.

   Refer to Oracle Solaris Cluster Data Service for MySQL Guide. As an alternative, you can refer to Appendix B, Deployment Example: Installing MySQL Cluster in the Global Zone

   Note - Make sure to stop the installation process after bootstrapping the MySQL database and changing the file permissions. If you want to use a sample configuration file for your MySQL server configuration, use `/opt/SUNWscmys/etc/my.cnf_sample_mysqld_cluster`. You must still edit that file to reflect your configuration values.

Copyright © 2000, 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices |