Installation
When you receive the mysqlcluster.tgz file..
you should copy it to a front end node that has root access to the hosts (or is part) of your cluster.
Then run (in order):
For MySQL Cluster 6.3 / 7.0 / 7.1
- gunzip mysqlcluster-XX.tar.gz
- tar xvf mysqlcluster-XX.tar
- cd mysqlcluster-XX
- cd cluster
- cd scripts
- cd install
Then you can chose to build from source or to use a binary tar distribution of MySQL Cluster.
To build from source
You must have installed
- gcc and g++ e.g,
apt-get install gcc g++ oryum install gcc.x86_64 - wget e.g,
apt-get install wget oryum install wget.x86_64 - ncurses-dev e.g,
apt-get install libncurses5-dev oryum install ncurses-devel.x86_64
You should now run these scripts from mysqlcluster-/cluster/scripts/install:
- Mac users: sh macos.sh Download macos.sh and copy it to scripts/ and run it there. Also run it in the scripts/install folder, and in scripts/extra too. This will fix mac related problems wrt the dialect of bash that mac uses.
- download-and-compile.sh - gets the latest officially released cluster source, configure, and build. The resulting build is in the build/ directory and the binary distribution is in the repo/ directory
- install-cluster.sh - Distribute the binary located in build/mysql... to the hosts in the cluster
- bootstrap.sh - sets up directory structures and installs the mysql servers configured with a hostname. The script will delete any old information (if a previous mysqld data directory exists on the same location) located on a host. Configuration files (my.cnf and config.ini) will be installed in /etc/mysql/
- 'cd ..' and then do start-cluster.sh --initial - starts the management server(s), the data nodes and the mysql server(s) configured with a hostname
- Instead of the above four scripts you can run deploy.sh, which will run download-and-compile.sh, install-cluster.sh,bootstrap.sh, and start-cluster.sh --initial
Using a tgz distro (binary build from MySQL)
- Mac users: sh macos.sh Download macos.sh and copy it to scripts/ and run it there. Also run it in the scripts/install folder, and in scripts/extra too. This will fix mac related problems wrt the dialect of bash that mac uses.
- download-binary-sh - downloads the latest binary release. This only works for Linux x86_64 at the moment.
- install-cluster.sh
- Distribute the binary and upacks them on to the hosts in the cluster - bootstrap.sh - sets up directory structures and installs the mysql servers configured with a hostname. The script will delete any old information (if a previous mysqld data directory exists on the same location) located on a host. Configuration files (my.cnf and config.ini) will be installed in /etc/mysql/
- 'cd ..' and then do start-cluster-initial.sh - starts the management server(s), the data nodes and the mysql server(s) configured with a hostname
After this you can the use the other scripts in the cluster/scripts directory.
Scripts
The scripts are located in:
mysqlcluster-xy/cluster/scripts
| Installation scripts | Description |
Version (when script was introduced) |
|
location |
The installation scripts are located in |
|
| deploy.sh |
For MySQL Cluster 6.3 and 7.0. The script runs:
|
1.0 |
| download-and-compile.sh |
usage: Download and compiles the latest MySQL Cluster source (either 6.3 or 7.0 depending on what you have selected). Source releases are made more often than binary releases. The binary tarball from the build is placed in |
1.0 |
| download-binary.sh |
usage: Download and compiles the latest MySQL Cluster binary release (either 6.3 or 7.0 depending on what you have selected). Only works with Linux x86-64 Places the binary tarball in |
2.6 |
| install-cluster.sh |
usage: Distributes the mysql binary tarball in |
2.6 |
| install-host.sh |
usage: Distributes the mysql binary tarball in |
2.6 |
| bootstrap.sh |
usage: Run only the first time you setup a new Cluster! The bootstrap script does: |
1.0 |
| add-mysqld.sh |
usage: --hostname=<hostname> - the hostname where to install the mysql server. start/stop scripts are also generated. |
2.6 |
| Cluster start/stop scripts | Description | |
|
location |
The following scripts are located in |
|
| start-cluster.sh [--initial] |
usage: Performs a start of mysql cluster. If |
1.0 |
| stop-cluster.sh |
usage: Stops the entire cluster. The script will: |
1.0 |
| Management server scripts | Description | |
|
location |
The following scripts are located in |
|
| start-mgmd-<host>.sh |
usage: starts the management server on <host> |
1.0 |
| stop-mgmd-<host>.sh |
usage: stops the management server on <host> |
1.0 |
| Data node scripts | Description | |
| start-ndbd-<host>-id-<id>.sh [--initial] |
usage: starts the data node with <id> on <host>. The ID is used to be able to distinguish between one or more data nodes located on one host. If |
1.0 |
| start-ndbd-<host>-id-<id>.sh --initial |
usage: starts the data node with <id> on <host> with --initial. This means it will clear out its data directory, and perform an initial node recovery (copy all data from the other node in the same node group. The ID is used to be able to distinguish between one or more data nodes located on one host. |
1.0 |
| stop-ndbd-<host>-id-<id>.sh |
usage: stops the data node with <id> on <host>. The ID is used to be able to distinguish between one or more data nodes located on one host. |
1.0 |
| Mysql server scripts | Description | |
| start-mysqld-<host>.sh |
usage: starts the mysqld on <host>. If there is a cluster that is started, then the mysqld will join the cluster. |
1.0 |
| stop-mysqld-<host>.sh |
usage: stops the mysqld on <host> |
1.0 |
| mysqlclient-<host>.sh |
usage: starts a mysqlclient on the mysqld running on <host> |
1.0 |
| Administration scripts | Description | |
|
location |
The following scripts are located in |
|
| rolling-restart.sh [--initial] |
usage: Performs a rolling restart. Usually this is done when upgrading the config.ini (mysqlcluster-xx/config/config.ini). . The rolling restart is online, no data will be lost, and there is no service interruption. E.g, if you have increased the DataMemory (updated the mysqlcluster-xx/config/config.ini), then you need to perform a rolling restart. Some parameter changes requires an The following will happen: |
1.0 |
| rolling-restart.sh --initial |
usage: Performs a initial rolling restart. Usually this is done when upgrading the config.ini (mysqlcluster-xx/config/config.ini). The rolling restart is online, no data will be lost, and there is no service interruption. You need to do an initial rolling restart if you have changed parameters affecting the filesystem (FragmentLogFileSize, NoOfFragmentLogFiles etc). You cannot yet add nodes or change NoOfReplicas online. See the reference manual for more information. The following will happen: |
1.0 |
| show.sh |
usage: Prints out the nodes in the cluster |
1.0 |
| status.sh |
usage: Prints out the status of the data nodes in the cluster |
1.0 |
| start-backup.sh |
usage: Starts a backup, and aggregates the backup files in <backupdir> |
1.0 |
| restore-backup.sh |
usage: restores the backup files in <backupdir> By specifying the following you can generate csv files from the backup files in <backupdir>: |
2.5 |
| ndb_mgm.sh | Starts the management client. | 1.0 |
| Tool scripts | Description | |
|
location |
The following scripts are located in |
|
| check-cluster-log.sh |
usage: Tails the cluster log on the management server running on |
2.5 |
| check-ndbd-errlog.sh |
usage: --nodeid=<id> - the data node id. --hostname=<hostname> - the hostname of the data node |
2.5 |
check-mysqld-errlog.sh check-mysql-error.sh (old name) |
usage: --hostname=<hostname> - the hostname of the mysql server |
2.5 |
| execute-all-mysql.sh |
usage:
--user=<username> --password=<password> --database=<db> --execute=<query> -p|--password=<password> - the password of username -d|--database=<database&rt; - database to connect to -e|--execute=<query> - query to execute all parameters are optional (except --execute), default is equiv. to 'mysql -uroot test' (no password) |
2.5 |
| error-report.sh |
usage: Generates an error report (collected logs etc). Useful for filing bugs and Support issues. The error report will be stored in |
2.5 |
| query-param.sh |
usage: Prints the values of <parameter>. <parameter> can e.g be DataMemory, IndexMemory, MaxNoOfConcurrentOperations etc |
2.5 |
| sanity-check-config.sh |
usage: Verifies that the values for: RedoBuffer NoOfFragmentLogFiles FragmentLogFileSize It is highly recommended to apply them for a correctly working system. You will be suggested to either perform a rolling restart or an initial rolling restart. |
2.7 |
| upgrade-to-production.sh |
usage: Enables: RealTimeScheduler=1 SchedulerSpinTimer=40 SchedulerExecutionTimer=80 Make sure you have enough RAM since LockPagesInMainMemory can cause the OS to freeze if there is insufficient RAM. |
2.7 |
File structure and organization
Below is the organization of scripts and directories.
-
mysqlcluster-XX
|-- cluster
| |-- build (used for src builds)
| |-- repo (binary .tgz of MySQL Cluster is stored here)
| |-- config (config.ini, my.cnf etc)
| |-- init.d (initd scripts for cluster)
| |-- scripts (start,stop scripts..)
| |-- install (all the install scripts..)
| |-- .s9s (meta data describing the cluster, which version that is currently used ('latest' points to the cluster release in 'repo' which is currently installed)
| `-- tools (tool scripts..)
|-- cmon
| |-- build_cmon_linux.sh
| |-- init.d (initd scripts for cmon)
| |-- install_cmon_initd_linux.sh
| |-- start_all_cmon_linux.sh
| |-- stop_all_cmon_linux.sh
| `-- uninstall_cmon_initd_linux.sh
`-- monit
|-- build_monit_linux.sh
|-- etc (monit files)
|-- init.d (initd files for monit)
|-- install_monit_inittab_linux.sh
`-- uninstall_monit_inittab_linux.sh
Other tools
2009-May-05 - This has not been updated for a while..
cmon
You must have a running cluster first (easiest that way..)
- cd mysqlcluster-6X
- cd cmon
- bash ./build_cmon_linux.sh
- bash ./install_cmon_initd_linux.sh
- bash ./start_all_cmon_linux.sh
Read more about cmon
monit
You must have a running cluster first (easiest that way..)
- cd mysqlcluster-6X
- cd monit
- bash ./build_monit_linux.sh
- bash ./install_monit_inittab_linux.sh
Read more about monit
You should now have a fully monitored and managed cluster!