Percona XtraDB Cluster --- MySQL High Availability Solutions

Percona XtraDB Cluster --- MySQL High Availability Solutions a project description Address:. Http://www.percona.com/doc/percona-xtradb-cluster/intro.html Percona XtraDB Cluster is a MySQL high availability and scalability . Percona XtraDB Cluster solution features offered are: 1. synchronous replication, transactional either committed or not committed at all nodes. 2. Multi-master replication, can be written in any node. 3. In the event of parallel applications from a server on a parallel copy in the true sense. 4. Node autoconfiguration. The data consistency, no longer asynchronous replication. Percona XtraDB Cluster is fully compatible with MySQL and Percona Server, in: 1. Data Compatibility 2. Compatibility of the application: 1. without changing the application cluster nodes are recommended to configure at least three nodes, but can also be running on two nodes. 2. Each node is normal mysql / percona server, database server may be an existing clustered, conversely, the cluster may be split into separate servers. 3. Each node contains a complete copy of the data. The following advantages: 1. When a query is executed, executed on the local node. Because all data locally, without the need for remote access. 2. No centralized management. You can lose any node at any point in time, but the cluster will work as usual. 3. Good reading load extension, any node can query. Disadvantages as follows: 1. Add a new node, large overhead. You need to copy the complete data. 2. Can not effectively solve the problem of scaling write, all write operations will take place on all nodes. 3. How many nodes there are that many duplicate data. Chart as follows: Percona XtraDB Cluster and MySQL Replication difference is that: CAP theory of distributed systems. C --- consistency, consistent data from all nodes. A --- availability, one or more node failure does not affect the service request. P --- partition tolerance, connection between nodes fails, requests can still be processed. Any distributed system, need to meet two of the three. MySQL Replication: availability and partition tolerance Percona XtraDB Cluster: consistency and availability of MySQL Replication and therefore does not guarantee data consistency, and Percona XtraDB Cluster to provide data consistency. Percona XtraDB Cluster components: Percona XtraDB Cluster-based XtraDB of Percona Server and write replication set contains a patch. Use Galera 2.x library, common in multi-master replication synchronization plug-in transactional applications. Galera 2.x new features are: 1.IST (Incremental State Transfer) incremental state transfer. Particularly useful for WAN. 2.RSU (Rolling Schema Update) to update the schema rotation. It will not stop on the operating table. II. Installation Configuration 1.RHEL or CentOS system # rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm # yum install cmake gcc gcc-c ++ libaio libaio-devel automake autoconf bzr bison libtool ncurses5-devel # yum install Percona-XtraDB-Cluster-server Percona-XtraDB-Cluster-client xtrabackup 2. Debian or ubuntu system # gpg --keyserver hkp: //keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A # gpg -a --export CD2EFD2A | sudo apt-key add - # apt-get update # apt-get install build -essential flex bison automake autoconf bzr libtool cmake libaio-dev mysql-client libncurses-dev zlib1g-dev # sudo apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup 3. in order to use the initial configuration XtraDB cluster, you need to configure the following options in the my.cnf file:.. wsrep_provider - a path to Galera library wsrep_cluster_address - cluster connection URL binlog_format = ROW default_storage_engine = InnoDB innodb_autoinc_lock_mode = 2 innodb_locks_unsafe_for_binlog = 1 # additional parameters They are: number of the specified thread wsrep_slave_threads # wsrep_sst_method 4. the method for mounting XtraBackup SST Percona XtraBackup use of State Transfer method (snapshot copies the copy data between nodes). You can use scripting support Galera formal xtrabackup information package can be obtained from innobackupex innobackupex script source code package. At the same time in my. cnf file formulation:. wsrep_sst_method = xtrabackup three current limitations 1. Copy only supports InnoDB storage engine. Any other engine written form, including mysql. * Table will not be replicated. But DDL statements will be replicated, thus creating a user will be copied, but insert into mysql.user ... will not be copied. 2.DELETE operation does not support tables without primary keys. No primary key table node will be different in different order, if executed SELECT ... LIMIT ... appears different result sets. 3. LOCK in a multi-master environment / UNLOCK TABLES is not supported. And a lock function GET_LOCK (), RELEASE_LOCK () ... 4. query logs can not be saved in the table. If you open the query log, can only be saved to a file. The allowed maximum transaction size defined by wsrep_max_ws_rows and wsrep_max_ws_size. Any large-scale operation will be rejected. The large LOAD DATA operation. 6. Because cluster is optimistic concurrency control, transaction commit may stop at this stage. If there are two transactions are written to a different node in the cluster and submit to the same line, the failed node will be aborted. For the cluster level aborted cluster deadlock return an error code (Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK)). 7.XA transactions are not supported, due to the possible rollback in submission. 8. The entire cluster write throughput is restricted by the weakest node, if one node becomes slow, then the entire cluster will be slow. In order to stabilize the high-performance requirements, all nodes should use the unified hardware. 9. cluster nodes recommends a minimum of three. 10. If DDL statements in question would undermine the cluster. DELETE operation does not support table without primary keys. No primary key table node will be different in different order, if executed SELECT ... LIMIT ... appears different result sets. 3. LOCK in a multi-master environment / UNLOCK TABLES is not supported. And a lock function GET_LOCK (), RELEASE_LOCK () ... 4. query logs can not be saved in the table. If you open the query log, can only be saved to a file. The allowed maximum transaction size defined by wsrep_max_ws_rows and wsrep_max_ws_size. Any large-scale operation will be rejected. The large LOAD DATA operation. 6. Because cluster is optimistic concurrency control, transaction commit may stop at this stage. If there are two transactions are written to a different node in the cluster and submit to the same line, the failed node will be aborted. For the cluster level aborted cluster deadlock return an error code (Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK)). 7.XA transactions are not supported, due to the possible rollback in submission. 8. The entire cluster write throughput is restricted by the weakest node, if one node becomes slow, then the entire cluster will be slow. In order to stabilize the high-performance requirements, all nodes should use the unified hardware. 9. cluster nodes recommends a minimum of three. 10. If DDL statements in question would undermine the cluster. DELETE operation does not support table without primary keys. No primary key table node will be different in different order, if executed SELECT ... LIMIT ... appears different result sets. 3. LOCK in a multi-master environment / UNLOCK TABLES is not supported. And a lock function GET_LOCK (), RELEASE_LOCK () ... 4. query logs can not be saved in the table. If you open the query log, can only be saved to a file. The allowed maximum transaction size defined by wsrep_max_ws_rows and wsrep_max_ws_size. Any large-scale operation will be rejected. The large LOAD DATA operation. 6. Because cluster is optimistic concurrency control, transaction commit may stop at this stage. If there are two transactions are written to a different node in the cluster and submit to the same line, the failed node will be aborted. For the cluster level aborted cluster deadlock return an error code (Error: 1213 SQLSTATE: 40001 (ER_LOCK_DEADLOCK)). 7.XA transactions are not supported, due to the possible rollback in submission. 8. The entire cluster write throughput is restricted by the weakest node, if one node becomes slow, then the entire cluster will be slow. In order to stabilize the high-performance requirements, all nodes should use the unified hardware. 9. cluster nodes recommends a minimum of three. 10. If DDL statements in question would undermine the cluster. XA transactions are not supported, due to the possible rollback in submission. 8. The entire cluster write throughput is restricted by the weakest node, if one node becomes slow, then the entire cluster will be slow. In order to stabilize the high-performance requirements, all nodes should use the unified hardware. 9. cluster nodes recommends a minimum of three. 10. If DDL statements in question would undermine the cluster. XA transactions are not supported, due to the possible rollback in submission. 8. The entire cluster write throughput is restricted by the weakest node, if one node becomes slow, then the entire cluster will be slow. In order to stabilize the high-performance requirements, all nodes should use the unified hardware. 9. cluster nodes recommends a minimum of three. 10. If DDL statements in question would undermine the cluster.

Reproduced in: https: //my.oschina.net/766/blog/211213

Guess you like

Origin blog.csdn.net/weixin_34364135/article/details/91548444
Recommended