This section contains the procedures you need to install and configure MySQL.
References will be made to certain directories for MySQL. The following list shows common pathnames for these references. Refer to Configuration Restrictions where these examples .
MySQL installed from http://www.mysql.com on a Global File System, with a MySQL instance on a Global File System (Example 1–1)
MySQL Basedirectory— /global/mysql
MySQL Database directory — /global/mysqldata
MySQL installed on a Local File System, with mysql instances on a Failover File System (Example 1–2)
MySQL Basedirectory— /usr/local/mysql
MySQL Database directory — /local/mysqldata
Determine how MySQL will be deployed in Sun Cluster –
Determine how many MySQL instances will be deployed.
Determine which Cluster File System will be used by each MySQL instance.
Mount the MySQL Cluster File Systems –
If Failover File Systems will be used by the MySQL instance, you must mount these manually.
Install MySQL onto all nodes within Sun Cluster
It is recommended that MySQL be installed onto a Global File System. For a discussion of the advantages and disadvantages of installing the software on local versus cluster files systems, see “Determining the Location of the Application Binaries” in the Sun Cluster Data Services Installation and Configuration Guide.
Download MySQL from http://www.mysql.com — If you intend to use local disks for the MySQL software, you will need to repeat this step on all nodes within Sun Cluster.
Create a mysql-user and mysql-group for MySQL on all nodes in the cluster that will run MySQL
Create an entry in /etc/group on all nodes with Sun Cluster.
Change owner and group for MySQL binaries
If MySQL binaries are on all nodes then repeat this step.
# chown -R mysql:mysql /global/mysql |
Create your MySQL Database directory for your MySQL Instance(s).
# mkdir <MySQL Database directory> # |
Refer back to Configuration Restrictions for a description of the <MySQL Database directory> and to Installing and Configuring MySQL for a list of common pathnames.
Shows one MySQL instance. MySQL has been installed from http://www.mysql.com in /global/mysql which is mounted as a Global File System. The MySQL Database Directory for the MySQL instance is /global/mysql-data.
# cd /global/mysql # # ls -l -rw-r--r-- 1 mysql mysql 19106 Dec 10 14:52 COPYING -rw-r--r-- 1 mysql mysql 28003 Dec 10 14:52 COPYING.LIB -rw-r--r-- 1 mysql mysql 44577 Dec 5 10:37 ChangeLog -rw-r--r-- 1 mysql mysql 6811 Dec 10 14:53 INSTALL-BINARY -rw-r--r-- 1 mysql mysql 1976 Dec 5 10:37 README drwxr-xr-x 2 mysql mysql 1024 Dec 13 18:05 bin -rwxr-xr-x 1 mysql mysql 773 Dec 10 15:34 configure drwxr-x--- 3 mysql mysql 512 Apr 3 12:23 data drwxr-xr-x 2 mysql mysql 1024 Dec 10 15:35 include drwxr-xr-x 2 mysql mysql 512 Dec 10 15:35 lib drwxr-xr-x 2 mysql mysql 512 Dec 10 15:35 man -rw-r--r-- 1 mysql mysql 2582089 Dec 10 14:47 manual.html -rw-r--r-- 1 mysql mysql 2239278 Dec 10 14:47 manual.txt -rw-r--r-- 1 mysql mysql 94600 Dec 10 14:47 manual_toc.html drwxr-xr-x 6 mysql mysql 512 Dec 10 15:35 mysql-test drwxr-xr-x 2 mysql mysql 512 Dec 10 15:35 scripts drwxr-xr-x 3 mysql mysql 512 Dec 10 15:35 share drwxr-xr-x 7 mysql mysql 1024 Dec 10 15:35 sql-bench drwxr-xr-x 2 mysql mysql 512 Dec 10 15:35 support-files drwxr-xr-x 2 mysql mysql 512 Dec 10 15:35 tests # |
Create the MySQL my.cnf file according to your requirements — The Sun Cluster HA for MySQL data service provides two sample my.cnf file for MySQL: one sample configuration file is for a master configuration and one sample file is for a slave configuration.
If the Sun Cluster HA for MySQL package (SUNWscmys) was not installed during your initial Sun Cluster installation, proceed to Installing the Sun Cluster HA for MySQL Packages to install it on SC3.1 and SC3.0U3. Return here to continue the Installation and Configuration of MySQL.
The contents of /opt/SUNWscmys/etc/my.cnf_sample_[master|slave]provide a sample MySQL configuration file that you can use to create your MySQL instance <MySQL Databasedirectory>/my.cnf.You must still edit that file to reflect your configuration values.
# cp /opt/SUNWscmys/etc/my.cnf_sample_master \ <MySQL Databasedirectory>/my.cnf |
Bootstrap MySQL instance — This will create the privilege tables db, host, user, tables_priv and columns_priv in the mysql database, as well as the func table.
# cd <MySQL Basedirectory> |
# ./scripts/mysql_install_db \ --datadir=<MySQL Database directory> |
Create a logfile directory in <MySQL Database Directory>
# mkdir <MySQL Database Directory>/logs |
Change owner and group for <MySQL Database Directory>
# chown -R mysql:mysql <MySQL Database Directory> |
Change filepermission for <MySQL Database Directory>/my.cnf
# chmod 644 <MySQL Database Directory>/my.cnf |