This document is intended to describe how to install a MySQL cluster configured with 2 servers. and the implementation of any one server problems or downtime MySQL can still continue to run.
First, introduce
========
This document is intended to describe how to install a MySQL cluster configured with 2 servers. and the implementation of any one server problems or downtime MySQL can still continue to run.
Attention!
Although this is a MySQL cluster based on 2 servers, there must also be an additional third server as a management node, but this server can be shut down after the cluster startup completes. Also note that it is not recommended to shut down the server as a management node after the cluster startup completes. Although it is theoretically possible to build a MySQL cluster based on only 2 servers, such a framework would have lost the sense of clustering once a server was down and the cluster could not continue to work properly. For this reason, a third server is required to run as a management node.
In addition, many friends may not have the actual environment of 3 servers, you can consider in VMware or other virtual machines to experiment.
The following assumptions about these 3 services:
Server1:mysql1.vmtest.net 192.168.0.1
Server2:mysql2.vmtest.net 192.168.0.2
Server3:mysql3.vmtest.net 192.168.0.3
Servers1 and Server2 as the actual server to configure the MySQL cluster. Server3, as a management node, requires a low level of adjustment to the SERVER3 system and does not require installation Mysql,server3 can use a lower-configured computer and can run other services simultaneously at Server3.
Second, install MySQL on Server1 and Server2
=================================
Download mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz from [Url]http://www.mysql.com[/url]
Note: The max version of Mysql,standard must not support cluster deployment!
The following steps need to be done on Server1 and Server2 each time
# MV mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz/usr/local/
# cd/usr/local/
# Groupadd MySQL
# useradd-g MySQL MySQL
# TAR-ZXVF Mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
# rm-f Mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
# mv mysql-max-4.1.9-pc-linux-gnu-i686 MySQL
# CD MySQL
# scripts/mysql_install_db--user=mysql
# Chown-r Root.
# chown-r MySQL Data
# chgrp-r MySQL.
# CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
# chmod +x/etc/rc.d/init.d/mysqld
# chkconfig--add mysqld
Do not start mysql! at this time