需求场景:原有的pxc环境数据量已经比较大,新买的服务器要加入此集群中,如何让其用IST的方式传输,而不是SST.

PXC传输数据有两种方式:

IST: Incremental State Transfer 增量同步
    SST:State Snapshot Transfer 全量同步

IST 发生的条件:This is done using caching mechanism on nodes (即只发生在之前集群里的节点数据还有在缓存中)

判断方法:

mysql> show global status like 'wsrep_local_cached_downto';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| wsrep_local_cached_downto | 1     |
+---------------------------+-------+
1 row in set (0.00 sec)

此值小于新开节点的seqno:

[root@zejin241 I6000]# cat grastate.dat
# GALERA saved state
version: 2.1
uuid:    6c86dc17-246f-11e6-9955-ae4d7e89eed2
seqno:   4
cert_index:

所以我们的思路即通过备份一个集群中节点的数据,恢复到新节点上,并伪造一个grastate.dat,来记录备份数据的seqno,这样当新节点启动时就会自动用IST的方法来进行,而不是SST(注意gcache.size应该有足够的容量来保证在备份及恢复这段时间内新产生的数据都被缓存到)

galera.cache:  This file is used as a main writeset store. It’s implemented as a permanent ring-buffer file
that is preallocated on disk when the node is initialized. File size can be controlled with the variable
gcache.size. If this value is bigger, more writesets are cached and chances are better that the rejoining node will get IST instead of SST. Filename can be changed with the gcache.name variable.

关于如何搭建一个pxc环境请看:http://www.cnblogs.com/zejin2008/p/5475285.html

如下为这次的操作步骤:

node240:192.168.1.240  --已经存在的集群节点

node241:192.168.1.241  --将要加入的集群节点

step1:启动新的集群中的第一个节点

/usr/local/pxc_56/bin/mysqld_safe --defaults-file=/home/mysql/pxc6000.cnf --ledir=/usr/local/pxc_56/bin/ --wsrep-new-cluster  &

配置文件如下:

[root@zejin240 I6000]# cat /home/mysql/pxc6000.cnf
[client]
port =
socket = /home/mysql/I6000/mysql.sock
default-character-set=utf8 [mysqld]
basedir = /usr/local/pxc_56
datadir = /home/mysql/I6000 pid-file = /home/mysql/I6000/mysql.pid
character-set-server=utf8
init_connect = 'SET NAMES utf8'
log-bin=/home/mysql/I6000/log_bin
server-id = innodb_buffer_pool_size = 100M
innodb_data_file_path = ibdata1:10M:autoextend
innodb_data_home_dir = /home/mysql/I6000
innodb_file_per_table= skip-name-resolve port =
socket = /home/mysql/I6000/mysql.sock
user=mysql
log_error=/home/mysql/I6000/mysql_error.log #pxc
user=mysql
log_error=error.log
binlog_format=ROW # for mysqld port, for sst port, for ist port, for cluster communication port
wsrep_cluster_address='gcomm://192.168.1.240:6030,192.168.1.241:6030,192.168.1.242:6030'
wsrep_provider=/usr/local/pxc_56/lib/libgalera_smm.so
wsrep_sst_receive_address=192.168.1.240:
wsrep_node_incoming_address=192.168.1.240:
wsrep_node_address=192.168.1.240:
wsrep_provider_options = "gmcast.listen_addr=tcp://192.168.1.240:6030;ist.recv_addr=192.168.1.240:6031;" wsrep_slave_threads=
wsrep_cluster_name=pxc_zejin
wsrep_sst_method=xtrabackup-v2
wsrep_node_name=node6000_240
innodb_autoinc_lock_mode=
wsrep_sst_auth="sstuser:123"
log-slave-updates [mysql]
no-auto-rehash
default-character-set=utf8

连接进去并创造更改一些数据:

mysql> use zejin;
mysql> select * from t1;
+----+-------+
| id | name |
+----+-------+
| 1 | chen |
| 2 | li |
| 3 | zhang |
+----+-------+
3 rows in set (0.01 sec) mysql> update mysql.user set password=password('');
mysql> flush privileges;
mysql> show master status;
+----------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+----------------+----------+--------------+------------------+-------------------+
| log_bin.000003 | 2772 | | | |
+----------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

step2:用innobackupex备份node240数据:

[root@zejin240 mysql]# innobackupex --user=root --password= --port= --host=127.0.0.1 --defaults-file=/home/mysql/pxc6000.cnf /home/mysql/

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright ,  Innobase Oy
and Percona LLC and/or its affiliates -. All Rights Reserved. This software is published under
the GNU GENERAL PUBLIC LICENSE Version , June . Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p :: innobackupex: Executing a version check against the server...
:: innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/home/mysql/pxc6000.cnf;mysql_read_default_group=xtrabackup;host=127.0.0.1;port=6000' as 'root' (using password: YES).
:: innobackupex: Connected to MySQL server
:: innobackupex: Done.
:: innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/home/mysql/pxc6000.cnf;mysql_read_default_group=xtrabackup;host=127.0.0.1;port=6000' as 'root' (using password: YES).
:: innobackupex: Connected to MySQL server
:: innobackupex: Starting the backup operation IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!". innobackupex: Using server version 5.6.-74.0-25.12-log innobackupex: Created backup directory /home/mysql/--28_09-- :: innobackupex: Starting ibbackup with command: xtrabackup --defaults-file="/home/mysql/pxc6000.cnf" --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/home/mysql/--28_09-- --innodb_log_file_size="" --tmpdir=/tmp --extra-lsndir='/tmp'
innobackupex: Waiting for ibbackup (pid=) to suspend
innobackupex: Suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_suspended_2' xtrabackup version 2.2. based on MySQL server 5.6. Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /home/mysql/I6000
xtrabackup: open files limit requested , set to
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = /home/mysql/I6000
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group =
xtrabackup: innodb_log_file_size =
>> log scanned up to ()
xtrabackup: Generating a list of tablespaces
[] Copying /home/mysql/I6000/ibdata1 to /home/mysql/--28_09--/ibdata1
>> log scanned up to ()
[] ...done
[] Copying ./zejin/t1.ibd to /home/mysql/--28_09--/zejin/t1.ibd
[] ...done
[] Copying ./mysql/innodb_table_stats.ibd to /home/mysql/--28_09--/mysql/innodb_table_stats.ibd
[] ...done
[] Copying ./mysql/slave_master_info.ibd to /home/mysql/--28_09--/mysql/slave_master_info.ibd
[] ...done
[] Copying ./mysql/slave_relay_log_info.ibd to /home/mysql/--28_09--/mysql/slave_relay_log_info.ibd
[] ...done
[] Copying ./mysql/slave_worker_info.ibd to /home/mysql/--28_09--/mysql/slave_worker_info.ibd
[] ...done
[] Copying ./mysql/innodb_index_stats.ibd to /home/mysql/--28_09--/mysql/innodb_index_stats.ibd
[] ...done
>> log scanned up to ()
xtrabackup: Creating suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_suspended_2' with pid '' :: innobackupex: Continuing after ibbackup has suspended
:: innobackupex: Executing LOCK TABLES FOR BACKUP...
:: innobackupex: Backup tables lock acquired :: innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/home/mysql/I6000/'
innobackupex: Backing up files '/home/mysql/I6000//performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' ( files)
>> log scanned up to ()
innobackupex: Backing up file '/home/mysql/I6000//zejin/db.opt'
innobackupex: Backing up file '/home/mysql/I6000//zejin/t1.frm'
innobackupex: Backing up files '/home/mysql/I6000//mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' ( files)
:: innobackupex: Finished backing up non-InnoDB tables and files :: innobackupex: Executing LOCK BINLOG FOR BACKUP...
:: innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
:: innobackupex: Waiting for log copying to finish xtrabackup: The latest check point (for incremental): ''
xtrabackup: Stopping log copying thread.
.>> log scanned up to () xtrabackup: Creating suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_log_copied' with pid ''
xtrabackup: Transaction log of lsn () to () was copied.
:: innobackupex: Executing UNLOCK BINLOG
:: innobackupex: Executing UNLOCK TABLES
:: innobackupex: All tables unlocked innobackupex: Backup created in directory '/home/mysql/2016-05-28_09-39-07'
innobackupex: MySQL binlog position: filename 'log_bin.000003', position
:: innobackupex: Connection to database server closed
:: innobackupex: completed OK!
[root@zejin240 --28_09--]# ll
total
-rw-r--r--. root root May : backup-my.cnf
-rw-r-----. root root May : ibdata1
drwx------. root root May : mysql
drwxr-xr-x. root root May : performance_schema
-rw-r--r--. root root May : xtrabackup_binlog_info
-rw-r-----. root root May : xtrabackup_checkpoints
-rw-r--r--. root root May : xtrabackup_info
-rw-r-----. root root May : xtrabackup_logfile
drwx------. root root May : zejin

