In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Xtrabackup:
Xtrabackup was developed by percona. Very good support for innoDB engine. Do not lock the table when backing up. If it is a MYiSAM engine, you need to lock the table.
Xtrabackup is replicated by copying the ib_logfile0 (ib_logfile1) transaction log. In addition, the perpare function is provided. It can also be compared with database data during recovery. If there is an update, update it to the backup. The loss of data is avoided. At the same time, it also provides a compression mechanism to reduce storage pressure.
Download the rpm package from the official website address: https://www.percona.com/downloads/XtraBackup can also be installed by yum
Yum installation: (the following is the method of making yum source provided by the official website)
Building yum Warehouse
# yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
(at this time: percona-release.repo of multiple warehouses under / etc/yum.repos.d/ directory)
# yum list | grep percona (View package)
Install # yum install percona-xtrabackup-20.x86_64-y (version 20 is selected here)
Backup:
Innobackupex is the encapsulation and function extension of xtrabackup by perl script. Xtrabackup requires permissions to connect to the database and datadir operations.
Command: # innobackupex-- user=root-- defaults-file=.../my.cnf / mnt
# user is the user of the database (non-system root). If you have a password, you can also add a parameter-- password=.
#-if defaults-file is not set, it will be automatically set to / etc/my.cnf (if multiple instances need to be noted)
-- database= backs up a database separately. If you don't add this parameter, you will back up the whole database.
# / mnt is the directory where backups are stored
Restore: (you can empty the files under the data folder, but keep the data folder)
# innobackupex-- copy-back / mnt/2017-02-1300 17-05-08 /
Here, if the my.cnf file location is not under / etc. Need to add a parameter-- default-file=.../my.cnf
If the database is still writing at the time of backup. Then a prepare operation is required. (roll back log)
First: prepare operation, analysis of things log. And then recover.
-- user-memory: specify the memory that can be used in the prepare phase. The more memory, the faster the speed. Default is 10MB.
# innobackupex-- apply-log / mnt/2017-02-1300 17-05-08 /
# innobackupex-- copy-back / mnt/2017-02-131705008 /
Modify the group and owner of the data directory: # chown-R mysql:mysql.. / data
Otherwise, you will be prompted not to find it when you start. Pid file.
Just start the service.
Compressed backup: (stream operation)
# innobackupex-user=root-stream=tar-defaults-file=/etc/my.cnf / mnt | gzip-> / mnt/mysql.tar.gz
The defaults-file here can be omitted. If the configuration file is needed elsewhere. Specify.
Available parameters:
-- parallel=4: speed up backups. This option specifies the number of threads for xtrabackup to back up files.
It is important to note that the parameter I is required to extract the file here.
Tar zixf .tar.gz otherwise decompression will make an error.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.