> 데이터 베이스 > MySQL 튜토리얼 > IST 전송만 필요한 새로운 노드를 구축하는 MySQL PXC의 방법에 대한 자세한 설명

IST 전송만 필요한 새로운 노드를 구축하는 MySQL PXC의 방법에 대한 자세한 설명

黄舟
풀어 주다: 2017-04-18 11:29:27
원래의
1591명이 탐색했습니다.

아래 편집자는 MySQL IST 전송만 필요한 새 노드를 구축하는 PXC 방법(권장)에 대한 기사를 가져올 것입니다. 편집자님이 꽤 좋다고 생각하셔서 지금 공유하고 모두에게 참고용으로 드리고자 합니다. 에디터를 따라가서 살펴보겠습니다.

수요 시나리오: 원래 pxc 환경에는 상대적으로 많은 양의 데이터가 있습니다. 대신에 새로 구입한 서버를 이 클러스터에 추가해야 합니다. .

PXC에는 두 가지 데이터 전송 방법이 있습니다.

IST: 증분 상태 전송 증분 동기화
SST: 상태 스냅샷 전체 전송량 동기화

IST 발생 조건: 노드에서 캐싱 메커니즘을 사용하여 수행됩니다(즉, 이전 클러스터에서 발생한 노드 데이터만 여전히 캐시에 남아 있음)

판단 방법:

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.
로그인 후 복사

이 작업의 단계는 다음과 같습니다.

node240: 192.168.1.240 --기존 클러스터 노드
node241: 192.168.1.241 --추가할 클러스터 노드

step1 : 새 클러스터 A 노드에서 첫 번째 단계를 시작합니다

/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      = 6000socket     = /home/mysql/I6000/mysql.sockdefault-character-set=utf8
[mysqld]basedir = /usr/local/pxc_56datadir = /home/mysql/I6000pid-file    = /home/mysql/I6000/mysql.
pidcharacter-set-server=utf8init_connect = 'SET NAMES utf8'log-bin=/home/mysql/I6000/log_binserver-id = 9816000innodb_buffer_pool_size = 
100Minnodb_data_file_path = ibdata1:10M:autoextendinnodb_data_home_dir = /home/mysql/I6000innodb_file_per_table=1skip-name-resolveport      = 
6000socket     = /home/mysql/I6000/mysql.sockuser=mysqllog_error=/home/mysql/I6000/mysql_error.log
#pxcuser=mysqllog_error=error.logbinlog_format=ROW#6000 for mysqld port, 6020 for sst port, 6031 for ist port, 6030 for cluster communication 
portwsrep_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.sowsrep_sst_receive_address=192.168.1.240:6020wsrep_node_incoming_address=192.168.1.240:6000
wsrep_node_address=192.168.1.240:6000wsrep_provider_options = "gmcast.listen_addr=tcp://192.168.1.240:6030;ist.recv_addr=192.168.1.240:6031;
"wsrep_slave_threads=2wsrep_cluster_name=pxc_zejinwsrep_sst_method=xtrabackup-v2wsrep_node_name=node6000_240innodb_autoinc_lock_mode=2wsrep_sst_auth="sstuser:123"
log-slave-updates[mysql]no-auto-rehashdefault-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('123');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)
로그인 후 복사

2단계: innobackupex를 사용하여 백업 up node240 데이터:

[root@zejin240 mysql]# innobackupex --user=root --password=123 --port=6000 --host=127.0.0.1 
--defaults-file=/home/mysql/pxc6000.cnf /home/mysql/InnoDB Backup Utility v1.5.1-xtrabackup; 
Copyright 2003, 2009 Innobase Oyand Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.This software is published 
underthe GNU GENERAL PUBLIC LICENSE Version 2, June 1991.Get the latest version of Percona XtraBackup, documentation, and help 
resources:percona.com/xb/p160528 09:39:07 innobackupex: Executing a version check against the server...160528 09:39:07 
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).160528 09:39:07 innobackupex: Connected to MySQL server160528 09:39:07 
innobackupex: Done.160528 09:39:07 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).160528 09:39:07 
innobackupex: Connected to MySQL server160528 09:39:07 innobackupex: Starting the backup operationIMPORTANT: 
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.26-74.0-25.12-loginnobackupex: 
Created backup directory /home/mysql/2016-05-28_09-39-07160528 09:39:07 innobackupex: Starting ibbackup with command: 
xtrabackup --defaults-file="/home/mysql/pxc6000.cnf" --defaults-group="mysqld" --backup 
--suspend-at-end --target-dir=/home/mysql/2016-05-28_09-39-07 --innodb_log_file_size="50331648"
 --tmpdir=/tmp --extra-lsndir='/tmp'innobackupex: Waiting for ibbackup (pid=30280) to suspendinnobackupex: 
 Suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_suspended_2'xtrabackup 
 version 2.2.11 based on MySQL server 5.6.24 Linux (x86_64) (revision id: )xtrabackup: uses 
 posix_fadvise().xtrabackup: cd to /home/mysql/I6000xtrabackup: open files limit requested 0, set to 1024xtrabackup: 
 using the following InnoDB configuration:xtrabackup:  innodb_data_home_dir = /home/mysql/I6000xtrabackup:  
 innodb_data_file_path = ibdata1:10M:autoextendxtrabackup:  innodb_log_group_home_dir = ./xtrabackup:  
 innodb_log_files_in_group = 2xtrabackup:  innodb_log_file_size = 50331648>> log scanned up to (1637591)xtrabackup: 
 Generating a list of tablespaces[01] Copying /home/mysql/I6000/ibdata1 to /home/mysql/2016-05-28_09-39-07/ibdata1>> 
 log scanned up to (1637591)[01]    ...done[01] Copying ./zejin/t1.ibd to /home/mysql/2016-05-28_09-39-07/zejin/t1.ibd[01]   
  ...done[01] Copying ./mysql/innodb_table_stats.ibd to /home/mysql/2016-05-28_09-39-07/mysql/innodb_table_stats.ibd[01]   
   ...done[01] Copying ./mysql/slave_master_info.ibd to /home/mysql/2016-05-28_09-39-07/mysql/slave_master_info.ibd[01]   
   ...done[01] Copying ./mysql/slave_relay_log_info.ibd to /home/mysql/2016-05-28_09-39-07/mysql/slave_relay_log_info.ibd[01]    
   ...done[01] Copying ./mysql/slave_worker_info.ibd to /home/mysql/2016-05-28_09-39-07/mysql/slave_worker_info.ibd[01]   
    ...done[01] Copying ./mysql/innodb_index_stats.ibd to /home/mysql/2016-05-28_09-39-07/mysql/innodb_index_stats.ibd[01]    
    ...done>> log scanned up to (1637591)xtrabackup: Creating suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_suspended_2' 
    with pid '30280'160528 09:39:10 innobackupex: Continuing after ibbackup has suspended160528 09:39:10 
    innobackupex: Executing LOCK TABLES FOR BACKUP...160528 09:39:10 innobackupex: Backup tables lock acquired160528 09:39:10 
    innobackupex: Starting to backup non-InnoDB tables and filesinnobackupex: 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}' (53 files)>> log scanned up to (1637598)
    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}' (74 files)160528 09:39:11
     innobackupex: Finished backing up non-InnoDB tables and files160528 09:39:11 innobackupex: Executing LOCK BINLOG FOR BACKUP...160528
      09:39:11 innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...160528 09:39:11 innobackupex: Waiting for log copying to 
      finishxtrabackup: The latest check point (for incremental): '1637598'xtrabackup: Stopping log copying thread..>> log scanned up
       to (1637598)xtrabackup: Creating suspend file '/home/mysql/2016-05-28_09-39-07/xtrabackup_log_copied' with pid '30280'xtrabackup:
        Transaction log of lsn (1637591) to (1637598) was copied.160528 09:39:12 innobackupex: Executing UNLOCK BINLOG160528 
        09:39:12 innobackupex: Executing UNLOCK TABLES160528 09:39:12 innobackupex: All tables unlockedinnobackupex: Backup 
        created in directory '/home/mysql/2016-05-28_09-39-07'innobackupex: MySQL binlog position: filename 'log_bin.000003', 
        position 2772160528 09:39:12 innobackupex: Connection to database server closed160528 09:39:12 innobackupex: completed OK!
