First, the installation of PXC requirements
1, strongly recommend more than 3 nodes and hardware configuration, one node performance is affected, the overall affected, following the barrel effect
2. If a DDL statement has a problem, it will break the cluster
3. Create the database table engine must be innodb, or the composite SQL statement cannot be synchronized
4. Create a database table must have a primary key index, or a database in the cluster will be down
Second, on-line installation
Yum Remove-y mysql-libs
Rpm-qa |grep percona-server |grep-v compat |xargs rpm-e--nodeps
Yum install-y cmake gcc gcc-c++ libaio libaio-devel automake autoconf BZR Bison libtool ncurses5-devel
Yum Install-y http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
Yum Install-y http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm
Yum Makecache
Yum Install-y percona-xtradb-cluster-55.x86_64
Third, the configuration
1, turn off SELinux, firewall open 3306,4444,4567,4568 port
2, Node DB1 configuration: cat/etc/my.cnf
[Mysqld]
Port = 3306
Socket =/tmp/mysql.sock
DataDir =/data/mysql_xx
Pid-file =/data/mysql_xx/mysql.pid
Log-error =/data/mysql_xx/mysql.err
Log-bin =/log/mysql_xx/mysql-bin-fookii
Max_tmp_tables = 64
Character-set-server=utf8
Skip-name-resolve
Log-slave-updates
Slave-skip-errors = 1052
Back_log = 5000
Max_connections = 1024
max_connect_errors = 100
Table_open_cache = 4096
Max_allowed_packet = 128M
Binlog_cache_size = 1M
Max_heap_table_size = 64M
Read_buffer_size = 2M
Read_rnd_buffer_size = 16M
Sort_buffer_size = 8M
Join_buffer_size = 8M
Thread_cache_size = 48
Query_cache_type=0
query_cache_size=0m
Query_cache_limit = 2M
Ft_min_word_len = 4
Default-storage-engine = InnoDB
Thread_stack = 192K
Transaction_isolation = Repeatable-read
Tmp_table_size = 64M
Slow_query_log
Long_query_time = 2
Server-id = 1010
Bulk_insert_buffer_size = 64M
Innodb_buffer_pool_size = 21G
Innodb_io_capacity =100
innodb_file_per_table = 1
Innodb_file_format=barracuda
Innodb_flush_method=o_direct
Innodb_data_file_path =ibdata1:100m;ibdata2:100m:autoextend
Innodb_write_io_threads = 16
Innodb_read_io_threads = 8
Innodb_thread_concurrency = 16
Sync_binlog=1
Innodb_flush_log_at_trx_commit = 0
Innodb_log_buffer_size = 8M
Innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Expire_logs_days = 30
innodb_log_file_size=1000m
Innodb_fast_checksum=0
innodb_page_size=16384
innodb_log_block_size=512
Log_bin_trust_function_creators = 1
wait_timeout=120
interactive_timeout=120
Open-files-limit = 65535
Default-time-zone= ' "
group_concat_max_len=10240
Start the server and test whether it starts properly
/etc/init.d/mysql start
Add a SST transfer account using Xtrabackup
CREATE USER ' sstuser '% ' localhost ' identified by ' 123abc ';
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT on *.
FLUSH privileges;
3. Add cluster parameters in configuration file
/etc/init.d/mysql stop
Cat/etc/my.cnf
Wsrep_provider=/usr/lib64/libgalera_smm.so
Wsrep_cluster_address= "gcomm://10.0.10.10,10.0.10.11,10.0.10.12"
wsrep_sst_receive_address=10.0.10.10:4444
Wsrep_provider_options= "GCACHE.SIZE=5G;GCACHE.PAGE_SIZE=1G"
Wsrep_node_name=ip-10-0-10-10
Wsrep_sst_auth= "SSTUSER:123ABC"
Wsrep_replicate_myisam=on
Wsrep_restart_slave=on
Wsrep_sync_wait=1
Wsrep_auto_increment_control=off
Auto_increment_increment=1
Auto_increment_offset =1
Binlog_format=row
Log_slave_updates
Default_storage_engine=innodb
innodb_autoinc_lock_mode=2
Wsrep_slave_threads=4
Wsrep_sst_method=rsync
Wsrep_cluster_name=xx_cluster
Wsrep_debug=0
4, the first node in the cluster to start a command
/etc/init.d/mysql BOOTSTRAP-PXC
centos7.0 Start command:
Systemctl start [email protected]
5. Check the running status after starting
Mysql> Show status like ' wsrep% ';
Show:
Wsrep_cluster_size 1
Wsrep_cluster_status Primary
Wsrep_connected on
Wsrep_ready on
Description DB1 Node Configuration succeeded
6. Node DB2 configuration
DB2 configuration is similar to DB1 configuration, the only few parameters are modified as follows:
Server-id = 1011
wsrep_sst_receive_address=10.0.10.11:4444
Wsrep_node_name=ip-10-0-10-11
Start DB2:
/etc/init.d/mysql start
View run status after startup
Mysql> Show status like ' wsrep% ';
Show:
Wsrep_cluster_size 2
Wsrep_cluster_status Primary
Wsrep_connected on
Wsrep_ready on
Description DB2 Node Configuration succeeded
6. Node DB3 configuration
DB3 configuration is similar to DB1 configuration, the only few parameters are modified as follows:
Server-id = 1012
wsrep_sst_receive_address=10.0.10.12:4444
Wsrep_node_name=ip-10-0-10-12
Start DB3:
/etc/init.d/mysql start
View run status after startup
Mysql> Show status like ' wsrep% ';
Show:
Wsrep_cluster_size 3
Wsrep_cluster_status Primary
Wsrep_connected on
Wsrep_ready on
Description DB3 Node Configuration succeeded
Please add qq:271416962 if you have any questions.
This article is from the "11095126" blog, please be sure to keep this source http://11105126.blog.51cto.com/11095126/1880679
Percona XTRADB cluster 5.5 cluster production environment Installation II