Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ XtraBackup achieve non-stop use of master-slave synchronization service     - Keepalived achieve high availability Nginx Reverse Proxy (Server)

- MySQL Data Types (Database)

- When Linux Detailed time zone and common function of time (Linux)

- Linux host dual LAN transceiver package ARP problem (Linux)

- Profile Linux users login shell and login to read (Linux)

- Linux virtual machine how to access the Internet in a virtual machine when using NAT mode (Linux)

- Number JavaScript type system (Programming)

- Use Swift remove the spaces in the string (Programming)

- Safe learning through self-extracting package to achieve invasion (Linux)

- Upgrading from Fedora 20 to 21 (Linux)

- Each catalog Detailed Linux (Linux)

- Python control multi-process and multi-threaded concurrency (Programming)

- HomeKit User Interface Guidelines (Linux)

- Android Sets the system screen brightness (Programming)

- SSH without password Definitive Guide (Linux)

- To create a problem by the statement date comparison of the difference between MySQL and Oracle (Database)

- Sorting algorithm of dichotomy (binary) insertion sort algorithm (Programming)

- Dell R710 server disk recovery database one case (record) (Server)

- Use the vi text editor and copy and paste Linux tips (Linux)

- MySQL multi-master multi-cluster deployment uses alive Galera (Database)

 
         
  XtraBackup achieve non-stop use of master-slave synchronization service
     
  Add Date : 2018-11-21      
         
       
         
  MySQL master-slave synchronization principle:

MySQL master-slave synchronization is MySQL master-slave replication (Master-Slave Replication) based on the realization, by setting the Master MySQL's binlog (it is open), via an I / O threads from the upper Slave MySQL Master MySQL reads the binlog, and then transferred to the Slave MySQL relay logs and Slave MySQL SQL thread reads the relay log from the relay log, and then applied to the Slave MySQL database. This achieves synchronization from master data.

XtraBackup backup principle:

innobackupex in a background thread to keep track of InnoDB log files, and then copy the InnoDB data files. After data files are copied, the copy will be the end of the thread logs. So you get a copy of the data is not the same point in time and start the backup after transaction log. After completing the above steps, you can use InnoDB crash recovery code execution transaction log (redo log), in order to achieve data consistency.

Backup is divided into two processes:

backup, backup stage, tracking the transaction log file and copy the data (physical backup).
preparing, transaction log replay, so that all data in the same time points to a consistent state.
XtraBackup advantages:

You can complete the fast and reliable data backup (copy the data files and tracking transaction log)
Data backup is not interrupted during transaction processing (hot standby)
Saving disk space and network bandwidth
Automatic backup is complete identification
Due to faster recovery time and increase uptime

First.xtrabackup installation:

yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL

rpm -ivh percona-xtrabackup-2.2.12-1.el6.x86_64.rpm

Software Download: https: //www.percona.com/software/mysql-database/percona-xtrabackup

Second check mysql version:

Make full use xtrabackup preparation and recovery, the best consistent Mysql version!

Check mysql version:

 / Webser / mysql55 / bin / mysql -V

/ Webser / mysql55 / bin / mysql Ver 14.14 Distrib 5.5.21, for Linux (x86_64) using readline 5.1

Third on the master server online backup database:

innobackupex --defaults-file = / webser / mysql55 / etc / my.cnf --user = root --password = xxxx / tmp / backup /

PS: / tmp / backup / backup directory;

Then the master on the way by scp

On a four .slave machine operator;

1) Close mysql service;

Then emptied mysql directory under the data file, such as native mysql data directory is: / webser / mysql55 / var /

2) began to recover data

Suppose backup file path: / webser / 2015-08-12_13-54-56

Redo log files:

innobackupex --defaults-file = / webser / mysql55 / etc / my.cnf --user = root --password = xxxx --apply-log / tmp / backup / 2015-08-12_13-49-32 /

Recover data files:

innobackupex --defaults-file = / webser / mysql55 / etc / my.cnf --user = root --password = xxxx --copy-back / tmp / backup / 2015-08-12_13-49-32 /

The above operation, be sure to order, reverse the order of operation will cause mysql server will not start!

3) modify the data directory permissions:

chown -R mysql: mysql / webser / mysql55 / var

4) safe way to start mysql, see if there is an exception;

/ Webser / mysql55 / bin / mysqld_safe --defaults-file = / webser / mysql55 / etc / my.cnf &

If no exception error, closed mysql

 / Webser / mysql55 / bin / mysqladmin -uroot -p shutdown

5) Check the position value binlog log files, master-slave synchronization:

cat / tmp / backup / 2015-08-12_13-49-32 / xtrabackup_binlog_info

wwwmaster.000458 1022022953

6) call the shots from related operations on the slave machine:

CHANGE MASTER TO

MASTER_HOST = '192.168.1.xxx',

MASTER_USER = 'rep',

MASTER_PASSWORD = 'xxxxxx',

MASTER_PORT = 3306,

MASTER_LOG_FILE = 'wwwmaster.000458',

MASTER_LOG_POS = 1022022953;

Start master-slave synchronization:

start slave;

View slave status:
     
         
       
         
  More:      
 
- GitLab installation configuration notes (Linux)
- PF_RING 6.0.2 compiled and installed on Redhat 6.3 x86_64 (Linux)
- SQL Server 2008 database synchronization Notes (Database)
- Ubuntu 14.10 / 14.04 / 12.04 installation GNOME Pie 0.5.6 (Linux)
- Getting the Linux shell variable test (Programming)
- iptraf: A Practical TCP / UDP network monitoring tools (Linux)
- Java static code analysis tool Infer (Programming)
- Three minutes to teach you to easily grasp the grep command regular expression (Linux)
- Acquaintance C ++: the most simple C ++ program (Programming)
- Swift notes - let you two hours to learn Swift (Programming)
- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)
- Installation on the way to the root source Ubuntu Server 14.04 LTS version Odoo8.0 (Server)
- After installation of Debian 6.0 do a few things first (Linux)
- To use iostat display I / O status under Linux (Linux)
- Using IPFilter bridge filter in the FreeBSD system (Linux)
- Installing Linux and Windows 10 dual system (Linux)
- PostgreSQL export data dictionary documents (Database)
- MySQL how to export files with the date format (Database)
- Linux Security trust with users (Linux)
- Linux operating system, the internal and external security overview (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.