omegazeng / run-mariabackup Goto Github PK
View Code? Open in Web Editor NEWScript to create full/incremental backups with mariabackup. Compress with xbstream.
License: MIT License
Script to create full/incremental backups with mariabackup. Compress with xbstream.
License: MIT License
Hi,
you forked this backup script from jmfederico / run-xtrabackup.sh.
Question:
Is your script function wise identical to the original script?
THX
Hello,
can you please document when a full / incremental backup is created?
I understand that the script is triggered by a cron job, but I don't understand what conditions define if there's a full or incremental backup.
THX
Script won't run if the MySQL password contains spaces (fails at the mysqladmin
check)
Creating the issue here because I'm not sure where else to ask for assistance.
I've been trying all day to test my backups and I want to restore my maria instance from its incrementals. I first run
mariabackup --prepare --target-dir base/'2021-11-25_23-00-01'/backup/
, the preparation works. However, when I try and prepare the first incremental backup I get this stack trace:
[00] 2021-11-30 14:20:25 open files limit requested 0, set to 1024
[00] 2021-11-30 14:20:25 This target seems to be already prepared.
[00] 2021-11-30 14:20:25 mariabackup: using the following InnoDB configuration for recovery:
[00] 2021-11-30 14:20:25 innodb_data_home_dir = .
[00] 2021-11-30 14:20:25 innodb_data_file_path = ibdata1:12M:autoextend
[00] 2021-11-30 14:20:25 innodb_log_group_home_dir = /mnt/data/mariadb-restore/backup/incr/2021-11-25_23-00-01/2021-11-26_23-00-01/backup/
[00] 2021-11-30 14:20:25 InnoDB: Using Linux native AIO
[00] 2021-11-30 14:20:25 mariabackup: Generating a list of tablespaces
211130 14:20:25 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.5.12-MariaDB
key_buffer_size=0
read_buffer_size=131072
max_used_connections=0
max_threads=1
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 6047 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
addr2line: 'mariabackup': No such file
mariabackup(my_print_stacktrace+0x41)[0x55fa9f8b1ab1]
Printing to addr2line failed
mariabackup(handle_fatal_signal+0x498)[0x55fa9f3fb368]
??:0(__restore_rt)[0x7ffa86442a20]
:0(__memcmp_avx2_movbe)[0x7ffa86050cfe]
addr2line: 'mariabackup': No such file
mariabackup(+0xc9b52b)[0x55fa9f67c52b]
mariabackup(+0xd87358)[0x55fa9f768358]
mariabackup(+0xc9cea7)[0x55fa9f67dea7]
mariabackup(+0xce72e3)[0x55fa9f6c82e3]
mariabackup(+0x6a22cb)[0x55fa9f0832cb]
mariabackup(+0x6a0a7e)[0x55fa9f081a7e]
mariabackup(+0x6a0dc7)[0x55fa9f081dc7]
mariabackup(+0x6acbb8)[0x55fa9f08dbb8]
mariabackup(main+0x194)[0x55fa9f048444]
??:0(__libc_start_main)[0x7ffa85f1bb75]
addr2line: 'mariabackup': No such file
mariabackup(_start+0x2e)[0x55fa9f07da9e]
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
I'm using kubernetes to run the maria instance and I've tried to create a duplicate environment to restore and I've tried running the prepare directly on the host with the same results. This leads me to believe that there is an issue with the incremental. Any help/guidance on this will be greatly appreciated.
Hi all,
I cloned the script but I can't get it to work. I changed the password and path (/home/bellerophon/mariadb_backup) variables up top. But every time I run it I get these errors:
[00] 2021-11-09 18:50:17 Error: cannot open /home/bellerophon/mariadb_backup/incr/2021-11-09_18-37-04/2021-11-09_18-50-00//xtrabackup_checkpoints
[00] 2021-11-09 18:50:17 mariabackup: error: failed to read metadata from /home/bellerophon/mariadb_backup/incr/2021-11-09_18-37-04/2021-11-09_18-50-00//xtrabackup_checkpoints
Full log:
----------------------------
run-mariabackup.sh: MySQL backup script
started: Tue Nov 9 18:50:17 CET 2021
Lock directory created
Check completed OK
New incremental backup
[00] 2021-11-09 18:50:17 Error: cannot open /home/bellerophon/mariadb_backup/incr/2021-11-09_18-37-04/2021-11-09_18-50-00//xtrabackup_checkpoints
[00] 2021-11-09 18:50:17 mariabackup: error: failed to read metadata from /home/bellerophon/mariadb_backup/incr/2021-11-09_18-37-04/2021-11-09_18-50-00//xtrabackup_checkpoints
Cleaning up old backups (older than 40320 minutes) and temporary files
took 0 seconds
completed: Tue Nov 9 18:50:17 CET 2021
Lock directory removed
I'm using Ubuntu 20.04.03 LTS (LXC container) and MariaDB server version: 10.3.31-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04
Thanks in advance!
Here is the output when running the script:
----------------------------
run-mariabackup.sh: MySQL backup script
started: Thu Mar 12 12:03:12 CET 2020
Check completed OK
New full backup
[00] 2020-03-12 12:03:12 Connecting to MySQL server host: localhost, user: backup, password: set, port: 3306, socket: not set
[00] 2020-03-12 12:03:12 Using server version 10.4.11-MariaDB
[00] 2020-03-12 12:03:12 Error: missing required privilege PROCESS on *.*
[00] 2020-03-12 12:03:12 Current privileges, as reported by 'SHOW GRANTS':
[00] 2020-03-12 12:03:12 1.GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'backup'@'localhost' IDENTIFIED BY PASSWORD 'password'
Cleaning up old backups (older than 60480 minutes) and temporary files
took 0 seconds
completed: Thu Mar 12 12:03:12 CET 2020
After granting PROCESS on *.*
the script fails again with this output:
----------------------------
run-mariabackup.sh: MySQL backup script
started: Thu Mar 12 12:06:53 CET 2020
Check completed OK
New incremental backup
[00] 2020-03-12 12:06:53 Error: cannot open /home/mysqlbackup/base/2020-03-12_12-03-12//xtrabackup_checkpoints
[00] 2020-03-12 12:06:53 mariabackup: error: failed to read metadata from /home/mysqlbackup/base/2020-03-12_12-03-12//xtrabackup_checkpoints
Cleaning up old backups (older than 60480 minutes) and temporary files
took 0 seconds
completed: Thu Mar 12 12:06:53 CET 2020
Then I did rm -rf /home/mysqlbackup
and ran the script again. This time it worked.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.