Installation and configuration of Percona XtraDB Cluster

Source: Internet
Author: User
Tags percona percona server

Installation and configuration of Percona XtraDB Cluster

Percona XtraDB Cluster is a high availability and scalability solution for MySQL users based on Percona Server. It includes the Write Set REPlication patch and uses the Galera 2.0 library, which is a synchronization multi-host REPlication plug-in for transactional applications.

Percona XtraDB Cluster features:

(1) For synchronous replication, transactions are either committed at the same time or not at all cluster nodes.

(2) Multi-master replication, which can be written to any node.

(3) Real "parallel replication" for parallel application events on servers ".

(4) automatically configure nodes.

(5) data consistency, no non-synchronous slave server.

Experimental System: CentOS 6.6 _ x86_64

Prerequisites: both firewall and selinux are disabled, and no MYSQL version is installed on the server.

Tutorial Description: There are three hosts in this experiment, and IP addresses are allocated as topology.

Tutorial topology:

1. Install the percona Environment

1. Configure the yum Source:

Yum-y install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
Yum-y epel *

2. Install Percona software:

Yum-y install Percona-XtraDB-Cluster-server Percona-XtraDB-Cluster-client Percona-Server-shared-compat percona-xtrabackup

3. Add an account:

/Etc/init. d/mysql bootstrap-pxc // start PXC
Mysql
---------------------------------------->
Grant reload, lock tables, replication client on *. * TO com @ localhost identified by '123 ';
Flush privileges;
\ Q
<----------------------------------------
/Etc/init. d/mysql stop

2. Edit the node configuration of PXC:

1. On 19.66:

Vim/etc/my. cnf
------------------------------------->
Wsrep_provider =/usr/lib64/libgalera_smm.so
Wsrep_cluster_address = "gcomm: // 192.168.19.66, 192.168.19.74, 192.168.19.76"
Wsrep_sst_auth = com: 123456.
Wsrep_cluster_name = Percona
Wsrep_sst_method = xtrabackup-v2
Wsrep_node_address = 192.168.19.66
Wsrep_slave_threads = 2
Innodb_locks_unsafe_for_binlog = 1
Innodb_autoinc_lock_mode = 2
<-------------------------------------
/Etc/init. d/mysql bootstrap-pxc

2. On 19.74:

Vim/etc/my. cnf
-------------------------------------->
Wsrep_provider =/usr/lib64/libgalera_smm.so
Wsrep_cluster_address = "gcomm: // 192.168.19.66, 192.168.19.74, 192.168.19.76"
Wsrep_sst_auth = com: 123456.
Wsrep_cluster_name = Percona
Wsrep_sst_method = xtrabackup-v2
Wsrep_node_address = 192.168.19.74
Wsrep_slave_threads = 2
Innodb_locks_unsafe_for_binlog = 1
Innodb_autoinc_lock_mode = 2
<--------------------------------------
/Etc/init. d/mysql start

3. On 19.76:

Vim/etc/my. cnf
-------------------------------->
Wsrep_provider =/usr/lib64/libgalera_smm.so
Wsrep_cluster_address = "gcomm: // 192.168.19.66, 192.168.19.74, 192.168.19.76"
Wsrep_sst_auth = com: 123456.
Wsrep_node_address = 192.168.19.76
Wsrep_cluster_name = Percona
Wsrep_sst_method = xtrabackup-v2
Wsrep_slave_threads = 2
Innodb_locks_unsafe_for_binlog = 1
Innodb_autoinc_lock_mode = 2
<--------------------------------
/Etc/init. d/mysql start

4. Check the status of each node to ensure that the following items are correct:

Mysql
---------------------------------------------->
Show status like '% wsrep % ';
+ ------------------------------ + ---------------------------------------------------------- +
| Variable_name | Value |
+ ------------------------------ + ---------------------------------------------------------- +
| Wsrep_local_state_uuid | a82bc530-3748-11e5-a4fc-c26f7c90839c |
...
| Wsrep_local_state | 4 |
| Wsrep_local_state_comment | Synced |
...
| Wsrep_cluster_size | 3 |
| Wsrep_cluster_status | Primary |
| Wsrep_connected | ON |
...
| Wsrep_ready | ON |
+ ------------------------------ + ---------------------------------------------------------- +

5. test:

On 19.66:

Create database jason;
USE jason;
Create table jjj (id int, name char (10) engine = innodb;
COMMIT;

On 19.74:

USE jason;
Insert into jjj values (1, '22 ');
COMMIT;

On 19.76:

USE jason;
SELECT * FROM jjj;

It can be read and written on any server. You can try other operations on your own. This experiment is successful. Thank you! If you have any questions, contact me at QQ: 82800452.

Percona XtraDB Cluster details: click here
Percona XtraDB Cluster: click here

This article permanently updates the link address:

Related Article

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.