[root@zejin240 2016-05-28_09-39-07]
# lltotal 75812-rw-r--r--. 1 root root   
358 May 28 09:39 backup-my.cnf-rw-r-----. 
1 root root 77594624 May 28 09:39 ibdata1drwx------. 
2 root root   4096 May 28 09:39 mysqldrwxr-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-----. 
1 root root    89 May 28 09:39 xtrabackup_checkpoints-rw-r--r--. 
1 root root   635 May 28 09:39 xtrabackup_info-rw-r-----. 
1 root root   2560 May 28 09:39 xtrabackup_logfiledrwx------. 
2 root root   4096 May 28 09:39 zejin
로그인 후 복사

3단계: 이 시점에서 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)
로그인 후 복사

4단계: 백업된 데이터를 node241로 전송하고 복원:

[root@zejin241 mysql]
# innobackupex --apply-log 2016-05-28_09-39-07/InnoDB Backup Utility v1.5.1-xtrabackup; 
Copyright 2003, 2009 Innobase Oyand Percona LLC and/or its affiliates 2009-2013. 
All Rights Reserved.This software is published underthe GNU GENERAL PUBLIC LICENSE Version 
2, June 1991.Get the latest version of Percona XtraBackup, documentation, and help resources:percona.com 09:54:01 
innobackupex: Starting the apply-log operationIMPORTANT: 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-07xtrabackup 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-07xtrabackup: 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:autoextendxtrabackup:  innodb_log_group_home_dir = ./xtrabackup:  
innodb_log_files_in_group = 1xtrabackup:  innodb_log_file_size = 2097152xtrabackup: 
using the following InnoDB configuration for recovery:xtrabackup:  innodb_data_home_dir = ./xtrabackup:  
innodb_data_file_path = ibdata1:10M:autoextendxtrabackup:  innodb_log_group_home_dir = ./xtrabackup:  
innodb_log_files_in_group = 1xtrabackup:  
innodb_log_file_size = 2097152xtrabackup: 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 
pagesInnoDB: The InnoDB memory heap is disabledInnoDB: Mutexes and rw_locks use GCC atomic builtinsInnoDB: Memory barrier is not 
usedInnoDB: Compressed tables use zlib 1.2.3InnoDB: Using CPU crc32 instructionsInnoDB: Initializing buffer pool, 
size = 100.0MInnoDB: Completed initialization of buffer poolInnoDB: Highest supported file format is 
Barracuda.InnoDB: Log scan progressed past the checkpoint lsn 1637591InnoDB: 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.000003InnoDB: 128 rollback segment(s) are active.InnoDB: Waiting for purge to startInnoDB: 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.000003xtrabackup: 
Recovered WSREP position: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8xtrabackup: starting shutdown
 with innodb_fast_shutdown = 1InnoDB: FTS optimize thread exiting.InnoDB: Starting shutdown...InnoDB: Shutdown completed; 
 log sequence number 1637608160528 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-07for 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-07xtrabackup: 
 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:autoextendxtrabackup:  
 innodb_log_group_home_dir = ./xtrabackup:  innodb_log_files_in_group = 2xtrabackup:  
 innodb_log_file_size = 50331648xtrabackup: using the following InnoDB configuration for recovery:xtrabackup: 
  innodb_data_home_dir = ./xtrabackup:  innodb_data_file_path = ibdata1:10M:autoextendxtrabackup:  
  innodb_log_group_home_dir = ./xtrabackup:  innodb_log_files_in_group = 2xtrabackup:  
  innodb_log_file_size = 50331648xtrabackup: 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 pagesInnoDB: 
   The InnoDB memory heap is disabledInnoDB: Mutexes and rw_locks use GCC atomic builtinsInnoDB: Memory barrier is not usedInnoDB: 
   Compressed tables use zlib 1.2.3InnoDB: Using CPU crc32 instructionsInnoDB: Initializing buffer pool, size = 100.0MInnoDB: 
   Completed initialization of buffer poolInnoDB: Setting log file ./ib_logfile101 size to 48 MBInnoDB: Setting log file ./ib_logfile1 
   size to 48 MBInnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0InnoDB: New log files created, 
   LSN=1637608InnoDB: Highest supported file format is Barracuda.InnoDB: 128 rollback segment(s) are active.InnoDB: 
   Waiting for purge to startInnoDB: 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.000003xtrabackup: 
   starting shutdown with innodb_fast_shutdown = 1InnoDB: FTS optimize thread exiting.InnoDB: Starting shutdown...InnoDB: 
   Shutdown completed; log sequence number 1637910160528 09:54:06 innobackupex: completed OK!
