Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ XtraBackup achieve non-stop use of master-slave synchronization service     - C language to view various types of data size (Programming)

- Linear table with a Java implementation of the iterator (Programming)

- Linux Mint brightness adjustment --xrandr command learning (Linux)

- Linux system commands to view hardware information (Linux)

- Protect against network attacks using Linux system firewall (Linux)

- RMAN backup file is much larger than the size of the database Cause Analysis (Database)

- Through Oracle to help restore MySQL data problems (Database)

- Linux based exercises, interview questions (Linux)

- How to troubleshoot Windows and Ubuntu dual system time is not synchronized (Linux)

- Linux and hardware (Linux)

- KVM QEMU virtual machine installation configuration under CentOS (Linux)

- Linux5.8 installed phpMyAdmin was unable to issue related php-mcrypt (Database)

- Windows 8.1 hard drive to install Ubuntu 14.04 dual system reference tutorials and multi-drive Precautions (Linux)

- How to set the default Fedora from the command line (Linux)

- Java Cookie Comments (Programming)

- Git delete files (Linux)

- How to Install SeaMonkey 2.25 for Ubuntu (Linux)

- IntelliJ IDEA run in Mac10.9 and JDK7 environment (Linux)

- Use Makeself Create installation file (Linux)

- Spring Data JPA call a stored procedure examples (Programming)

 
         
  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:      
 
- Python objects (Programming)
- cat command uses the Linux redirection merge files (Linux)
- Ubuntu 14.04 / 13.10 users how to install Ubuntu Touch core applications (Linux)
- Python in os.path Magical (Programming)
- Delete specific files using bash directory under Linux (Linux)
- CentOS 7 - use cgroups limit process resource (Linux)
- Android SDK Manager can not update the domestic solutions (Linux)
- DBCA Error: ORA-19809: limit exceeded for recovery files process (Database)
- Text analysis tools - awk (Linux)
- Oracle table Access Control (Database)
- Use dump restore mode fast backup and recovery system FreeBSD (Linux)
- Using DBMS_STAT function closes mission (Database)
- Computer security protection remove local and remote system log files (Linux)
- Mass data storage application of MongoDB database (Database)
- Normal start Lazarus 1.0.8 under Ubuntu (Linux)
- Zookeeper cluster deployment (Server)
- To record command input under Linux (Linux)
- CentOS 5.x install Lua 5.2.3 error (LIBS = -lncurses) (Linux)
- CentOS 7 Change Hostname (Linux)
- CentOS minimal network is unavailable resolved (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.