Install and configure a MYSQL cluster based on two servers in RHEL

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.