Heim > Datenbank > MySQL-Tutorial > Ausführliche Erläuterung der Methode von MySQL PXC zum Aufbau eines neuen Knotens, der nur eine IST-Übertragung erfordert

Ausführliche Erläuterung der Methode von MySQL PXC zum Aufbau eines neuen Knotens, der nur eine IST-Übertragung erfordert

黄舟
Freigeben: 2017-04-18 11:29:27
Original
1604 Leute haben es durchsucht

Der folgende Editor bringt Ihnen einen Artikel MySQL PXC-Methode zum Erstellen eines neuen Knotens, der nur eine IST-Übertragung erfordert (empfohlen). Der Herausgeber findet es ziemlich gut, deshalb werde ich es jetzt mit Ihnen teilen und es allen als Referenz geben. Folgen wir dem Editor und werfen wir einen Blick darauf.

Nachfrageszenario: Die ursprüngliche pxc-Umgebung muss zu diesem Cluster hinzugefügt werden von SST? .

PXC bietet zwei Möglichkeiten, Daten zu übertragen:

IST: Inkrementelle Statusübertragung, inkrementelle Synchronisierung
SST: Status-Snapshot Vollständige Menge übertragen. Bedingungen für die Synchronisierung

IST: Dies erfolgt mithilfe des Caching-Mechanismus auf Knoten (d. h. nur Knotendaten, die im vorherigen Cluster aufgetreten sind, befinden sich noch im Cache )

Beurteilungsmethode:

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

Dieser Wert ist kleiner als die Sequenznummer des neu geöffneten Knotens:

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

Unsere Idee besteht also darin, einen Cluster zu sichern, die Daten des mittleren Knotens auf dem neuen Knoten wiederherzustellen und eine grastate.dat zu fälschen, um die Sequenznummer der Sicherungsdaten aufzuzeichnen, sodass der neue Knoten beim Start automatisch verwendet wird IST-Methode anstelle von SST (beachten Sie, dass gcache.size ausreichend Kapazität haben sollte, um sicherzustellen, dass alle neu generierten Daten während der Sicherung und Wiederherstellung zwischengespeichert werden)

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.
Nach dem Login kopieren

Im Folgenden sind die Schritte aufgeführt für diesen Vorgang:

node240: 192.168.1.240 – Bereits vorhandener Clusterknoten
node241: 192.168.1.241 – Clusterknoten, der hinzugefügt werden soll

Schritt 1: Starten Sie den ersten Knoten im neuen Cluster

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

Die Konfigurationsdatei lautet wie folgt:

[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
Nach dem Login kopieren
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)
Nach dem Login kopieren

Schritt 2: Verwenden Sie innobackupex, um die Daten von node240 zu sichern:

[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
Nach dem Login kopieren

Schritt 3: Zu diesem Zeitpunkt fügen wir einige weitere Daten zu node240 hinzu:


此时我们再在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)
Nach dem Login kopieren

Schritt 4: Die gesicherten Daten auf Node241 übertragen und wiederherstellen:

[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
Nach dem Login kopieren

Schritt 5: Finden Sie den Speicherort der Ansichtsdatei xtrabackup_galera_info

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

Methode Zwei: Nach Binlog-Speicherort suchen:

[root@zejin241 I6000]# cat xtrabackup_binlog_infolog_bin.000003 2772Das Das heißt, der Speicherort des Sicherungspunkts während der Sicherung ist log_bin.000003 2772

Gehen wir zur Hauptdatenbank, um die XID zu finden, die diesem Binlog entspricht

[root@zejin240 I6000]# mysqlbinlog -vv log_bin .000003 |. grep Xid#160528 9:02:59 Server-ID 9816000 end_log_pos 947 CRC32 0x37371b3e = 9#160528 10:03:13 Server-ID 9816000 end_log_pos 3168 CRC32 0x8db2aa41 und diese Tabelle ist eine Myisam-Tabelle und es wird keinen Xid-Datensatz geben. In diesem Fall setzen wir die Xid entsprechend der oberen und unteren Position auf 8. Schritt 6: Schmieden Sie einen Grastat .dat-Datei auf Knoten241 (kopieren Sie sie von Knoten240 und ändern Sie die Sequenznummer):

# GALERA gespeicherte Statusversion: 2.1uuid: 6c86dc17-246f-11e6-9955-ae4d7e89eed2seqno: 8cert_index:


Schritt 7: Neuen Knoten starten:


Erfolgreich wiederhergestellt mit IST.

Schritt 8 Melden Sie sich beim neuen Knoten Knoten241 an und prüfen Sie, ob die Daten normal sind:


Es wurde festgestellt, dass alle Daten synchronisiert wurden.


Schritt 9: Protokollausgabe beim SST-Vergleich:

启动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.
Nach dem Login kopieren


Sie können sehen, dass eine große Anzahl entfernter Vorgänge vorhanden ist Es wird

alle Dateien im Datenordner löschen und dann die Daten vom Masterknoten über SST abrufen. Offizielle Anweisungen: An diesem Punkt haben wir den PXC abgeschlossen Umgebung, um die Notwendigkeit des Beitritts neuer Knoten zu vermeiden. Die SST-Methode beansprucht viele Ressourcen, wenn die Datenmenge groß ist. Die konfigurierte gcache.size reicht aus, um die vom Masterknoten während des Zeitraums generierte Datenmenge aufzunehmen Von der Sicherung bis zur Wiederherstellung wird empfohlen, diesen neuen Knotenbeitrittsvorgang in der Nebensaison zu implementieren.

Das obige ist der detaillierte Inhalt vonAusführliche Erläuterung der Methode von MySQL PXC zum Aufbau eines neuen Knotens, der nur eine IST-Übertragung erfordert. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage