This document describes how to install and configure a MySQL cluster based on two servers under RHEL. MySQL can continue to run when any server encounters a problem or goes down.
This document describes how to install and configure a MySQL cluster based on two servers under RHEL. MySQL can continue to run when any server encounters a problem or goes down.
I. Introduction
==========
This document describes how to install and configure a MySQL cluster based on two servers under RHEL. MySQL can continue to run when any server encounters a problem or goes down.
Note!
Although this is a MySQL cluster based on two servers, there must be an additional third server as the management node, but this server can be closed after the cluster is started. At the same time, it is not recommended to disable the server as the management node after the cluster is started. Although a MySQL cluster with only two servers can be established theoretically, the cluster cannot continue to work normally once one server goes down, in this way, the meaning of the cluster is lost. 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 three servers. You can consider conducting experiments in VMWare or other virtual machines.
The following describes the three 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 serve as servers for configuring the MySQL cluster. Server3, as a management node, has low requirements. You only need to make minor adjustments to the Server3 system and do not need to install MySQL, server3 can use a low-configuration computer and run other services on server3.
2. Install MySQL on Server 1 and Server 2
======================================
Download mysql-max-5.0.27-linux-i686.tar.gz from the upper-right corner.
Note: It must be MySQL of max version. Standard version does not support cluster deployment!
Perform the following steps on Server 1 and Server 2
# Music mysql-max-5.0.27-linux-i686.tar.gz/usr/local/
# Cd/usr/local/
# Groupadd mysql
# Useradd-g mysql
# Tar-zxvf mysql-max-5.0.27-linux-i686.tar.gz
# Rm-f mysql-max-5.0.27-linux-i686.tar.gz
# Music mysql-max-5.0.27-linux-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
# Cp support-files/my-large.cnf/etc/my. cnf
# Chkconfig -- add mysqld
Do not start MySQL at this time!