step3:此时我们在node240上再加入一些数据:

此时我们再在node240上插入一些数据:
mysql> use zejin;
mysql> insert into t1(name) values('lin');
Query OK, 1 row affected (0.06 sec) mysql> insert into t1(name) values('liang');
Query OK, 1 row affected (0.00 sec) mysql> select * from t1;
+----+-------+
| id | name |
+----+-------+
| 1 | chen |
| 2 | li |
| 3 | zhang |
| 4 | lin |
| 5 | liang |
+----+-------+
5 rows in set (0.00 sec)

step4:将备份的数据传输到node241上并恢复:

[root@zejin241 mysql]# innobackupex --apply-log 2016-05-28_09-39-07/

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved. This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p 160528 09:54:01 innobackupex: Starting the apply-log operation IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex
prints "completed OK!". 160528 09:54:01 innobackupex: Starting ibbackup with command: xtrabackup --defaults-file="/home/mysql/2016-05-28_09-39-07/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/home/mysql/2016-05-28_09-39-07 xtrabackup version 2.2.11 based on MySQL server 5.6.24 Linux (x86_64) (revision id: )
xtrabackup: cd to /home/mysql/2016-05-28_09-39-07
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1637591)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1637591
InnoDB: Database was not shutdown normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages
InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1637598 (0%)
InnoDB: Last MySQL binlog file position 0 2772, file name log_bin.000003
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.24 started; log sequence number 1637598 [notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 2772, file name log_bin.000003 xtrabackup: Recovered WSREP position: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1637608 160528 09:54:03 innobackupex: Restarting xtrabackup with command: xtrabackup --defaults-file="/home/mysql/2016-05-28_09-39-07/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/home/mysql/2016-05-28_09-39-07
for creating ib_logfile* xtrabackup version 2.2.11 based on MySQL server 5.6.24 Linux (x86_64) (revision id: )
xtrabackup: cd to /home/mysql/2016-05-28_09-39-07
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Setting log file ./ib_logfile101 size to 48 MB
InnoDB: Setting log file ./ib_logfile1 size to 48 MB
InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
InnoDB: New log files created, LSN=1637608
InnoDB: Highest supported file format is Barracuda.
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.24 started; log sequence number 1637900 [notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 2772, file name log_bin.000003 xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1637910
160528 09:54:06 innobackupex: completed OK!
[root@zejin240 2016-05-28_09-39-07]# ll
total 176168
-rw-r--r--. 1 root root 358 May 28 09:39 backup-my.cnf
-rw-r-----. 1 root root 77594624 May 28 09:54 ibdata1
-rw-r--r--. 1 root root 50331648 May 28 09:54 ib_logfile0
-rw-r--r--. 1 root root 50331648 May 28 09:54 ib_logfile1
drwx------. 2 root root 4096 May 28 09:39 mysql
drwxr-xr-x. 2 root root 4096 May 28 09:39 performance_schema
-rw-r--r--. 1 root root 20 May 28 09:39 xtrabackup_binlog_info
-rw-r--r--. 1 root root 20 May 28 09:54 xtrabackup_binlog_pos_innodb
-rw-r-----. 1 root root 89 May 28 09:54 xtrabackup_checkpoints
-rw-r--r--. 1 root root 38 May 28 09:54 xtrabackup_galera_info
-rw-r--r--. 1 root root 635 May 28 09:39 xtrabackup_info
-rw-r-----. 1 root root 2097152 May 28 09:54 xtrabackup_logfile
drwx------. 2 root root 4096 May 28 09:39 zejin

step5:找出Xid的位置

有两种方法

方法一:查看文件xtrabackup_galera_info

[root@zejin241 I6000]# cat xtrabackup_galera_info
6c86dc17-246f-11e6--ae4d7e89eed2:

方法二:通过binlog位置来查找:

[root@zejin241 I6000]# cat xtrabackup_binlog_info
log_bin.

即备份时的备份点位置为log_bin.000003

我们再去主库查找此binlog对应的xid

[root@zejin240 I6000]# mysqlbinlog -vv log_bin. | grep Xid
# :: server id end_log_pos CRC32 0x37371b3e Xid =
# :: server id end_log_pos CRC32 0xf7973829 Xid =
# :: server id end_log_pos CRC32 0x8db2aa41 Xid =

发现竟然没有此位置的xid,原因在于我们在最上面更新mysql.user表了,而此表是myisam表,不会有Xid的记录,这种情况时我们根据上下位置把Xid设置为8

step6:在node241上伪造一个grastate.dat文件(从node240上复制过来,更改下seqno即可):

# GALERA saved state
version: 2.1
uuid: 6c86dc17-246f-11e6--ae4d7e89eed2
seqno:
cert_index:

step7:启动新节点:

启动node241:
[root@zejin241 mysql]# /usr/local/pxc_56/bin/mysqld_safe --defaults-file=/home/mysql/pxc6000.cnf --ledir=/usr/local/pxc_56/bin/ &
[]
[root@zejin241 mysql]# :: mysqld_safe Logging to '/home/mysql/I6000/error.log'.
:: mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000
:: mysqld_safe Skipping wsrep-recover for 6c86dc17-246f-11e6--ae4d7e89eed2: pair
:: mysqld_safe Assigning 6c86dc17-246f-11e6--ae4d7e89eed2: to wsrep_start_position 查看下启动过程的日志:
[root@zejin241 I6000]# cat error.log
:: mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000
:: mysqld_safe Skipping wsrep-recover for 6c86dc17-246f-11e6--ae4d7e89eed2: pair
:: mysqld_safe Assigning 6c86dc17-246f-11e6--ae4d7e89eed2: to wsrep_start_position
-- :: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: [Note] /usr/local/pxc_56/bin//mysqld (mysqld 5.6.26-74.0-25.12-log) starting as process 56931 ...
-- :: [Note] WSREP: Read nil XID from storage engines, skipping position init
-- :: [Note] WSREP: wsrep_load(): loading provider library '/usr/local/pxc_56/lib/libgalera_smm.so'
-- :: [Note] WSREP: wsrep_load(): Galera 3.12.(rf3e626d) by Codership Oy <info@codership.com> loaded successfully.
-- :: [Note] WSREP: CRC-32C: using hardware acceleration.
-- :: [Note] WSREP: Found saved state: 6c86dc17-246f-11e6--ae4d7e89eed2:
-- :: [Note] WSREP: Passing config to GCS: base_dir = /home/mysql/I6000/; base_host = 192.168.1.241; base_port = ; cert.log_conflicts = no; debug = no; evs.auto_evict = ; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = ; evs.send_window = ; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = ; evs.view_forget_timeout = PT24H; gcache.dir = /home/mysql/I6000/; gcache.keep_pages_count = ; gcache.keep_pages_size = ; gcache.mem_size = ; gcache.name = /home/mysql/I6000//galera.cache; gcache.page_size = 128M; gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.listen_addr = tcp://192.168.1.241:6030; gmcast.segment = 0; gmcast.version = 0; ist.recv_a
-- :: [Note] WSREP: Service thread queue flushed.
-- :: [Note] WSREP: Assign initial position for certification: , protocol version: -
-- :: [Note] WSREP: wsrep_sst_grab()
-- :: [Note] WSREP: Start replication
-- :: [Note] WSREP: Setting initial position to 6c86dc17-246f-11e6--ae4d7e89eed2:
-- :: [Note] WSREP: protonet asio version
-- :: [Note] WSREP: Using CRC-32C for message checksums.
-- :: [Note] WSREP: backend: asio
-- :: [Warning] WSREP: access file(/home/mysql/I6000//gvwstate.dat) failed(No such file or directory)
-- :: [Note] WSREP: restore pc from disk failed
-- :: [Note] WSREP: GMCast version
-- :: [Note] WSREP: (275a2ebd, 'tcp://192.168.1.241:6030') listening at tcp://192.168.1.241:6030
-- :: [Note] WSREP: (275a2ebd, 'tcp://192.168.1.241:6030') multicast: , ttl:
-- :: [Note] WSREP: EVS version
-- :: [Note] WSREP: gcomm: connecting to group 'pxc_zejin', peer '192.168.1.240:6030,192.168.1.241:6030,192.168.1.242:6030'
-- :: [Note] WSREP: (275a2ebd, 'tcp://192.168.1.241:6030') turning message relay requesting on, nonlive peers:
-- :: [Note] WSREP: declaring 6c48c86c at tcp://192.168.1.240:6030 stable
-- :: [Note] WSREP: Node 6c48c86c state prim
-- :: [Note] WSREP: view(view_id(PRIM,275a2ebd,) memb {
275a2ebd,
6c48c86c,
} joined {
} left {
} partitioned {
})
-- :: [Note] WSREP: save pc into disk
-- :: [Note] WSREP: discarding pending addr without UUID: tcp://192.168.1.242:6030
-- :: [Note] WSREP: gcomm: connected
-- :: [Note] WSREP: Changing maximum packet size to , resulting msg size:
-- :: [Note] WSREP: Shifting CLOSED -> OPEN (TO: )
-- :: [Note] WSREP: Opened channel 'pxc_zejin'
-- :: [Note] WSREP: Waiting for SST to complete.
-- :: [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = , memb_num =
-- :: [Note] WSREP: STATE_EXCHANGE: sent state UUID: 2800468f--11e6-8c7c-de1ade51709a
-- :: [Note] WSREP: STATE EXCHANGE: sent state msg: 2800468f--11e6-8c7c-de1ade51709a
-- :: [Note] WSREP: STATE EXCHANGE: got state msg: 2800468f--11e6-8c7c-de1ade51709a from (node6000_241)
-- :: [Note] WSREP: STATE EXCHANGE: got state msg: 2800468f--11e6-8c7c-de1ade51709a from (node6000_240)
-- :: [Note] WSREP: Quorum results:
version = ,
component = PRIMARY,
conf_id = ,
members = / (joined/total),
act_id = ,
last_appl. = -,
protocols = // (gcs/repl/appl),
group UUID = 6c86dc17-246f-11e6--ae4d7e89eed2
-- :: [Note] WSREP: Flow-control interval: [, ]
-- :: [Note] WSREP: Shifting OPEN -> PRIMARY (TO: )
-- :: [Note] WSREP: State transfer required:
Group state: 6c86dc17-246f-11e6--ae4d7e89eed2:
Local state: 6c86dc17-246f-11e6--ae4d7e89eed2:
-- :: [Note] WSREP: New cluster view: global state: 6c86dc17-246f-11e6--ae4d7e89eed2:, view# : Primary, number of nodes: , my index: , protocol version
-- :: [Warning] WSREP: Gap in state sequence. Need state transfer.
-- :: [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.241:' --datadir '/home/mysql/I6000/' --defaults-file '/home/mysql/pxc6000.cnf' --defaults-group-suffix '' --parent '' '' '
-- :: [Note] WSREP: (275a2ebd, 'tcp://192.168.1.241:6030') turning message relay requesting off
WSREP_SST: [INFO] Streaming with xbstream ( ::25.322)
WSREP_SST: [INFO] Using socat as streamer ( ::25.324)
WSREP_SST: [INFO] Evaluating timeout -s9 socat -u TCP-LISTEN:,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) ( ::25.891)
-- :: [Note] WSREP: Prepared SST request: xtrabackup-v2|192.168.1.241:/xtrabackup_sst//
-- :: [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
-- :: [Note] WSREP: REPL Protocols: (, )
-- :: [Note] WSREP: Service thread queue flushed.
-- :: [Note] WSREP: Assign initial position for certification: , protocol version:
-- :: [Note] WSREP: Service thread queue flushed.
2016-05-28 11:06:27 56931 [Note] WSREP: Prepared IST receiver, listening at: tcp://192.168.1.241:6031
-- :: [Note] WSREP: Member 0.0 (node6000_241) requested state transfer from '*any*'. Selected 1.0 (node6000_240)(SYNCED) as donor.
-- :: [Note] WSREP: Shifting PRIMARY -> JOINER (TO: )
-- :: [Note] WSREP: Requesting state transfer: success, donor:
-- :: [Note] WSREP: 1.0 (node6000_240): State transfer to 0.0 (node6000_241) complete.
-- :: [Note] WSREP: Member 1.0 (node6000_240) synced with group.
WSREP_SST: [INFO] xtrabackup_ist received from donor: Running IST ( ::31.257)
WSREP_SST: [INFO] Galera co-ords from recovery: 6c86dc17-246f-11e6--ae4d7e89eed2: ( ::31.261)
WSREP_SST: [INFO] Total time on joiner: seconds ( ::31.265)
WSREP_SST: [INFO] Removing the sst_in_progress file ( ::31.268)
-- :: [Note] WSREP: SST complete, seqno:
-- :: [Note] Plugin 'FEDERATED' is disabled.
-- :: [Note] InnoDB: Using atomics to ref count buffer pool pages
-- :: [Note] InnoDB: The InnoDB memory heap is disabled
-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
-- :: [Note] InnoDB: Memory barrier is not used
-- :: [Note] InnoDB: Compressed tables use zlib 1.2.
-- :: [Note] InnoDB: Using Linux native AIO
-- :: [Note] InnoDB: Using CPU crc32 instructions
-- :: [Note] InnoDB: Initializing buffer pool, size = 100.0M
-- :: [Note] InnoDB: Completed initialization of buffer pool
-- :: [Note] InnoDB: Highest supported file format is Barracuda.
-- :: [Note] InnoDB: rollback segment(s) are active.
-- :: [Note] InnoDB: Waiting for purge to start
-- :: [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 1637910
-- :: [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 2e7b3e12--11e6-8fe4-000c2973aa48.
-- :: [Note] RSA private key file not found: /home/mysql/I6000//private_key.pem. Some authentication plugins will not work.
-- :: [Note] RSA public key file not found: /home/mysql/I6000//public_key.pem. Some authentication plugins will not work.
-- :: [Note] Server hostname (bind-address): '*'; port:
-- :: [Note] IPv6 is available.
-- :: [Note] - '::' resolves to '::';
-- :: [Note] Server socket created on IP: '::'.
-- :: [Warning] 'user' entry 'root@zejin240' ignored in --skip-name-resolve mode.
-- :: [Warning] 'user' entry '@zejin240' ignored in --skip-name-resolve mode.
-- :: [Warning] 'proxies_priv' entry '@ root@zejin240' ignored in --skip-name-resolve mode.
-- :: [Note] Event Scheduler: Loaded events
-- :: [Note] WSREP: Signalling provider to continue.
-- :: [Note] WSREP: Initialized wsrep sidno
-- :: [Note] WSREP: SST received: 6c86dc17-246f-11e6--ae4d7e89eed2:
-- :: [Note] WSREP: Receiving IST: 2 writesets, seqnos 8-10
-- :: [Note] /usr/local/pxc_56/bin//mysqld: ready for connections.
Version: '5.6.26-74.0-25.12-log' socket: '/home/mysql/I6000/mysql.sock' port: Percona XtraDB Cluster binary (GPL) 5.6.-25.12, Revision 624ef81, wsrep_25.
-- :: [Note] WSREP: IST received: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:10
-- :: [Note] WSREP: 0.0 (node6000_241): State transfer from 1.0 (node6000_240) complete.
-- :: [Note] WSREP: Shifting JOINER -> JOINED (TO: )
-- :: [Note] WSREP: Member 0.0 (node6000_241) synced with group.
-- :: [Note] WSREP: Shifting JOINED -> SYNCED (TO: )
-- :: [Note] WSREP: Synchronized with group, ready for connections
-- :: [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
成功用IST来恢复了。

step8 登陆新节点node241,查看数据是否正常:

[root@zejin241 I6000]# /usr/local/pxc_56/bin/mysql -uroot -p -h127.0.0.1 -P6000
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.26-74.0-25.12-log Percona XtraDB Cluster binary (GPL) 5.6.26-25.12, Revision 624ef81, wsrep_25.12 Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zejin |
+--------------------+
4 rows in set (0.12 sec) mysql> use zejin;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> select * from t1;
+----+-------+
| id | name |
+----+-------+
| 1 | chen |
| 2 | li |
| 3 | zhang |
| 4 | lin |
| 5 | liang |
+----+-------+
5 rows in set (0.01 sec)
发现数据也已经全部同步完成。

step9:对比SST时的日志输出:

在数据复制到node241上我们不进行伪造grastate.dat操作,直接启动节点node241
[root@zejin241 I6000]# /usr/local/pxc_56/bin/mysqld_safe --defaults-file=/home/mysql/pxc6000.cnf --ledir=/usr/local/pxc_56/bin &
[]
[root@zejin241 I6000]# :: mysqld_safe Logging to '/home/mysql/I6000/error.log'.
:: mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000
:: mysqld_safe Skipping wsrep-recover for empty datadir: /home/mysql/I6000
:: mysqld_safe Assigning ----:- to wsrep_start_position 查看错误日志:
[root@zejin241 I6000]# cat error.log
:: mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000
:: mysqld_safe Skipping wsrep-recover for empty datadir: /home/mysql/I6000
:: mysqld_safe Assigning ----:- to wsrep_start_position
-- :: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: [Note] /usr/local/pxc_56/bin/mysqld (mysqld 5.6.-74.0-25.12-log) starting as process ...
-- :: [Note] WSREP: Read nil XID from storage engines, skipping position init
-- :: [Note] WSREP: wsrep_load(): loading provider library '/usr/local/pxc_56/lib/libgalera_smm.so'
-- :: [Note] WSREP: wsrep_load(): Galera 3.12.(rf3e626d) by Codership Oy <info@codership.com> loaded successfully.
-- :: [Note] WSREP: CRC-32C: using hardware acceleration.
-- :: [Warning] WSREP: Could not open state file for reading: '/home/mysql/I6000//grastate.dat'
-- :: [Note] WSREP: Found saved state: ----:-
-- :: [Note] WSREP: Passing config to GCS: base_dir = /home/mysql/I6000/; base_host = 192.168.1.241; base_port = ; cert.log_conflicts = no; debug = no; evs.auto_evict = ; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = ; evs.send_window = ; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = ; evs.view_forget_timeout = PT24H; gcache.dir = /home/mysql/I6000/; gcache.keep_pages_count = ; gcache.keep_pages_size = ; gcache.mem_size = ; gcache.name = /home/mysql/I6000//galera.cache; gcache.page_size = 128M; gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.listen_addr = tcp://192.168.1.241:6030; gmcast.segment = 0; gmcast.version = 0; ist.recv_a
-- :: [Note] WSREP: Service thread queue flushed.
-- :: [Note] WSREP: Assign initial position for certification: -, protocol version: -
-- :: [Note] WSREP: wsrep_sst_grab()
-- :: [Note] WSREP: Start replication
-- :: [Note] WSREP: Setting initial position to ----:-
-- :: [Note] WSREP: protonet asio version
-- :: [Note] WSREP: Using CRC-32C for message checksums.
-- :: [Note] WSREP: backend: asio
-- :: [Warning] WSREP: access file(/home/mysql/I6000//gvwstate.dat) failed(No such file or directory)
-- :: [Note] WSREP: restore pc from disk failed
-- :: [Note] WSREP: GMCast version
-- :: [Note] WSREP: (666e7891, 'tcp://192.168.1.241:6030') listening at tcp://192.168.1.241:6030
-- :: [Note] WSREP: (666e7891, 'tcp://192.168.1.241:6030') multicast: , ttl:
-- :: [Note] WSREP: EVS version
-- :: [Note] WSREP: gcomm: connecting to group 'pxc_zejin', peer '192.168.1.240:6030,192.168.1.241:6030,192.168.1.242:6030'
-- :: [Note] WSREP: (666e7891, 'tcp://192.168.1.241:6030') turning message relay requesting on, nonlive peers:
-- :: [Note] WSREP: declaring 2cadc8a9 at tcp://192.168.1.240:6030 stable
-- :: [Note] WSREP: Node 2cadc8a9 state prim
-- :: [Note] WSREP: view(view_id(PRIM,2cadc8a9,) memb {
2cadc8a9,
666e7891,
} joined {
} left {
} partitioned {
})
-- :: [Note] WSREP: save pc into disk
-- :: [Note] WSREP: discarding pending addr without UUID: tcp://192.168.1.242:6030
-- :: [Note] WSREP: discarding pending addr proto entry 0x30f9560
-- :: [Note] WSREP: gcomm: connected
-- :: [Note] WSREP: Changing maximum packet size to , resulting msg size:
-- :: [Note] WSREP: Shifting CLOSED -> OPEN (TO: )
-- :: [Note] WSREP: Opened channel 'pxc_zejin'
-- :: [Note] WSREP: Waiting for SST to complete.
-- :: [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = , memb_num =
-- :: [Note] WSREP: STATE EXCHANGE: Waiting for state UUID.
-- :: [Note] WSREP: STATE EXCHANGE: sent state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c632
-- :: [Note] WSREP: STATE EXCHANGE: got state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c632 from (node6000_240)
-- :: [Note] WSREP: STATE EXCHANGE: got state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c632 from (node6000_241)
-- :: [Note] WSREP: Quorum results:
version = ,
component = PRIMARY,
conf_id = ,
members = / (joined/total),
act_id = ,
last_appl. = -,
protocols = // (gcs/repl/appl),
group UUID = 6c86dc17-246f-11e6--ae4d7e89eed2
-- :: [Note] WSREP: Flow-control interval: [, ]
-- :: [Note] WSREP: Shifting OPEN -> PRIMARY (TO: )
-- :: [Note] WSREP: State transfer required:
Group state: 6c86dc17-246f-11e6--ae4d7e89eed2:
Local state: ----:-
-- :: [Note] WSREP: New cluster view: global state: 6c86dc17-246f-11e6--ae4d7e89eed2:, view# : Primary, number of nodes: , my index: , protocol version
-- :: [Warning] WSREP: Gap in state sequence. Need state transfer.
-- :: [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.1.241:' --datadir '/home/mysql/I6000/' --defaults-file '/home/mysql/pxc6000.cnf' --defaults-group-suffix '' --parent '' '' '
WSREP_SST: [INFO] Streaming with xbstream ( ::59.795)
WSREP_SST: [INFO] Using socat as streamer ( ::59.797)
WSREP_SST: [INFO] Evaluating timeout -s9 socat -u TCP-LISTEN:,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) ( ::59.840)
-- :: [Note] WSREP: Prepared SST request: xtrabackup-v2|192.168.1.241:/xtrabackup_sst//
-- :: [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
-- :: [Note] WSREP: REPL Protocols: (, )
-- :: [Note] WSREP: Service thread queue flushed.
-- :: [Note] WSREP: Assign initial position for certification: , protocol version:
-- :: [Note] WSREP: Service thread queue flushed.
-- :: [Warning] WSREP: Failed to prepare for incremental state transfer: Local state UUID (----) does not match group state UUID (6c86dc17-246f-11e6--ae4d7e89eed2): (Operation not permitted)
at galera/src/replicator_str.cpp:prepare_for_IST():. IST will be unavailable.
-- :: [Note] WSREP: Member 1.0 (node6000_241) requested state transfer from '*any*'. Selected 0.0 (node6000_240)(SYNCED) as donor.
-- :: [Note] WSREP: Shifting PRIMARY -> JOINER (TO: )
-- :: [Note] WSREP: Requesting state transfer: success, donor:
WSREP_SST: [INFO] Proceeding with SST ( ::00.512)
WSREP_SST: [INFO] Evaluating socat -u TCP-LISTEN:,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) ( ::00.515)
WSREP_SST: [INFO] Cleaning the existing datadir and innodb-data/log directories (20160528 15:33:00.517)
removed `/home/mysql/I6000/ib_logfile0'
removed `/home/mysql/I6000/ib_logfile1'
removed `/home/mysql/I6000/xtrabackup_info'
removed `/home/mysql/I6000/xtrabackup_checkpoints'
removed `/home/mysql/I6000/performance_schema/rwlock_instances.frm'
removed `/home/mysql/I6000/performance_schema/db.opt'
removed `/home/mysql/I6000/performance_schema/session_account_connect_attrs.frm'
removed `/home/mysql/I6000/performance_schema/performance_timers.frm'
removed `/home/mysql/I6000/performance_schema/setup_objects.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_user_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_digest.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_history.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_user_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/setup_timers.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_account_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_thread_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/session_connect_attrs.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_history_long.frm'
removed `/home/mysql/I6000/performance_schema/table_io_waits_summary_by_index_usage.frm'
removed `/home/mysql/I6000/performance_schema/table_io_waits_summary_by_table.frm'
removed `/home/mysql/I6000/performance_schema/host_cache.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_global_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_host_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_current.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_thread_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/mutex_instances.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_host_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/objects_summary_global_by_type.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_current.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_summary_global_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/threads.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_history.frm'
removed `/home/mysql/I6000/performance_schema/file_summary_by_instance.frm'
removed `/home/mysql/I6000/performance_schema/table_lock_waits_summary_by_table.frm'
removed `/home/mysql/I6000/performance_schema/setup_instruments.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_thread_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/users.frm'
removed `/home/mysql/I6000/performance_schema/socket_summary_by_instance.frm'
removed `/home/mysql/I6000/performance_schema/socket_instances.frm'
removed `/home/mysql/I6000/performance_schema/setup_consumers.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_host_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_instance.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_current.frm'
removed `/home/mysql/I6000/performance_schema/socket_summary_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_history_long.frm'
removed `/home/mysql/I6000/performance_schema/cond_instances.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_history_long.frm'
removed `/home/mysql/I6000/performance_schema/events_waits_history.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_account_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_statements_summary_global_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_account_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/file_instances.frm'
removed `/home/mysql/I6000/performance_schema/hosts.frm'
removed `/home/mysql/I6000/performance_schema/setup_actors.frm'
removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_user_by_event_name.frm'
removed `/home/mysql/I6000/performance_schema/accounts.frm'
removed `/home/mysql/I6000/performance_schema/file_summary_by_event_name.frm'
removed directory: `/home/mysql/I6000/performance_schema'
removed `/home/mysql/I6000/zejin/db.opt'
removed `/home/mysql/I6000/zejin/t1.ibd'
removed `/home/mysql/I6000/zejin/t1.frm'
removed directory: `/home/mysql/I6000/zejin'
removed `/home/mysql/I6000/xtrabackup_binlog_info'
removed `/home/mysql/I6000/backup-my.cnf'
removed `/home/mysql/I6000/xtrabackup_binlog_pos_innodb'
removed `/home/mysql/I6000/mysql/time_zone_transition_type.MYI'
removed `/home/mysql/I6000/mysql/time_zone_transition.MYI'
removed `/home/mysql/I6000/mysql/servers.MYD'
removed `/home/mysql/I6000/mysql/ndb_binlog_index.frm'
removed `/home/mysql/I6000/mysql/servers.MYI'
removed `/home/mysql/I6000/mysql/plugin.frm'
removed `/home/mysql/I6000/mysql/time_zone_transition_type.MYD'
removed `/home/mysql/I6000/mysql/proxies_priv.MYD'
removed `/home/mysql/I6000/mysql/proxies_priv.frm'
removed `/home/mysql/I6000/mysql/columns_priv.frm'
removed `/home/mysql/I6000/mysql/help_keyword.MYI'
removed `/home/mysql/I6000/mysql/func.frm'
removed `/home/mysql/I6000/mysql/proc.frm'
removed `/home/mysql/I6000/mysql/innodb_table_stats.ibd'
removed `/home/mysql/I6000/mysql/help_topic.frm'
removed `/home/mysql/I6000/mysql/slow_log.CSM'
removed `/home/mysql/I6000/mysql/help_relation.MYD'
removed `/home/mysql/I6000/mysql/proc.MYD'
removed `/home/mysql/I6000/mysql/help_category.MYD'
removed `/home/mysql/I6000/mysql/help_category.frm'
removed `/home/mysql/I6000/mysql/columns_priv.MYI'
removed `/home/mysql/I6000/mysql/help_topic.MYI'
removed `/home/mysql/I6000/mysql/event.frm'
removed `/home/mysql/I6000/mysql/db.frm'
removed `/home/mysql/I6000/mysql/columns_priv.MYD'
removed `/home/mysql/I6000/mysql/time_zone_transition.MYD'
removed `/home/mysql/I6000/mysql/innodb_index_stats.frm'
removed `/home/mysql/I6000/mysql/time_zone.MYI'
removed `/home/mysql/I6000/mysql/event.MYD'
removed `/home/mysql/I6000/mysql/slave_master_info.ibd'
removed `/home/mysql/I6000/mysql/help_topic.MYD'
removed `/home/mysql/I6000/mysql/help_relation.MYI'
removed `/home/mysql/I6000/mysql/db.MYD'
removed `/home/mysql/I6000/mysql/slave_relay_log_info.ibd'
removed `/home/mysql/I6000/mysql/user.MYI'
removed `/home/mysql/I6000/mysql/plugin.MYI'
removed `/home/mysql/I6000/mysql/proc.MYI'
removed `/home/mysql/I6000/mysql/help_relation.frm'
removed `/home/mysql/I6000/mysql/time_zone_name.MYD'
removed `/home/mysql/I6000/mysql/innodb_table_stats.frm'
removed `/home/mysql/I6000/mysql/time_zone.frm'
removed `/home/mysql/I6000/mysql/servers.frm'
removed `/home/mysql/I6000/mysql/general_log.CSV'
removed `/home/mysql/I6000/mysql/ndb_binlog_index.MYI'
removed `/home/mysql/I6000/mysql/func.MYD'
removed `/home/mysql/I6000/mysql/slave_worker_info.ibd'
removed `/home/mysql/I6000/mysql/innodb_index_stats.ibd'
removed `/home/mysql/I6000/mysql/time_zone_name.frm'
removed `/home/mysql/I6000/mysql/proxies_priv.MYI'
removed `/home/mysql/I6000/mysql/slow_log.frm'
removed `/home/mysql/I6000/mysql/tables_priv.MYI'
removed `/home/mysql/I6000/mysql/tables_priv.MYD'
removed `/home/mysql/I6000/mysql/procs_priv.frm'
removed `/home/mysql/I6000/mysql/help_keyword.MYD'
removed `/home/mysql/I6000/mysql/time_zone_leap_second.MYD'
removed `/home/mysql/I6000/mysql/tables_priv.frm'
removed `/home/mysql/I6000/mysql/ndb_binlog_index.MYD'
removed `/home/mysql/I6000/mysql/slow_log.CSV'
removed `/home/mysql/I6000/mysql/time_zone.MYD'
removed `/home/mysql/I6000/mysql/procs_priv.MYD'
removed `/home/mysql/I6000/mysql/slave_master_info.frm'
removed `/home/mysql/I6000/mysql/general_log.frm'
removed `/home/mysql/I6000/mysql/help_keyword.frm'
removed `/home/mysql/I6000/mysql/time_zone_transition_type.frm'
removed `/home/mysql/I6000/mysql/general_log.CSM'
removed `/home/mysql/I6000/mysql/time_zone_transition.frm'
removed `/home/mysql/I6000/mysql/time_zone_name.MYI'
removed `/home/mysql/I6000/mysql/event.MYI'
removed `/home/mysql/I6000/mysql/time_zone_leap_second.frm'
removed `/home/mysql/I6000/mysql/plugin.MYD'
removed `/home/mysql/I6000/mysql/slave_relay_log_info.frm'
removed `/home/mysql/I6000/mysql/help_category.MYI'
removed `/home/mysql/I6000/mysql/user.frm'
removed `/home/mysql/I6000/mysql/user.MYD'
removed `/home/mysql/I6000/mysql/procs_priv.MYI'
removed `/home/mysql/I6000/mysql/db.MYI'
removed `/home/mysql/I6000/mysql/time_zone_leap_second.MYI'
removed `/home/mysql/I6000/mysql/slave_worker_info.frm'
removed `/home/mysql/I6000/mysql/func.MYI'
removed directory: `/home/mysql/I6000/mysql'
removed `/home/mysql/I6000/ibdata1'
WSREP_SST: [INFO] Cleaning the binlog directory /home/mysql/I6000 as well ( ::00.540)
rm: cannot remove `/home/mysql/I6000/*.index': No such file or directory
WSREP_SST: [INFO] Waiting for SST streaming to complete! (20160528 15:33:00.547)
2016-05-28 15:33:01 4359 [Note] WSREP: (666e7891, 'tcp://192.168.1.241:6030') turning message relay requesting off
2016-05-28 15:33:15 4359 [Note] WSREP: 0.0 (node6000_240): State transfer to 1.0 (node6000_241) complete.
2016-05-28 15:33:15 4359 [Note] WSREP: Member 0.0 (node6000_240) synced with group.
WSREP_SST: [INFO] Preparing the backup at /home/mysql/I6000//.sst (20160528 15:33:15.588)
WSREP_SST: [INFO] Evaluating innobackupex --no-version-check --apply-log $rebuildcmd ${DATA} &>${DATA}/innobackup.prepare.log (20160528 15:33:15.591)
rm: cannot remove `/home/mysql/I6000//innobackup.prepare.log': No such file or directory
rm: cannot remove `/home/mysql/I6000//innobackup.move.log': No such file or directory
WSREP_SST: [INFO] Moving the backup to /home/mysql/I6000/ (20160528 15:33:20.551)
WSREP_SST: [INFO] Evaluating innobackupex --defaults-file=/home/mysql/pxc6000.cnf --defaults-group=mysqld --no-version-check --move-back --force-non-empty-directories ${DATA} &>${DATA}/innobackup.move.log (20160528 15:33:20.554)
WSREP_SST: [INFO] Move successful, removing /home/mysql/I6000//.sst (20160528 15:33:20.848)
WSREP_SST: [INFO] Galera co-ords from recovery: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:12 (20160528 15:33:20.854)
WSREP_SST: [INFO] Total time on joiner: 0 seconds (20160528 15:33:20.857)
WSREP_SST: [INFO] Removing the sst_in_progress file (20160528 15:33:20.860)
2016-05-28 15:33:20 4359 [Note] WSREP: SST complete, seqno: 12
2016-05-28 15:33:20 4359 [Note] Plugin 'FEDERATED' is disabled.
2016-05-28 15:33:20 4359 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-05-28 15:33:20 4359 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-28 15:33:20 4359 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-28 15:33:20 4359 [Note] InnoDB: Memory barrier is not used
2016-05-28 15:33:20 4359 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-28 15:33:20 4359 [Note] InnoDB: Using Linux native AIO
2016-05-28 15:33:20 4359 [Note] InnoDB: Using CPU crc32 instructions
2016-05-28 15:33:20 4359 [Note] InnoDB: Initializing buffer pool, size = 100.0M
2016-05-28 15:33:20 4359 [Note] InnoDB: Completed initialization of buffer pool
2016-05-28 15:33:20 4359 [Note] InnoDB: Highest supported file format is Barracuda.
2016-05-28 15:33:20 4359 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-28 15:33:20 4359 [Note] InnoDB: Waiting for purge to start
2016-05-28 15:33:21 4359 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 1650198
2016-05-28 15:33:21 4359 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 73f9a99b-24a6-11e6-a163-000c2973aa48.
2016-05-28 15:33:21 4359 [Note] RSA private key file not found: /home/mysql/I6000//private_key.pem. Some authentication plugins will not work.
2016-05-28 15:33:21 4359 [Note] RSA public key file not found: /home/mysql/I6000//public_key.pem. Some authentication plugins will not work.
2016-05-28 15:33:21 4359 [Note] Server hostname (bind-address): '*'; port: 6000
2016-05-28 15:33:21 4359 [Note] IPv6 is available.
2016-05-28 15:33:21 4359 [Note] - '::' resolves to '::';
2016-05-28 15:33:21 4359 [Note] Server socket created on IP: '::'.
2016-05-28 15:33:21 4359 [Warning] 'user' entry 'root@zejin240' ignored in --skip-name-resolve mode.
2016-05-28 15:33:21 4359 [Warning] 'user' entry '@zejin240' ignored in --skip-name-resolve mode.
2016-05-28 15:33:21 4359 [Warning] 'proxies_priv' entry '@ root@zejin240' ignored in --skip-name-resolve mode.
2016-05-28 15:33:21 4359 [Note] Event Scheduler: Loaded 0 events
2016-05-28 15:33:21 4359 [Note] WSREP: Signalling provider to continue.
2016-05-28 15:33:21 4359 [Note] WSREP: Initialized wsrep sidno 2
2016-05-28 15:33:21 4359 [Note] WSREP: SST received: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:12
2016-05-28 15:33:21 4359 [Note] /usr/local/pxc_56/bin/mysqld: ready for connections.
Version: '5.6.26-74.0-25.12-log' socket: '/home/mysql/I6000/mysql.sock' port: 6000 Percona XtraDB Cluster binary (GPL) 5.6.26-25.12, Revision 624ef81, wsrep_25.12
2016-05-28 15:33:21 4359 [Note] WSREP: 1.0 (node6000_241): State transfer from 0.0 (node6000_240) complete.
2016-05-28 15:33:21 4359 [Note] WSREP: Shifting JOINER -> JOINED (TO: 12)
2016-05-28 15:33:21 4359 [Note] WSREP: Member 1.0 (node6000_241) synced with group.
2016-05-28 15:33:21 4359 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 12)
2016-05-28 15:33:21 4359 [Note] WSREP: Synchronized with group, ready for connections
2016-05-28 15:33:21 4359 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
可以看到里面有大量的removed操作,它会删除数据文件夹里面的所有文件,再从主节点那里通过SST获取数据
官方说明:
XtraBackup SST works in two stages:
• Stage I on joiner checks if it is SST or IST based on presence of xtrabackup_ist file.
• In Stage II it starts the data transfer, if it’s SST, it empties the data directory sans few files (galera.cache, sst_in_progress, grastate.dat) and then proceed with the SST or if it’s IST, proceeds as before.

至此我们完成了pxc环境下避免新节点加入时需要进行SST的方法,在数据量大时SST将会占用大量的资源,配置的gcache.size足够容纳从备份到恢复此时间段内主节点产生的数据量,建议通过业务低峰期时通过脚本来实现此新节点加入操作。

MySQL PXC构建一个新节点只需IST传输的方法的更多相关文章

  1. 为 Drupal 7 构建一个新主题

    主题解释了 Drupal 网站的用户界面 (UI).虽然主题结构并没有明显的变化,但 Drupal 版本 7 配备了一个新的主题实现方法.本文演示了如何创建一个新的 Drupal 7 主题. Drup ...

  2. JS数组 团里添加新成员(向数组增加一个新元素)只需使用下一个未用的索引,任何时刻可以不断向数组增加新元素。myarray[5]=88;

    团里添加新成员(向数组增加一个新元素) 上一节中,我们使用myarray变量存储了5个人的成绩,现在多出一个人的成绩,如何存储呢?  只需使用下一个未用的索引,任何时刻可以不断向数组增加新元素. my ...

  3. jenkins构建一个maven项目[五]

    标签(linux): jenkins 笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 构建一个maven项目,即为构建java项目.模拟实验之前先把实验代码推送到 ...

  4. mysql,Jdbc工具类,只需一条sql实现简单查询

    import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import ...

  5. 思路:当一个表嵌套另一个表时候 只需在dao中引入该mapper即可 进行正常的数据插入 查询 修改等

  6. 用virtualenv构建一个新的python环境,这个新的环境在这个创建的文件夹下

    http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/00143271210830032 ...

  7. C#连接mysql数据库的一个例子和获取本机IP的方法

    本例子是一个最初级直接连接mysql数据库的例子,实现了往数据库插入数据的操作: string MyConnectionMysql="Server=localhost;Datbase=xxx ...

  8. Hibernate的多表查询,分装到一个新的实体类中的一个方法

    不知道是否还有其他方法实现,请高人指点. 如果涉及到多张表多字段查询,并且想利用查询出来的字段在界面层构建一个新的实体类,可以使用这种方法: 如果查询出来的多字段中,有多个字段的名字都相同(如想查询出 ...

  9. Spring Boot+Jpa(MYSQL)做一个登陆注册系统(前后端数据库一站式编程)

    Spring Boot最好的学习方法就是实战训练,今天我们用很短的时间启动我们第一个Spring Boot应用,并且连接我们的MySQL数据库. 我将假设读者为几乎零基础,在实战讲解中会渗透Sprin ...

随机推荐

  1. .NET 4.5.1 预览版新特性

    上个月的微软Build大会上宣布了.NET 4.5.1的推出,Heydarian的这个演讲题为".NET开发中的新内容",涵盖了.NET Framework中一些重要的新特性. H ...

  2. Hadoop学习笔记—18.Sqoop框架学习

    一.Sqoop基础:连接关系型数据库与Hadoop的桥梁 1.1 Sqoop的基本概念 Hadoop正成为企业用于大数据分析的最热门选择,但想将你的数据移植过去并不容易.Apache Sqoop正在加 ...

  3. Why MVC is Better?(翻译)

    (本文翻译自CodeProject上的一篇关于ASP.NET MVC的文章,原文地址:http://www.codeproject.com/Articles/821275/Webforms-vs-MV ...

  4. MySQL mysqldump数据导出详解

    介绍 在日常维护工作当中经常会需要对数据进行导出操作,而mysqldump是导出数据过程中使用非常频繁的一个工具:它自带的功能参数非常多,文章中会列举出一些常用的操作,在文章末尾会将所有的参数详细说明 ...

  5. Azure PowerShell (4) 使用PowerShell管理多个订阅

    <Windows Azure Platform 系列文章目录> 笔者手上有两个Azure账户. - Azure Global (windowsazure.com)账户.有两个订阅. - 世 ...

  6. 【Paddy】如何将物理表分割成动态数据表与静态数据表

    前言 一般来说,物理表的增.删.改.查都受到数据量的制约,进而影响了性能. 很多情况下,你所负责的业务关键表中,每日变动的数据库与不变动的数据量比较,相差非常大. 这里我们将变动的数据称为动态数据,不 ...

  7. innerHTML,outerHTML,innerText,outerText区别以及insertAdjacentHTML()方法

    在需要给文档插入大量的新的HTML标记的情况下,通过多次DOM操作先创建节点再指定它们之间的关系会非常麻烦而且效率不高,相对而言插入标记的方法会更加简单,速度也更快. 插入标记中有这四个属性inner ...

  8. C#事件

    事件(event),这个词儿对于初学者来说,往往总是显得有些神秘,不易弄懂.而这些东西却往往又是编程中常用且非常重要的东西.大家都知道windows消息处理机制的重要,其实C#事件就是基于window ...

  9. 外接程序“VMDebugger”未能加载或者导致了异常。是否希望移除该外接程序?

    收工~

  10. 【源码】谷歌代理~WPF简单小软件-2015-10-15首发 (2016-03-01已更新源)

    蛋疼,昨天把代理去了后才发现,原来咱们连谷歌应用都访问不了,,,用别人的总觉得不怎么安全,然后今天早上就编了个小软件干掉他这限制==>  GoogleProxy.exe [主要目的:为了能在线安 ...