6. ClustrixDB 备份恢复
ClustrixDB备份恢复:
一、传统MySQL的备份/恢复
shell> mysqldump -u user -h clustrix host --single-transaction --master-data=2 --all-databases > mydumpfile.dump
二、ClustrixDB的备份/恢复
备份testdb下面所有表到/tmp/backup目录中
MySQL [testdb]> select count(*) from userinfo_uuid;
+----------+
| count(*) |
+----------+
| 10000 |
+----------+
1 row in set (0.01 sec)MySQL [(none)]> backup testdb.* to "sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/backup" ;
Query OK, 0 rows affected (1.92 sec)
恢复:
MySQL [testdb]> drop database testdb;
Query OK, 0 rows affected (0.01 sec)MySQL [(none)]> RESTORE * FROM "sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/backup" REPLICAS = 1;
Query OK, 0 rows affected (59.74 sec)
MySQL [(none)]> RESTORE * FROM "sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/backup" REPLICAS = 2;
Query OK, 0 rows affected (1 min 52.63 sec)MySQL [testdb]> use testdb; show tables;
+------------------+
| Tables_in_testdb |
+------------------+
| userinfo_uuid |
+------------------+
1 row in set (0.02 sec)MySQL [testdb]> select count(*) from userinfo_uuid;
+----------+
| count(*) |
+----------+
| 10000 |
+----------+
1 row in set (0.01 sec)
提高备份性能,默认备份进程一次备份一张表
MySQL [(none)]> show variables like 'bsackup_backup_concurrency';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| backup_backup_concurrency | 1 |
+---------------------------+-------+
1 row in set (0.00 sec)MySQL [(none)]> backup scloud.*,test.* to "sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/backup" ;
Query OK, 0 rows affected (2.12 sec)MySQL [(none)]> \! sudo rm -rf /tmp/backup
MySQL [(none)]> set global backup_backup_concurrency=2;
Query OK, 0 rows affected (0.01 sec)MySQL [(none)]> backup scloud.*,test.* to "sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/backup" ;
Query OK, 0 rows affected (1.51 sec)
查看备份文件信息:
MySQL [system]> SELECT * from system.backups where source="sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/"\G
*************************** 1. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
cluster_name: cld32d48dc6ff9c79d
version: clustrix-9.2
status: COMPLETED
start_time: 2019-11-28 03:23:41.084376
completed_time: 2019-11-28 03:23:42.581939
bytes: 179548772
1 row in set (1.94 sec)
查看备份文件中表信息
MySQL [system]> SELECT * from system.backup_tables where source="sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/"\G;
*************************** 1. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: scloud
table: sbtest1
bytes: 179545464
*************************** 2. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: test
table: foo
bytes: 68
*************************** 3. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: test
table: sb2
bytes: 1608
*************************** 4. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: test
table: sbtest1
bytes: 1584
*************************** 5. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: test
table: t1
bytes: 26
*************************** 6. row ***************************
source: sftp://scloudusr:Scloud201!@10.1.3.88:2022/tmp/
backup: backup
db: test
table: t2
bytes: 22
6 rows in set (1.95 sec)
影响备份恢复的global参数:
|
Name |
Description |
Default Value |
|---|---|---|
| backup_backup_concurrency |
The number of tables that can be backed up simultaneously. |
1 |
| backup_restore_concurrency | The maximum number of slices restored concurrently on each node. | 16 |
| backup_write_compression_level | Compression level from 1 (fastest) to 9 (best compression) | 6 |
备份/恢复的错误列表
Backup
|
Error |
Meaning |
|---|---|
Bad Parameter.:"Backup..." is invalid Bad parameter.: *.* is repeated in the list Bad parameter.: DB "..." is included multiple times Bad parameter.: "..." is included multiple times Bad parameter.: nothing to back up! Unrecognized backup url scheme: ... syntax error: ... |
Something is wrong with the BACKUP statement, please double check |
Generic Error: no user DB found Bad parameter.: Hidden database '...' cannot be backed up No such database: '...' Not found: Object "..." does not exist Not found: There are more than one "..." Backup only supported for TABLES right now: ... |
Trying to backup something that cannot be backed-up, or doesn't exist |
Representation is unavailable: ... Generic Backup Error: Couldn't find baserep for ... Generic Backup Error: Couldn't find columns for ... |
Trying to backup something currently unavailable |
Bad backup URL: ... |
Unable to parse URL or connect to FTP server |
Backup already exists in create: ... |
There is already a backup at that location |
Upload of slice was truncated on remote host: ... |
File written to backup was shorter than it should have been |
EXCLUDING *.* is invalid |
Would backup nothing |
“...” is repeated in the EXCLUDING clause |
Object is excluded more than once |
Restore
|
Error |
Meaning |
|---|---|
Bad parameter.: "RESTORE ..." is invalid Bad parameter.: Global wildcard *.* is used together with other targets Bad parameter.: DB "..." already exists on server or in the target list Bad parameter.: Target "..." already exists Bad parameter.: "..." is repeated in the target list Generic Backup Error: newdbnames array length must be same as dbnames Unrecognized backup url scheme: ... syntax error: ... |
Something is wrong with the RESTORE statement |
Bad backup URL: ... |
Unable to parse URL or connect to FTP server |
Unable to open backup for url: ... |
Cannot open backup directory on FTP server |
Backup not available for restore: ... |
This backup did not complete successfully |
DB not found in backup: ... |
Trying to restore something that is not in the backup |
Object not found in backup: ... |
|
DB already exists in the target location: ... Generic Backup Error: could not parse create statement: ... |
Cannot create object |
Unable to validate CREATE statement: ... |
Created object does not match backed-up object |
Generic Backup Error: could not parse column types from backup table "..." Column type mismatch during restore: ... Hash layout mismatch during restore: ... |
|
Unable to locate stored CRC of file: ... Backup CRC Mismatch: ... Unable to locate uncompressed length of file: ... |
Backup is corrupt |
Restore truncated by incomplete read: ... |
Read too little data for a row |
“...” is repeated in the EXCLUDING clause |
Object is excluded more than once |
Relation not found: While restoring object db_name.obj_name... |
The object noted references another that does not exist. The missing object is shown in parenthesis.
For example, this error occurs if a table was excluded from the backup, but the associated views or triggers were not. |
Zlib errors
| Error | Meaning |
|---|---|
Internal Error: Unexpected buffering stop |
Internal buffering error |
Internal Error: Unexpected stop |
FTP Errors
|
Error |
Meaning |
|---|---|
File not found |
|
FTP Socket Closed |
|
Invalid argument to API |
Bad internal usage of our FTP interface |
Socket timeout while waiting for server response |
|
Unexpected error response from server |
|
Unexpected response to PASS command |
|
Unexpected response to USER command |
|
Unexpected temporary error response from server |
SFTP Errors
|
Error |
Meaning |
|---|---|
|
Error |
Meaning |
A file that isn’t a directory was specified when a directory is required |
|
An attempt was made to modify something on a read-only file system |
|
Bad file descriptor |
|
Broken pipe |
There is no process reading from the other end of a pipe |
Directory not empty, where an empty directory was expected |
Typically, this error occurs when you are trying to delete a directory |
File exists |
An existing file was specified in a context where it only makes sense to specify a new file |
No space left on device |
Write operation on a file failed because the disk is full |
No such device or address |
The system tried to use the device represented by a file you specified, and it couldn’t find the device |
No such file or directory |
|
Permission denied |
|
SSH authentication failed |
|
SSH timeout |
The SSH server closed the connection due to a timeout |
The socket is not connected to anything |
You get this error when you try to transmit data over a socket, without first specifying a destination for the data |
Too many levels of symbolic links were encountered in looking up a file name |
This often indicates a cycle of symbolic links |
Unexpected SSH error |
Something happened during the SSH protocol that we didn't expect |
6. ClustrixDB 备份恢复的更多相关文章
- MySQL 系列(四)主从复制、备份恢复方案生产环境实战
第一篇:MySQL 系列(一) 生产标准线上环境安装配置案例及棘手问题解决 第二篇:MySQL 系列(二) 你不知道的数据库操作 第三篇:MySQL 系列(三)你不知道的 视图.触发器.存储过程.函数 ...
- 基于MySQL MEB的备份恢复
MEB(MySQL Enterprise Backup)是MySQL商业版中提供的备份工具,属于物理备份. 同XtraBackup一样,mysqlbackup的使用过程同样包含如下三个步骤: 备份(- ...
- Xtrabackup原理及使用innobackupex进行MySQL数据库备份恢复
Xtrabackup是由percona提供的mysql数据库备份工具,据官方介绍,这也是世界上惟一一款开源的能够对innodb和xtradb数据库进行热备的工具. Xtrabackup中主要包含两个工 ...
- 在Linux操作系统下备份恢复技术的应用 转自https://yq.aliyun.com/articles/50205?spm=5176.100239.blogcont24250.9.CfBYE9
摘要: 安全防护:在Linux操作系统下备份恢复技术的应用 原文参见:http://linux.chinaunix.net/techdoc/system/2005/12/19/925898.shtm ...
- mongodb 的备份恢复导入与导出
导入导出 use hndb; db.s.save({name:'李四',age:18,score:80,address:'郑州'}); db.s.save({name:'李三',age:8,score ...
- [转]PLSQL Developer备份恢复oracle数据
本文转自:http://www.cnblogs.com/iampkm/archive/2013/06/09/3128273.html 使用PL sql提供的功能可以快速的备份恢复oracle数据. 1 ...
- MongoDB学习(三)数据导入导出及备份恢复
这几天想着公司要用MongoDB,自然就要用到数据导入导出,就自己学习了一下. 在Mongo学习(二)中就讲到了在bin目录下有一些工具,本篇就是使用这些工具进行数据的导入导出及备份恢复. 注意:以下 ...
- Oracle RMAN备份恢复指导书
目 录 1 目的与范围... 1 2 术语和定义... 1 3 角色和职责... 2 4 使用RMAN备份数据库... 2 4.1.1 检查数据库模式... 2 4.1.2 连接到target数据库. ...
- 中小型数据库 RMAN CATALOG 备份恢复方案(二)
中小型数据库呈现的是数据库并发少,数据库容量小,版本功能受限以及N多单实例等特点.尽管如此,数据库的损失程度也会存在零丢失的情形.企业不愿意花太多的钱又要保证数据库的可靠稳定,可是苦煞了我这些搞DB的 ...
随机推荐
- Egret入门学习日记 --- 第五篇(书中 3.5节 内容)
第五篇(书中 3.5节 内容) 今天得把昨天的问题解决了才行. 去了Q群,碰到一位大大,他给我解惑了.Thanks♪(・ω・)ノ 这是我之前按照书上写的方式写的,并没有效果. 然后大大给我解答了: 后 ...
- python学习之数据类型(List)
3.5 列表 3.5.1 列表的介绍 列表是python的基础数据类型之⼀,其他编程语言也有类似的数据类型. 比如JS中的数组, java中的数组等等.它是以[ ]括起来, 每个元素⽤' , '隔 ...
- P4995 跳跳!
喵喵喵好久没做过贪心的题目了,刷一下免得忘了嘤嘤嘤 题面 虽然是黄题,但是我承认并不是很难,so看代码吧还是.. #include<set> #include<map> #in ...
- poj1284(欧拉函数+原根)
题目链接:https://vjudge.net/problem/POJ-1284 题意:给定奇素数p,求x的个数,x为满足{(xi mod p)|1<=i<=p-1}={1,2,...,p ...
- ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.
MySQL版本5.6.35 在一个长度为512字符的字段上创建unique key报错 CREATE DATABASE dpcs_metadata DEFAULT CHARACTER SET utf8 ...
- 死磕并发之CountDownLatch解析
CountDownLatch解析 CountDownLatch是什么 CountDownLatch是基于AQS的阻塞工具,阻塞一个或者多个线程,直到所有的线程都执行完成. CountDownLatch ...
- 【6.12校内test】T1单词序列
[问题描述] 给出两个单词(开始单词和结束单词)以及一个词典.找出从开始单词转换到结束单词, 所需要的最短转换序列.转换的规则如下: 1.每次只能改变一个字母 2.转换过程中出现的单词(除开始单词和结 ...
- 洛谷 P3857 彩灯 题解
题面 对于每一个开关,我们可以看成一个0/1串,初始是一个全部为0的串,要求经过这些开关的操作后,出现的不同的0/1串的个数 建模就是存在一些数,这些数异或起来是0(等价于没有操作).那么需要求一个集 ...
- python-day18(正式学习)
目录 numpy模块 numpy简介 为什么要用numpy 创建numpy数组 numpy数组的基本属性 获取numpy数组的行列数 切割numpy数组 numpy数组元素替换 numpy数组的合并 ...
- Linux的用户与用户组(权限管理)
linux用户与用户.权限管理 用户管理: 1.useradd 创建用户 -c 指定用户描述 -d 指定家目录 默认家目录 /home下同名的目录 -g 指定主组 -G 指定附加组 [注意:一个用户主 ...