[root@zejin240 2016-05-28_09-39-07]# lltotal 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_logfile1drwx------. 
2 root root   4096 May 28 09:39 mysqldrwxr-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_logfiledrwx------. 
2 root root   4096 May 28 09:39 zejin
로그인 후 복사

5단계: 알아보세요. Xid 위치

두 가지 방법이 있습니다

방법 1: xtrabackup_galera_info 파일 보기

[root @zejin241 I6000]# cat xtrabackup_galera_info6c86dc17-246f-11e6-9955-ae4d7e89eed2:8

방법 2: 찾기 by binlog 위치:

[root@zejin241 I6000]# cat xtrabackup_binlog_infolog_bin.000003 2772
즉, 백업 시 백업 지점 위치는 log_bin.000003 2772

이 binlog에 해당하는 xid를 찾기 위해 메인 데이터베이스로 이동합니다

[root@zejin240 I6000]# mysqlbinlog -vv log_bin.000003 | grep Xid#160528 9:02:59 server id 9816000 end_log_pos 947 CRC32 0x37371b3e Xid = 7#160528 10:03:04 서버 ID 981 6000 end_log_pos 2969 CRC32 0xf7973829 Xid = 9#160528 10:03:13 서버 ID 9816000 end_log_pos 3168 CRC32 41 시드 = 10

그랬어요 이 위치에 xid가 없다는 것을 발견했습니다. 그 이유는 상단 mysql.user 테이블에서 를 업데이트했고 이 테이블은 myisam 테이블이므로 Xid 레코드가 설정되지 않기 때문입니다. 위쪽 및 아래쪽 위치에 따라 8개로

6단계: node241에서 grastate.dat 파일을 위조합니다(node240에서 복사하고 seqno 변경):

# GALERA 저장된 상태 버전: 2.1uuid: 6c86dc17-246f-11e6-9955-ae4d7e89eed2seqno: 8cert_index:


7단계: 새 노드 시작:


