RHEL下安装配置基于2台服务器的MYSQL集群
这篇文档旨在介绍如何在RHEL下安装配置基于2台服务器的MySQL集群。并且实现任意一台服务器出现问题或宕机时MySQL依然能够继续运行
一、介绍
========
这篇文档旨在介绍如何在RHEL下安装配置基于2台服务器的MySQL集群。并且实现任意一台服务器出现问题或宕机时MySQL依然能够继续运行。
注意!
虽然这是基于2台服务器的MySQL集群,但也必须有额外的第三台服务器作为管理节点,但这台服务器可以在集群启动完成后关闭。同时需要注意的是并不推荐在集群启动完成后关闭作为管理节点的服务器。尽管理论上可以建立基于只有2台服务器的MySQL集群,但是这样的架构,一旦一台服务器宕机之后集群就无法继续正常工作了,这样也就失去了集群的意义了。出于这个原因,就需要有第三台服务器作为管理节点运行。
另外,可能很多朋友都没有3台服务器的实际环境,可以考虑在VMWare或其他虚拟机中进行实验。
下面假设这3台服务的情况:
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和Server2作为实际配置MySQL集群的服务器。对于作为管理节点的Server3则要求较低,只需对Server3的系统进行很小的调整并且无需安装MySQL,Server3可以使用一台配置较低的计算机并且可以在Server3同时运行其他服务。
二、在Server1和Server2上安装MySQL
=================================
从上下载mysql-max-5.0.27-linux-i686.tar.gz
注意:必须是max版本的MySQL,,Standard版本不支持集群部署!
以下步骤需要在Server1和Server2上各做一次
# mv mysql-max-5.0.27-linux-i686.tar.gz /usr/local/
# cd /usr/local/
# groupadd mysql
# useradd -g mysql mysql
# tar -zxvf mysql-max-5.0.27-linux-i686.tar.gz
# rm -f mysql-max-5.0.27-linux-i686.tar.gz
# mv 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
此时不要启动MySQL!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



On Fedora39+, RHEL9, AlmaLinux9, RockyLinux9 and CentOSStream9Linux distributions, you can use the grubby program to manage GRUB boot entries. In this article, we will show you how to use GRUBY to add/remove kernel boot parameters from the GRUB boot entry on Fedora, RHEL, AlmaLinux, RockyLinux, and CentOSStream. We will also show you how to add/remove custom GR using GRUBY on Fedora, RHEL, AlmaLinux, RockyLinux and CentOSStream

Building a Highly Available MySQL Cluster: Best Practice Guide for Master-Slave Replication and Load Balancing In recent years, with the rapid development of the Internet, the database has become one of the core data storage and processing engines for most web applications. In this scenario, high availability and load balancing have become important considerations in database architecture design. As one of the most popular open source relational databases, MySQL's cluster deployment solution has attracted much attention. This article will introduce how to implement a highly available database cluster through MySQL master-slave replication and load balancing.

How to use distributed database architecture to build a highly available MySQL cluster. With the development of the Internet, the demand for high availability and scalability of databases is getting higher and higher. Distributed database architecture has become one of the effective ways to solve these needs. This article will introduce how to use a distributed database architecture to build a highly available MySQL cluster and provide relevant code examples. Building a MySQL master-slave replication cluster MySQL master-slave replication is the basic high-availability solution provided by MySQL. Through master-slave replication, data can be

Red Hat issued an announcement two months ago announcing that it would restrict access to Red Hat Enterprise Linux (RHEL) source code. This move has had a serious impact on the future development of Linux distributions such as AlmaLinux and RockyLinux. Regarding this decision, Benny Vasquez, chairman of the AlmaLinuxOS Foundation, previously told foreign media SiliconANGLE that "the impact on ordinary users is actually very small." Overall, apart from the kernel update, we're the same as before. When RHEL releases a new version, AlmaLinux may not provide corresponding updates immediately. However, developers can still use CentOSStream

1. Install dependency packages (select the installation directory and execute the command) yum-yinstallmakegccgcc-c++opensslopenssl-develpcre-develzlib-devel-y. For all questions, the default is yesinstall. Automatically install the dependency gcc used by make to compile binary files. Compiling c/c++ language with gcc-c++ requires the http module of PCREnginx to use pcre to parse regular expressions opensslnginx supports http and https protocols. openssl is a secure sockets layer cryptographic library that has cryptographic algorithms, commonly used keys and certificate encapsulation management functions.

EnvironmentRedHatEnterpriseLinuxrelease8.0VMwareWorkstationPro14 building steps[root@localhost~]#systemctlstophttpd#Stop httpd to prevent it from affecting Nginx[root@localhost~]#yuminstall-ynginx[root@localhost~]#systemctlstartnginx[root@localhost~]#iptables -F[root@localhost~]#systemctlstopfire

This website reported on August 18 that Red Hat announced in June this year that it had decided to stop providing LibreOffice packaged in RPM format in RHEL, and announced that it would adjust its work focus. This site noted that after the adjustment, Red Hat’s work focus It will focus on "improving the Wayland display server", "HDR support", and improving the workstation experience for Fedora and RHEL users. Red Hat senior developer Bastien Nocera recently pointed out in a "New responsibilities" blog post on his blog that Red Hat is adjusting its desktop Linux development work. As MatthiasClasen's "LibreOfficepackag

How to configure an SSL connection for MySQL Cluster Summary: MySQL is a commonly used open source relational database management system that can be used to store and manage large amounts of data. In the Internet era, data security has received increasing attention. To protect the security of the database, we can configure an SSL connection to encrypt data transmission. This article will describe how to configure an SSL connection for MySQL Cluster. Introduction: With the development of the Internet, data leakage and information security issues have attracted more and more attention. In the cloud plan
