In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following brings you about the specific operation method of deploying MySQL Galera Cluster. If you are interested, take a look at this article together. I believe that after reading the specific operation method of deploying MySQL Galera Cluster, it will be somewhat helpful to everyone.
0. About Us
characteristics
Full parallel synchronous replication real-time multi-master architecture based on row replication, any node can read and write without delay replication, zero transaction loss, reliable and robust read and write experience. Automatic node relationship control: node failure automatic removal, node join automatic coordination close to the native MySQL database connection experience
Principle Analysis
When a transaction is submitted on the node currently being written, it is broadcast to other nodes in the same cluster as the write set through the wsrep API (write set replication API). After receiving the write set transaction, other nodes check the feasibility of the transaction and return the result to the wsrep API.
If most nodes estimate that they can successfully execute the transaction, the wsrep API will arbitrate, notify all nodes that can successfully execute the transaction to commit the transaction, and return a message that the transaction was successfully committed to the client, and eliminate the nodes that did not successfully execute the transaction as needed.
galera shared library
galera itself is a plug-in shared library file, MySQL gets galera cluster features by calling galera WriteSet Copy API hooks.
galera shared library components
galera library is a protocol stack that provides prepare, copy, and application write set transaction functions. Its important components are:
wsrep API: Writeset replication functional component, responsible for providing relational database management and replication services, defining interfaces
wsrep hooks: Integrated writeset components in the database engine
Gelera Provider: Converting shared libraries to wsrep API
Certification Layer: Protect writeset integrity, verify writeset integrity
replication: Manage replication protocols and provide a complete command system
GCS framework: Provides plug-in architecture for group communication
1. Environmental preparation
MySQL Version:5.6.41
192.168.33.14 node4
192.168.33.15 node5
192.168.33.16 node6
Modify the hosts file
vim /etc/hosts192.168.33.14 node5192.168.33.16 node62. Install mysql version with wsrep #Install mysql on 3 servers #Install basic tools yum -y install lsof rwsync xf mysql-wsrep-5.6.41-25.23-linux-x86_64.tar.gzmv mysql-wsrep-5.6.40 1 - 25.23-linux-x86_64 /usr/local/mysql#Create users and user groups groupadd -g 306 mysqluseradd -u 306 -g 306 mysqlchown -R mysql:mysql /usr/local/mysql#install dependencies yum -y install perl-Module-Installcd /usr/local/mysql./http://releases.galeracluster.com/mysql-wsrep-5.6/binary/mysql-wsrep-5.6.41-25.23-linux-x86_64.tar.gztar node4192.168.33.15 scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/home/mysql/mysqldata#configure startup cp support-files/mysql.server /etc/init.d/mysqldchmod +x /etc/init. d/mysqldif grep '^basedir=$'/etc/init. d/mysqld > /dev/null; then sed -i 's#^basedir=$#basedir=/usr/local/mysql#' /etc/init.d/mysqldfiif grep '^datadir=$' /etc/init.d/mysqld > /dev/null; then sed -i 's#^datadir=$#datadir=/home/mysql/mysqldata#' /etc/init.d/mysqldfichkconfig --add mysqldchkconfig mysqld onservice mysqld start#add environmental variables cat > /etc/profile.d/mysql.sh
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.