启动node241:[root@zejin241 mysql]# /usr/local/pxc_56/bin/mysqld_safe --defaults-file=/home/mysql/pxc6000.cnf --ledir=/usr/local/pxc_56/bin/ & 
[1] 56425[root@zejin241 mysql]# 160528 11:06:03 mysqld_safe Logging to '/home/mysql/I6000/error.log'.160528 11:06:03 
mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000160528 11:06:03 mysqld_safe Skipping wsrep-recover
 for 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8 pair160528 11:06:03 mysqld_safe Assigning 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8 to
 wsrep_start_position查看下启动过程的日志:[root@zejin241 I6000]# cat error.log 160528 11:06:03 mysqld_safe Starting mysqld daemon
  with databases from /home/mysql/I6000160528 11:06:03 mysqld_safe Skipping wsrep-recover for 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8
   pair160528 11:06:03 mysqld_safe Assigning 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8 to wsrep_start_position2016-05-28 11:06:19 0 
   [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option 
   (see documentation for more details).2016-05-28 11:06:19 0 [Note] /usr/local/pxc_56/bin//mysqld (mysqld 5.6.26-74.0-25.12-log) 
   starting as process 56931 ...2016-05-28 11:06:19 56931 [Note] WSREP: Read nil XID from storage engines, skipping position 
   init2016-05-28 11:06:19 56931 [Note] WSREP: wsrep_load(): loading provider library '/usr/local/pxc_56/lib/libgalera_smm.so'2016-05-28 
   11:06:20 56931 [Note] WSREP: wsrep_load(): Galera 3.12.2(rf3e626d) by Codership Oy <info@codership.com> loaded successfully.2016-05-28 
   11:06:20 56931 [Note] WSREP: CRC-32C: using hardware acceleration.2016-05-28 11:06:20 56931 [Note] WSREP: Found saved state:
    6c86dc17-246f-11e6-9955-ae4d7e89eed2:82016-05-28 11:06:20 56931 [Note] WSREP: Passing config to GCS: base_dir = /home/mysql/I6000/; 
    base_host = 192.168.1.241; base_port = 6000; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; 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 = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S;
       evs.user_send_window = 2; evs.view_forget_timeout = PT24H; gcache.dir = /home/mysql/I6000/; gcache.keep_pages_count = 0; 
       gcache.keep_pages_size = 0; gcache.mem_size = 0; 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_a2016-05-28 11:06:21 56931 [Note] WSREP: Service thread queue flushed.2016-05-28 11:06:21 56931 [Note] WSREP:
        Assign initial position for certification: 8, protocol version: -12016-05-28 11:06:21 56931 [Note] WSREP: 
        wsrep_sst_grab()2016-05-28 11:06:21 56931 [Note] WSREP: Start replication2016-05-28 11:06:21 56931 [Note] WSREP: 
        Setting initial position to 6c86dc17-246f-11e6-9955-ae4d7e89eed2:82016-05-28 11:06:21 56931 [Note] WSREP: protonet 
        asio version 02016-05-28 11:06:21 56931 [Note] WSREP: Using CRC-32C for message checksums.2016-05-28 11:06:21 56931
         [Note] WSREP: backend: asio2016-05-28 11:06:21 56931 [Warning] WSREP: access file(/home/mysql/I6000//gvwstate.dat)
          failed(No such file or directory)2016-05-28 11:06:21 56931 [Note] WSREP: restore pc from disk failed2016-05-28
           11:06:21 56931 [Note] WSREP: GMCast version 02016-05-28 11:06:21 56931 [Note] WSREP: (275a2ebd, &#39;tcp://192.168.1.241:6030&#39;) 
           listening at tcp://192.168.1.241:60302016-05-28 11:06:21 56931 [Note] WSREP: (275a2ebd, &#39;tcp://192.168.1.241:6030&#39;) multicast: ,
            ttl: 12016-05-28 11:06:21 56931 [Note] WSREP: EVS version 02016-05-28 11:06:21 56931 [Note] WSREP: 
            gcomm: connecting to group &#39;pxc_zejin&#39;, peer &#39;192.168.1.240:6030,192.168.1.241:6030,192.168.1.242:6030&#39;2016-05-28 
            11:06:21 56931 [Note] WSREP: (275a2ebd, &#39;tcp://192.168.1.241:6030&#39;) turning message relay requesting on, 
            nonlive peers: 2016-05-28 11:06:21 56931 [Note] WSREP: declaring 6c48c86c at tcp://192.168.1.240:6030
             stable2016-05-28 11:06:21 56931 [Note] WSREP: Node 6c48c86c state prim2016-05-28 11:06:21 56931 [Note] 
             WSREP: view(view_id(PRIM,275a2ebd,2) memb {  275a2ebd,0  6c48c86c,0} joined {} left {} partitioned {})2016-05-28
              11:06:21 56931 [Note] WSREP: save pc into disk2016-05-28 11:06:21 56931 [Note] WSREP: discarding pending addr 
              without UUID: tcp://192.168.1.242:60302016-05-28 11:06:22 56931 [Note] WSREP: gcomm: connected2016-05-28 11:06:22
               56931 [Note] WSREP: Changing maximum packet size to 64500, resulting msg size: 326362016-05-28 11:06:22 56931
                [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)2016-05-28 11:06:22 56931 [Note] WSREP: Opened channel 
                &#39;pxc_zejin&#39;2016-05-28 11:06:22 56931 [Note] WSREP: Waiting for SST to complete.2016-05-28 11:06:22 56931 
                [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 22016-05-28 
                11:06:22 56931 [Note] WSREP: STATE_EXCHANGE: sent state UUID: 2800468f-2481-11e6-8c7c-de1ade51709a2016-05-28 
                11:06:22 56931 [Note] WSREP: STATE EXCHANGE: sent state msg: 2800468f-2481-11e6-8c7c-de1ade51709a2016-05-28 11:06:22
                 56931 [Note] WSREP: STATE EXCHANGE: got state msg: 2800468f-2481-11e6-8c7c-de1ade51709a from 0 (node6000_241)2016-05-28 11:06:22 56931 [Note] WSREP: STATE EXCHANGE: got state msg: 2800468f-2481-11e6-8c7c-de1ade51709a from 1 (node6000_240)2016-05-28 11:06:22 56931 [Note] WSREP: Quorum results:  version  = 3,  component = PRIMARY,  conf_id  = 1,  members  = 1/2 (joined/total),  act_id   = 10,  last_appl. = -1,  protocols = 0/7/3 (gcs/repl/appl),  group UUID = 6c86dc17-246f-11e6-9955-ae4d7e89eed22016-05-28 11:06:22 56931 [Note] WSREP: Flow-control interval: [23, 23]2016-05-28 11:06:22 56931 [Note] WSREP: Shifting OPEN -> PRIMARY (TO: 10)2016-05-28 11:06:22 56931 [Note] WSREP: State transfer required:   Group state: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:10  Local state: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:82016-05-28 11:06:22 56931 [Note] WSREP: New cluster view: global state: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:10, view# 2: Primary, number of nodes: 2, my index: 0, protocol version 32016-05-28 11:06:22 56931 [Warning] WSREP: Gap in state sequence. Need state transfer.2016-05-28 11:06:22 56931 [Note] WSREP: Running: &#39;wsrep_sst_xtrabackup-v2 --role &#39;joiner&#39; --address &#39;192.168.1.241:6020&#39; --datadir &#39;/home/mysql/I6000/&#39; --defaults-file &#39;/home/mysql/pxc6000.cnf&#39; --defaults-group-suffix &#39;&#39; --parent &#39;56931&#39; &#39;&#39; &#39;2016-05-28 11:06:24 56931 [Note] WSREP: (275a2ebd, &#39;tcp://192.168.1.241:6030&#39;) turning message relay requesting offWSREP_SST: [INFO] Streaming with xbstream (20160528 11:06:25.322)WSREP_SST: [INFO] Using socat as streamer (20160528 11:06:25.324)WSREP_SST: [INFO] Evaluating timeout -s9 100 socat -u TCP-LISTEN:6020,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) (20160528 11:06:25.891)2016-05-28 11:06:27 56931 [Note] WSREP: Prepared SST request: xtrabackup-v2|192.168.1.241:6020/xtrabackup_sst//12016-05-28 11:06:27 56931 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.2016-05-28 11:06:27 56931 [Note] WSREP: REPL Protocols: 7 (3, 2)2016-05-28 11:06:27 56931 [Note] WSREP: Service thread queue flushed.2016-05-28 11:06:27 56931 [Note] WSREP: Assign initial position for certification: 10, protocol version: 32016-05-28 11:06:27 56931 [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:60312016-05-28 11:06:27 56931 [Note] WSREP: Member 0.0 (node6000_241) requested state transfer from &#39;*any*&#39;. Selected 1.0 (node6000_240)(SYNCED) as donor.2016-05-28 11:06:27 56931 [Note] WSREP: Shifting PRIMARY -> JOINER (TO: 10)2016-05-28 11:06:27 56931 [Note] WSREP: Requesting state transfer: success, donor: 12016-05-28 11:06:31 56931 [Note] WSREP: 1.0 (node6000_240): State transfer to 0.0 (node6000_241) complete.2016-05-28 11:06:31 56931 [Note] WSREP: Member 1.0 (node6000_240) synced with group.WSREP_SST: [INFO] xtrabackup_ist received from donor: Running IST (20160528 11:06:31.257)WSREP_SST: [INFO] Galera co-ords from recovery: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:8 (20160528 11:06:31.261)WSREP_SST: [INFO] Total time on joiner: 0 seconds (20160528 11:06:31.265)WSREP_SST: [INFO] Removing the sst_in_progress file (20160528 11:06:31.268)2016-05-28 11:06:31 56931 [Note] WSREP: SST complete, seqno: 82016-05-28 11:06:31 56931 [Note] Plugin &#39;FEDERATED&#39; is disabled.2016-05-28 11:06:31 56931 [Note] InnoDB: Using atomics to ref count buffer pool pages2016-05-28 11:06:31 56931 [Note] InnoDB: The InnoDB memory heap is disabled2016-05-28 11:06:31 56931 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2016-05-28 11:06:31 56931 [Note] InnoDB: Memory barrier is not used2016-05-28 11:06:31 56931 [Note] InnoDB: Compressed tables use zlib 1.2.32016-05-28 11:06:31 56931 [Note] InnoDB: Using Linux native AIO2016-05-28 11:06:31 56931 [Note] InnoDB: Using CPU crc32 instructions2016-05-28 11:06:31 56931 [Note] InnoDB: Initializing buffer pool, size = 100.0M2016-05-28 11:06:31 56931 [Note] InnoDB: Completed initialization of buffer pool2016-05-28 11:06:32 56931 [Note] InnoDB: Highest supported file format is Barracuda.2016-05-28 11:06:32 56931 [Note] InnoDB: 128 rollback segment(s) are active.2016-05-28 11:06:32 56931 [Note] InnoDB: Waiting for purge to start2016-05-28 11:06:33 56931 [Note] InnoDB: Percona XtraDB (percona.com) 5.6.26-74.0 started; log sequence number 16379102016-05-28 11:06:33 56931 [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-2481-11e6-8fe4-000c2973aa48.2016-05-28 11:06:33 56931 [Note] RSA private key file not found: /home/mysql/I6000//private_key.pem. Some authentication plugins will not work.2016-05-28 11:06:33 56931 [Note] RSA public key file not found: /home/mysql/I6000//public_key.pem. Some authentication plugins will not work.2016-05-28 11:06:33 56931 [Note] Server hostname (bind-address): &#39;*&#39;; port: 60002016-05-28 11:06:33 56931 [Note] IPv6 is available.2016-05-28 11:06:33 56931 [Note]  - &#39;::&#39; resolves to &#39;::&#39;;2016-05-28 11:06:33 56931 [Note] Server socket created on IP: &#39;::&#39;.2016-05-28 11:06:33 56931 [Warning] &#39;user&#39; entry &#39;root@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 11:06:33 56931 [Warning] &#39;user&#39; entry &#39;@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 11:06:33 56931 [Warning] &#39;proxies_priv&#39; entry &#39;@ root@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 11:06:33 56931 [Note] Event Scheduler: Loaded 0 events2016-05-28 11:06:33 56931 [Note] WSREP: Signalling provider to continue.2016-05-28 11:06:33 56931 [Note] WSREP: Initialized wsrep sidno 22016-05-28 11:06:33 56931 [Note] WSREP: SST received: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:82016-05-28 11:06:33 56931 [Note] WSREP: Receiving IST: 2 writesets, seqnos 8-102016-05-28 11:06:33 56931 [Note] /usr/local/pxc_56/bin//mysqld: ready for connections.Version: &#39;5.6.26-74.0-25.12-log&#39; socket: &#39;/home/mysql/I6000/mysql.sock&#39; port: 6000 Percona XtraDB Cluster binary (GPL) 5.6.26-25.12, Revision 624ef81, wsrep_25.122016-05-28 11:06:33 56931 [Note] WSREP: IST received: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:102016-05-28 11:06:33 56931 [Note] WSREP: 0.0 (node6000_241): State transfer from 1.0 (node6000_240) complete.2016-05-28 11:06:33 56931 [Note] WSREP: Shifting JOINER -> JOINED (TO: 10)2016-05-28 11:06:33 56931 [Note] WSREP: Member 0.0 (node6000_241) synced with group.2016-05-28 11:06:33 56931 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 10)2016-05-28 11:06:33 56931 [Note] WSREP: Synchronized with group, ready for connections2016-05-28 11:06:33 56931 [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 -P6000Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.6.26-74.0-25.12-log Percona XtraDB Cluster binary (GPL) 5.6.26-25.12, Revision 624ef81, wsrep_25.12Copyright (c) 2009-2015 Percona LLC and/or its affiliatesCopyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; 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 namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> select * from t1;+----+-------+| id | name |+----+-------+| 1 | chen || 2 | li  || 3 | zhang || 4 | lin  || 5 | liang |+----+-------+5 rows in set (0.01 sec)
로그인 후 복사

데이터를 찾아보세요. 모두 동기화되었습니다.


9단계: 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 &[1] 3861[root@zejin241 I6000]# 160528 15:32:57 mysqld_safe Logging to &#39;/home/mysql/I6000/error.log&#39;.160528 15:32:57 mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000160528 15:32:57 mysqld_safe Skipping wsrep-recover for empty datadir: /home/mysql/I6000160528 15:32:57 mysqld_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position查看错误日志:[root@zejin241 I6000]# cat error.log 160528 15:32:57 mysqld_safe Starting mysqld daemon with databases from /home/mysql/I6000160528 15:32:57 mysqld_safe Skipping wsrep-recover for empty datadir: /home/mysql/I6000160528 15:32:57 mysqld_safe Assigning 00000000-0000-0000-0000-000000000000:-1 to wsrep_start_position2016-05-28 15:32:58 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2016-05-28 15:32:58 0 [Note] /usr/local/pxc_56/bin/mysqld (mysqld 5.6.26-74.0-25.12-log) starting as process 4359 ...2016-05-28 15:32:58 4359 [Note] WSREP: Read nil XID from storage engines, skipping position init2016-05-28 15:32:58 4359 [Note] WSREP: wsrep_load(): loading provider library &#39;/usr/local/pxc_56/lib/libgalera_smm.so&#39;2016-05-28 15:32:58 4359 [Note] WSREP: wsrep_load(): Galera 3.12.2(rf3e626d) by Codership Oy <info@codership.com> loaded successfully.2016-05-28 15:32:58 4359 [Note] WSREP: CRC-32C: using hardware acceleration.2016-05-28 15:32:58 4359 [Warning] WSREP: Could not open state file for reading: &#39;/home/mysql/I6000//grastate.dat&#39;2016-05-28 15:32:58 4359 [Note] WSREP: Found saved state: 00000000-0000-0000-0000-000000000000:-12016-05-28 15:32:58 4359 [Note] WSREP: Passing config to GCS: base_dir = /home/mysql/I6000/; base_host = 192.168.1.241; base_port = 6000; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; 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 = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 2; evs.view_forget_timeout = PT24H; gcache.dir = /home/mysql/I6000/; gcache.keep_pages_count = 0; gcache.keep_pages_size = 0; gcache.mem_size = 0; 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_a2016-05-28 15:32:58 4359 [Note] WSREP: Service thread queue flushed.2016-05-28 15:32:58 4359 [Note] WSREP: Assign initial position for certification: -1, protocol version: -12016-05-28 15:32:58 4359 [Note] WSREP: wsrep_sst_grab()2016-05-28 15:32:58 4359 [Note] WSREP: Start replication2016-05-28 15:32:58 4359 [Note] WSREP: Setting initial position to 00000000-0000-0000-0000-000000000000:-12016-05-28 15:32:58 4359 [Note] WSREP: protonet asio version 02016-05-28 15:32:58 4359 [Note] WSREP: Using CRC-32C for message checksums.2016-05-28 15:32:58 4359 [Note] WSREP: backend: asio2016-05-28 15:32:58 4359 [Warning] WSREP: access file(/home/mysql/I6000//gvwstate.dat) failed(No such file or directory)2016-05-28 15:32:58 4359 [Note] WSREP: restore pc from disk failed2016-05-28 15:32:58 4359 [Note] WSREP: GMCast version 02016-05-28 15:32:58 4359 [Note] WSREP: (666e7891, &#39;tcp://192.168.1.241:6030&#39;) listening at tcp://192.168.1.241:60302016-05-28 15:32:58 4359 [Note] WSREP: (666e7891, &#39;tcp://192.168.1.241:6030&#39;) multicast: , ttl: 12016-05-28 15:32:58 4359 [Note] WSREP: EVS version 02016-05-28 15:32:58 4359 [Note] WSREP: gcomm: connecting to group &#39;pxc_zejin&#39;, peer &#39;192.168.1.240:6030,192.168.1.241:6030,192.168.1.242:6030&#39;2016-05-28 15:32:58 4359 [Note] WSREP: (666e7891, &#39;tcp://192.168.1.241:6030&#39;) turning message relay requesting on, nonlive peers: 2016-05-28 15:32:58 4359 [Note] WSREP: declaring 2cadc8a9 at tcp://192.168.1.240:6030 stable2016-05-28 15:32:58 4359 [Note] WSREP: Node 2cadc8a9 state prim2016-05-28 15:32:58 4359 [Note] WSREP: view(view_id(PRIM,2cadc8a9,2) memb {  2cadc8a9,0  666e7891,0} joined {} left {} partitioned {})2016-05-28 15:32:58 4359 [Note] WSREP: save pc into disk2016-05-28 15:32:58 4359 [Note] WSREP: discarding pending addr without UUID: tcp://192.168.1.242:60302016-05-28 15:32:58 4359 [Note] WSREP: discarding pending addr proto entry 0x30f95602016-05-28 15:32:59 4359 [Note] WSREP: gcomm: connected2016-05-28 15:32:59 4359 [Note] WSREP: Changing maximum packet size to 64500, resulting msg size: 326362016-05-28 15:32:59 4359 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)2016-05-28 15:32:59 4359 [Note] WSREP: Opened channel &#39;pxc_zejin&#39;2016-05-28 15:32:59 4359 [Note] WSREP: Waiting for SST to complete.2016-05-28 15:32:59 4359 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 1, memb_num = 22016-05-28 15:32:59 4359 [Note] WSREP: STATE EXCHANGE: Waiting for state UUID.2016-05-28 15:32:59 4359 [Note] WSREP: STATE EXCHANGE: sent state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c6322016-05-28 15:32:59 4359 [Note] WSREP: STATE EXCHANGE: got state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c632 from 0 (node6000_240)2016-05-28 15:32:59 4359 [Note] WSREP: STATE EXCHANGE: got state msg: 66ae3372-24a6-11e6-8d13-c77d57a8c632 from 1 (node6000_241)2016-05-28 15:32:59 4359 [Note] WSREP: Quorum results:  version  = 3,  component = PRIMARY,  conf_id  = 1,  members  = 1/2 (joined/total),  act_id   = 12,  last_appl. = -1,  protocols = 0/7/3 (gcs/repl/appl),  group UUID = 6c86dc17-246f-11e6-9955-ae4d7e89eed22016-05-28 15:32:59 4359 [Note] WSREP: Flow-control interval: [23, 23]2016-05-28 15:32:59 4359 [Note] WSREP: Shifting OPEN -> PRIMARY (TO: 12)2016-05-28 15:32:59 4359 [Note] WSREP: State transfer required:   Group state: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:12  Local state: 00000000-0000-0000-0000-000000000000:-12016-05-28 15:32:59 4359 [Note] WSREP: New cluster view: global state: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:12, view# 2: Primary, number of nodes: 2, my index: 1, protocol version 32016-05-28 15:32:59 4359 [Warning] WSREP: Gap in state sequence. Need state transfer.2016-05-28 15:32:59 4359 [Note] WSREP: Running: &#39;wsrep_sst_xtrabackup-v2 --role &#39;joiner&#39; --address &#39;192.168.1.241:6020&#39; --datadir &#39;/home/mysql/I6000/&#39; --defaults-file &#39;/home/mysql/pxc6000.cnf&#39; --defaults-group-suffix &#39;&#39; --parent &#39;4359&#39; &#39;&#39; &#39;WSREP_SST: [INFO] Streaming with xbstream (20160528 15:32:59.795)WSREP_SST: [INFO] Using socat as streamer (20160528 15:32:59.797)WSREP_SST: [INFO] Evaluating timeout -s9 100 socat -u TCP-LISTEN:6020,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) (20160528 15:32:59.840)2016-05-28 15:33:00 4359 [Note] WSREP: Prepared SST request: xtrabackup-v2|192.168.1.241:6020/xtrabackup_sst//12016-05-28 15:33:00 4359 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.2016-05-28 15:33:00 4359 [Note] WSREP: REPL Protocols: 7 (3, 2)2016-05-28 15:33:00 4359 [Note] WSREP: Service thread queue flushed.2016-05-28 15:33:00 4359 [Note] WSREP: Assign initial position for certification: 12, protocol version: 32016-05-28 15:33:00 4359 [Note] WSREP: Service thread queue flushed.2016-05-28 15:33:00 4359 [Warning] WSREP: Failed to prepare for incremental state transfer: Local state UUID (00000000-0000-0000-0000-000000000000) does not match group state UUID (6c86dc17-246f-11e6-9955-ae4d7e89eed2): 1 (Operation not permitted)   at galera/src/replicator_str.cpp:prepare_for_IST():482. IST will be unavailable.2016-05-28 15:33:00 4359 [Note] WSREP: Member 1.0 (node6000_241) requested state transfer from &#39;*any*&#39;. Selected 0.0 (node6000_240)(SYNCED) as donor.2016-05-28 15:33:00 4359 [Note] WSREP: Shifting PRIMARY -> JOINER (TO: 12)2016-05-28 15:33:00 4359 [Note] WSREP: Requesting state transfer: success, donor: 0WSREP_SST: [INFO] Proceeding with SST (20160528 15:33:00.512)WSREP_SST: [INFO] Evaluating socat -u TCP-LISTEN:6020,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) (20160528 15:33: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&#39;removed `/home/mysql/I6000/ib_logfile1&#39;removed `/home/mysql/I6000/xtrabackup_info&#39;removed `/home/mysql/I6000/xtrabackup_checkpoints&#39;removed `/home/mysql/I6000/performance_schema/rwlock_instances.frm&#39;removed `/home/mysql/I6000/performance_schema/db.opt&#39;removed `/home/mysql/I6000/performance_schema/session_account_connect_attrs.frm&#39;removed `/home/mysql/I6000/performance_schema/performance_timers.frm&#39;removed `/home/mysql/I6000/performance_schema/setup_objects.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_user_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_digest.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_history.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_user_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/setup_timers.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_account_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_thread_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/session_connect_attrs.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_history_long.frm&#39;removed `/home/mysql/I6000/performance_schema/table_io_waits_summary_by_index_usage.frm&#39;removed `/home/mysql/I6000/performance_schema/table_io_waits_summary_by_table.frm&#39;removed `/home/mysql/I6000/performance_schema/host_cache.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_global_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_host_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_current.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_thread_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/mutex_instances.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_host_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/objects_summary_global_by_type.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_current.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_summary_global_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/threads.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_history.frm&#39;removed `/home/mysql/I6000/performance_schema/file_summary_by_instance.frm&#39;removed `/home/mysql/I6000/performance_schema/table_lock_waits_summary_by_table.frm&#39;removed `/home/mysql/I6000/performance_schema/setup_instruments.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_thread_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/users.frm&#39;removed `/home/mysql/I6000/performance_schema/socket_summary_by_instance.frm&#39;removed `/home/mysql/I6000/performance_schema/socket_instances.frm&#39;removed `/home/mysql/I6000/performance_schema/setup_consumers.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_host_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_summary_by_instance.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_current.frm&#39;removed `/home/mysql/I6000/performance_schema/socket_summary_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_history_long.frm&#39;removed `/home/mysql/I6000/performance_schema/cond_instances.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_history_long.frm&#39;removed `/home/mysql/I6000/performance_schema/events_waits_history.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_by_account_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_statements_summary_global_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_account_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/file_instances.frm&#39;removed `/home/mysql/I6000/performance_schema/hosts.frm&#39;removed `/home/mysql/I6000/performance_schema/setup_actors.frm&#39;removed `/home/mysql/I6000/performance_schema/events_stages_summary_by_user_by_event_name.frm&#39;removed `/home/mysql/I6000/performance_schema/accounts.frm&#39;removed `/home/mysql/I6000/performance_schema/file_summary_by_event_name.frm&#39;removed directory: `/home/mysql/I6000/performance_schema&#39;removed `/home/mysql/I6000/zejin/db.opt&#39;removed `/home/mysql/I6000/zejin/t1.ibd&#39;removed `/home/mysql/I6000/zejin/t1.frm&#39;removed directory: `/home/mysql/I6000/zejin&#39;removed `/home/mysql/I6000/xtrabackup_binlog_info&#39;removed `/home/mysql/I6000/backup-my.cnf&#39;removed `/home/mysql/I6000/xtrabackup_binlog_pos_innodb&#39;removed `/home/mysql/I6000/mysql/time_zone_transition_type.MYI&#39;removed `/home/mysql/I6000/mysql/time_zone_transition.MYI&#39;removed `/home/mysql/I6000/mysql/servers.MYD&#39;removed `/home/mysql/I6000/mysql/ndb_binlog_index.frm&#39;removed `/home/mysql/I6000/mysql/servers.MYI&#39;removed `/home/mysql/I6000/mysql/plugin.frm&#39;removed `/home/mysql/I6000/mysql/time_zone_transition_type.MYD&#39;removed `/home/mysql/I6000/mysql/proxies_priv.MYD&#39;removed `/home/mysql/I6000/mysql/proxies_priv.frm&#39;removed `/home/mysql/I6000/mysql/columns_priv.frm&#39;removed `/home/mysql/I6000/mysql/help_keyword.MYI&#39;removed `/home/mysql/I6000/mysql/func.frm&#39;removed `/home/mysql/I6000/mysql/proc.frm&#39;removed `/home/mysql/I6000/mysql/innodb_table_stats.ibd&#39;removed `/home/mysql/I6000/mysql/help_topic.frm&#39;removed `/home/mysql/I6000/mysql/slow_log.CSM&#39;removed `/home/mysql/I6000/mysql/help_relation.MYD&#39;removed `/home/mysql/I6000/mysql/proc.MYD&#39;removed `/home/mysql/I6000/mysql/help_category.MYD&#39;removed `/home/mysql/I6000/mysql/help_category.frm&#39;removed `/home/mysql/I6000/mysql/columns_priv.MYI&#39;removed `/home/mysql/I6000/mysql/help_topic.MYI&#39;removed `/home/mysql/I6000/mysql/event.frm&#39;removed `/home/mysql/I6000/mysql/db.frm&#39;removed `/home/mysql/I6000/mysql/columns_priv.MYD&#39;removed `/home/mysql/I6000/mysql/time_zone_transition.MYD&#39;removed `/home/mysql/I6000/mysql/innodb_index_stats.frm&#39;removed `/home/mysql/I6000/mysql/time_zone.MYI&#39;removed `/home/mysql/I6000/mysql/event.MYD&#39;removed `/home/mysql/I6000/mysql/slave_master_info.ibd&#39;removed `/home/mysql/I6000/mysql/help_topic.MYD&#39;removed `/home/mysql/I6000/mysql/help_relation.MYI&#39;removed `/home/mysql/I6000/mysql/db.MYD&#39;removed `/home/mysql/I6000/mysql/slave_relay_log_info.ibd&#39;removed `/home/mysql/I6000/mysql/user.MYI&#39;removed `/home/mysql/I6000/mysql/plugin.MYI&#39;removed `/home/mysql/I6000/mysql/proc.MYI&#39;removed `/home/mysql/I6000/mysql/help_relation.frm&#39;removed `/home/mysql/I6000/mysql/time_zone_name.MYD&#39;removed `/home/mysql/I6000/mysql/innodb_table_stats.frm&#39;removed `/home/mysql/I6000/mysql/time_zone.frm&#39;removed `/home/mysql/I6000/mysql/servers.frm&#39;removed `/home/mysql/I6000/mysql/general_log.CSV&#39;removed `/home/mysql/I6000/mysql/ndb_binlog_index.MYI&#39;removed `/home/mysql/I6000/mysql/func.MYD&#39;removed `/home/mysql/I6000/mysql/slave_worker_info.ibd&#39;removed `/home/mysql/I6000/mysql/innodb_index_stats.ibd&#39;removed `/home/mysql/I6000/mysql/time_zone_name.frm&#39;removed `/home/mysql/I6000/mysql/proxies_priv.MYI&#39;removed `/home/mysql/I6000/mysql/slow_log.frm&#39;removed `/home/mysql/I6000/mysql/tables_priv.MYI&#39;removed `/home/mysql/I6000/mysql/tables_priv.MYD&#39;removed `/home/mysql/I6000/mysql/procs_priv.frm&#39;removed `/home/mysql/I6000/mysql/help_keyword.MYD&#39;removed `/home/mysql/I6000/mysql/time_zone_leap_second.MYD&#39;removed `/home/mysql/I6000/mysql/tables_priv.frm&#39;removed `/home/mysql/I6000/mysql/ndb_binlog_index.MYD&#39;removed `/home/mysql/I6000/mysql/slow_log.CSV&#39;removed `/home/mysql/I6000/mysql/time_zone.MYD&#39;removed `/home/mysql/I6000/mysql/procs_priv.MYD&#39;removed `/home/mysql/I6000/mysql/slave_master_info.frm&#39;removed `/home/mysql/I6000/mysql/general_log.frm&#39;removed `/home/mysql/I6000/mysql/help_keyword.frm&#39;removed `/home/mysql/I6000/mysql/time_zone_transition_type.frm&#39;removed `/home/mysql/I6000/mysql/general_log.CSM&#39;removed `/home/mysql/I6000/mysql/time_zone_transition.frm&#39;removed `/home/mysql/I6000/mysql/time_zone_name.MYI&#39;removed `/home/mysql/I6000/mysql/event.MYI&#39;removed `/home/mysql/I6000/mysql/time_zone_leap_second.frm&#39;removed `/home/mysql/I6000/mysql/plugin.MYD&#39;removed `/home/mysql/I6000/mysql/slave_relay_log_info.frm&#39;removed `/home/mysql/I6000/mysql/help_category.MYI&#39;removed `/home/mysql/I6000/mysql/user.frm&#39;removed `/home/mysql/I6000/mysql/user.MYD&#39;removed `/home/mysql/I6000/mysql/procs_priv.MYI&#39;removed `/home/mysql/I6000/mysql/db.MYI&#39;removed `/home/mysql/I6000/mysql/time_zone_leap_second.MYI&#39;removed `/home/mysql/I6000/mysql/slave_worker_info.frm&#39;removed `/home/mysql/I6000/mysql/func.MYI&#39;removed directory: `/home/mysql/I6000/mysql&#39;removed `/home/mysql/I6000/ibdata1&#39;WSREP_SST: [INFO] Cleaning the binlog directory /home/mysql/I6000 as well (20160528 15:33:00.540)rm: cannot remove `/home/mysql/I6000/*.index&#39;: No such file or directoryWSREP_SST: [INFO] Waiting for SST streaming to complete! (20160528 15:33:00.547)2016-05-28 15:33:01 4359 [Note] WSREP: (666e7891, &#39;tcp://192.168.1.241:6030&#39;) turning message relay requesting off2016-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&#39;: No such file or directoryrm: cannot remove `/home/mysql/I6000//innobackup.move.log&#39;: No such file or directoryWSREP_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: 122016-05-28 15:33:20 4359 [Note] Plugin &#39;FEDERATED&#39; is disabled.2016-05-28 15:33:20 4359 [Note] InnoDB: Using atomics to ref count buffer pool pages2016-05-28 15:33:20 4359 [Note] InnoDB: The InnoDB memory heap is disabled2016-05-28 15:33:20 4359 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2016-05-28 15:33:20 4359 [Note] InnoDB: Memory barrier is not used2016-05-28 15:33:20 4359 [Note] InnoDB: Compressed tables use zlib 1.2.32016-05-28 15:33:20 4359 [Note] InnoDB: Using Linux native AIO2016-05-28 15:33:20 4359 [Note] InnoDB: Using CPU crc32 instructions2016-05-28 15:33:20 4359 [Note] InnoDB: Initializing buffer pool, size = 100.0M2016-05-28 15:33:20 4359 [Note] InnoDB: Completed initialization of buffer pool2016-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 start2016-05-28 15:33:21 4359 [Note] InnoDB: Percona XtraDB (percona.com) 5.6.26-74.0 started; log sequence number 16501982016-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): &#39;*&#39;; port: 60002016-05-28 15:33:21 4359 [Note] IPv6 is available.2016-05-28 15:33:21 4359 [Note]  - &#39;::&#39; resolves to &#39;::&#39;;2016-05-28 15:33:21 4359 [Note] Server socket created on IP: &#39;::&#39;.2016-05-28 15:33:21 4359 [Warning] &#39;user&#39; entry &#39;root@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 15:33:21 4359 [Warning] &#39;user&#39; entry &#39;@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 15:33:21 4359 [Warning] &#39;proxies_priv&#39; entry &#39;@ root@zejin240&#39; ignored in --skip-name-resolve mode.2016-05-28 15:33:21 4359 [Note] Event Scheduler: Loaded 0 events2016-05-28 15:33:21 4359 [Note] WSREP: Signalling provider to continue.2016-05-28 15:33:21 4359 [Note] WSREP: Initialized wsrep sidno 22016-05-28 15:33:21 4359 [Note] WSREP: SST received: 6c86dc17-246f-11e6-9955-ae4d7e89eed2:122016-05-28 15:33:21 4359 [Note] /usr/local/pxc_56/bin/mysqld: ready for connections.Version: &#39;5.6.26-74.0-25.12-log&#39; socket: &#39;/home/mysql/I6000/mysql.sock&#39; port: 6000 Percona XtraDB Cluster binary (GPL) 5.6.26-25.12, Revision 624ef81, wsrep_25.122016-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 connections2016-05-28 15:33:21 4359 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
로그인 후 복사

제거된 작업이 많은 것을 볼 수 있습니다. will

데이터 폴더의 모든 파일을 삭제한 다음 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&#39;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&#39;s IST, proceeds as before.
로그인 후 복사
이 시점에서 SST가 필요하지 않은 방법을 완료했습니다. pxc 환경에 새 노드가 추가되면 데이터 양이 많을 때 SST는 많은 양의 리소스를 차지합니다. 구성된 gcache.size는 백업 기간 동안 마스터 노드에서 생성되는 데이터 양을 수용하기에 충분합니다. 업무량이 적은 기간 동안 스크립트를 통해 이 새로운 노드를 구현하는 것이 좋습니다.

위 내용은 IST 전송만 필요한 새로운 노드를 구축하는 MySQL PXC의 방법에 대한 자세한 설명의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