当前位置:网站首页>Xtrabackup backup and recovery
Xtrabackup backup and recovery
2022-06-09 05:25:00 【Anonymous s】
xtrabackup
XtraBackup(PXB) The tool is Percona Company use perl One of the tools of language development is for MySQL Backup tool for physical hot backup of database , Support MySQl(Oracle)、Percona Server and MariaDB, And all open source , It's the conscience of the industry . Ali's RDS MySQL Physical backup is based on this tool . Because it is backed up by physical copy , So it's very fast , Dozens of G The data is done in a few minutes , And it cleverly uses mysql Features to achieve online hot backup , You don't have to shut down the database like you used to do a physical backup , The full backup and incremental backup of the whole database or part of the database can be completed directly online .
install
Installation warehouse Install the Percona repository
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpmTest whether the warehouse contains the latest version of resources
yum list | grep perconainstall packages
yum install percona-xtrabackup-24Installation error

terms of settlementyum update percona-release
The data backup 1
- Full volume backup
innobackupex ----defaults-file=/etc/my.cnf --user=root --password=root /root/back
Data recovery
Shut down the database service
service mysql stopExecute the data recovery command *( Be careful my.cnf Internally configured datadir Directory must be an empty directory , So before restoring data , First datadir To another directory , Then create an empty directory and perform the recovery )
innobackupex --defaults-file=/etc/my.cnf --copy-back --rsync /path/to/backupChange permissions for the newly created directory
chown -R mysql. /app/mysql/datastart-up mysql service
service mysql start
The data backup 2- Streaming backup
#!/bin/bash
defaults_file="/etc/my.cnf" # mysql Profile location
user=“root” #mysql account number
password=“aaaaaa” #mysql password
backup_dir="/mnt/database_backup/dir/" # The root directory that needs to be archived
name="$(date +"%Y%m%d")"
shell=‘innobackupex --defaults-file=‘ d e f a u l t s f i l e ′ − − u s e r = ′ defaults_file' --user=' defaultsfile′−−user=′user’ --password=‘ p a s s w o r d ′ − − s t r e a m = t a r / m n t / s t o r a g e d a t a b a s e / t e m p ∣ s s h r o o t @ want Hair send Of i p " g z i p − > ′ password' --stream=tar /mnt/storage_database/temp | ssh [email protected] To send ip "gzip -> ' password′−−stream=tar/mnt/storagedatabase/temp∣sshroot@ want Hair send Of ip"gzip−>′backup_dir$name’.tar.gz"’
eval $shell
边栏推荐
- Example of name call obtained by ID (Tencent IM)
- AQS之 ReentrantLock 源码分析
- Myql error expression 1 of select list is not in group by claim and contains nonaggregated column
- Requests segmented downloading of files and multi-threaded downloading
- Heap and priority queues
- Li Kou today's question -1037 Effective boomerang
- validate-npm-package-name
- AQS 之 CountdownLatch 源码分析
- R language multivariable generalized orthogonal GARCH (go-garch) model for fitting and forecasting high-dimensional volatility time series of stock market
- Design owlook network novel recommendation system
猜你喜欢

数据血缘用例与扩展实践
![[Django学习笔记 - 12]:数据库操作](/img/d8/2c4b6c036532c213477754b6f9758e.png)
[Django学习笔记 - 12]:数据库操作

2022 tea artist (intermediate) examination question simulation examination question bank and simulation examination

R language multivariable generalized orthogonal GARCH (go-garch) model for fitting and forecasting high-dimensional volatility time series of stock market

2022年茶艺师(中级)考试题模拟考试题库及模拟考试

Clcnet: Rethink integrated modeling with classified confidence network (with source code download)

Camtasia studio2022 free key serial number installation trial detailed graphic tutorial

Transformer里面的缓存机制

Windows10 installs both MySQL 5 and MySQL 8

2022 welder (elementary) special operation certificate examination question bank and simulation examination
随机推荐
爬取html入mysql插入失败
Previous improvements of CSDN products (up to issue 29)
ETF operation practice record: March 2, 2022
Deque of STL
FPGA based TDC Research Report
^26 browser kernel
Basic knowledge of deep learning: face based common expression recognition (1)
array
关于istream输入流对象cin的输入函数
Rotate array leetcode
Sonarlint代码规范改造实践及一些想法
AQS之 ReentrantLock 源码分析
MRNA factory| quantitative detection of LNP encapsulated RNA content by ribogreen
崔健没变,北汽极狐该做出改变了
ps如何给图像加白边
Palindrome linked list leetcode
Product weekly report issue 29 | creation center optimization: the sending assistant adds the quality score detection function, and the blog adds the historical version of the content
好榛子出辽阳!
2022 welder (elementary) special operation certificate examination question bank and simulation examination
Talk about 10 tips to ensure thread safety