Installation Environment:
Cluster Name |
Pxc_lk |
Node 1: |
192.168.1.20 |
Node 2: |
192.168.1.21 |
Node 3: |
192.168.1.22 |
All node installationswget http://www.percona.com/redir/downloads/XtraBackup/LATEST/binary/redhat/6/x86_64/ percona-xtrabackup-2.2.3-4982.el6.x86_64.rpm wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/ Latest/binary/linux/x86_64/percona-xtradb-cluster-5.5.37-rel35.0-25.10.756.linux.x86_64.tar.gzyum Install Perl-dbd-mysqlyum Install Perl-io-socket-ssl.noarchYum Install SocatYum Install NCall nodes install the PXC databasecd/opt/mysql/tar-zxvf/root/percona-xtradb-cluster-5.5.37-rel35.0-25.10.756.linux.x86_64.tar.gz ln-s/opt/mysql/ percona-xtradb-cluster-5.5.37-rel35.0-25.10.756.linux.x86_64//usr/local/pxc_3308 configuration file to be placed in the default/etc/my.cnfvi/etc/ My.cnf --Configuration file note the following parameters and add the Red Section
basedir = / opt / mysql / Percona - xtradb - cluster - 5.5 37 - rel35 0 - 25.10 756.linux x86_64
datadir =/data/mysql/pxc_3308/data
tmpdir =/data/mysql/pxc_3308/tmp
server_id =203308
#percona xtradb cluster
binlog_format = ROW
--The log format must be row
default_storage_engine=InnoDB
innodb_locks_unsafe_for_binlog=1
innodb_autoinc_lock_mode=2
wsrep_cluster_name=pcx_lk
--cluster's name.
wsrep_cluster_address=gcomm://192.168.1.20,192.168.1.21,192.168.1.22 --集群中所有node-ip
wsrep_node_address = 192.168 1.20 --each node is configured as its own ip
wsrep_provider=/usr/local/pxc_3308/lib/libgalera_smm.so
#wsrep_sst_method=rsync
wsrep_sst_method=xtrabackup
wsrep_sst_auth=sst:wubxwubx --运输的用户
Mkdir-p/data/mysql/pxc_3308/{data,tmp,logs}chown-r Mysql:mysql/data/mysqlLN-SF/USR/LIB64/LIBSSL.SO.10/USR/LIB64/LIBSSL.SO.6LN-SF/USR/LIB64/LIBCRYPTO.SO.10/USR/LIB64/LIBCRYPTO.SO.6CD/ opt/mysql/percona-xtradb-cluster-5.5.37-rel35.0-25.10.756.linux.x86_64/./scripts/mysql_install_db--datadir=/ DATA/MYSQL/PXC_3308/DATACP SUPPORT-FILES/MYSQL.SERVER/ETC/INIT.D/MYSQL-PXCVI/ETC/INIT.D/MYSQL-PXC
basedir =/ / mysql / Percona - xtradb - cluster - 5.5 37 - rel35 0 - 25.10 756.linux x86_64
datadir=/data/mysql/pxc_3308/data
The first node starts:#/ETC/INIT.D/MYSQL-PXC BOOTSTRAP-PXC --cannot be started with mysqldAfter startup, go to MySQL Create user (testing) [Email protected]alhost [(none)]> grant all privileges on * * to ' SST ' @ '% ' identified by ' Wubxw UBX ';(testing) [email protected] [(none)]> grant Reload,lock tables, replication client on * * to ' sst ' @ ' localhost ' iden Tified by ' WUBXWUBX ';(testing) [email protected] [(none)]> flush privileges;then start the other node:#/ETC/INIT.D/MYSQL-PXC Start
15, high-usable PXC (Percona xtradb cluster) construction