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 |
---|---|
|
Something is wrong with the BACKUP statement, please double check |
|
Trying to backup something that cannot be backed-up, or doesn't exist |
|
Trying to backup something currently unavailable |
|
Unable to parse URL or connect to FTP server |
|
There is already a backup at that location |
|
File written to backup was shorter than it should have been |
|
Would backup nothing |
|
Object is excluded more than once |
Restore
Error |
Meaning |
---|---|
|
Something is wrong with the RESTORE statement |
|
Unable to parse URL or connect to FTP server |
|
Cannot open backup directory on FTP server |
|
This backup did not complete successfully |
|
Trying to restore something that is not in the backup |
|
|
|
Cannot create object |
|
Created object does not match backed-up object |
|
|
|
Backup is corrupt |
|
Read too little data for a row |
|
Object is excluded more than once |
|
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 buffering error |
|
FTP Errors
Error |
Meaning |
---|---|
|
|
|
|
|
Bad internal usage of our FTP interface |
|
|
|
|
|
|
|
|
|
SFTP Errors
Error |
Meaning |
---|---|
Error |
Meaning |
|
|
|
|
|
|
|
There is no process reading from the other end of a pipe |
|
Typically, this error occurs when you are trying to delete a directory |
|
An existing file was specified in a context where it only makes sense to specify a new file |
|
Write operation on a file failed because the disk is full |
|
The system tried to use the device represented by a file you specified, and it couldn’t find the device |
|
|
|
|
|
|
|
The SSH server closed the connection due to a timeout |
|
You get this error when you try to transmit data over a socket, without first specifying a destination for the data |
|
This often indicates a cycle of symbolic links |
|
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的 ...
随机推荐
- http 协议里的 200、301、302、401、403、405、500 分别代表什么?
http 协议里的 200.301.302.401.403.405.500 分别代表什么? 详细描述: 打开某些网页时,无法正常打开,出现 200.301.302.401.403.405.500 这此 ...
- Nmap 在 WSL 中工作不正常
Problem binding to interface , errno: 92 socket_bindtodevice: Protocol not available Problem binding ...
- 洛谷 P1197 星球大战 题解
题面 并查集处理问题的基本思路:如果不是强制在线那么可以倒着处理,把删边改为可爱的加边,然后使用并查集来判断是否联通: 所以可以较为轻松的写出AC代码: #include <bits/stdc+ ...
- 洛谷 P3388 割点(割顶) 题解
题面: 割点性质: 节点 u 如果是割点,当且仅当存在 u 的一个子树,子树中没有连向 u 的祖先的边(返祖边). 换句话说,如果对于一个点u,它的子节点是v,如果low[v] ...
- [LeetCode] 227. 基本计算器 II
题目链接: https://leetcode-cn.com/problems/basic-calculator-ii 难度:中等 通过率:33.2% 题目描述: 实现一个基本的计算器来计算一个简单的字 ...
- mysql(中)
mysql(中) 一.数据库配置 1.登录mysql 2.在mysql安装目录下:创建my.ini(my.cnf) 3.设置配置信息并保存 ''' [mysqld] character-set-ser ...
- L2-001. 紧急救援(迪杰斯特拉算法)
L2-001. 紧急救援 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国 ...
- 查看ftp创建的用户
先su然后查看cat /etc/passwd,500以后的是添加的使用者账户.
- Win7 MongoDB可视化工具Robo 3T 1.2.1(robomongo)的安装使用
软件版本: Robo 3T 1.2.1 下载网址: https://robomongo.org/campaign 进入robomongo官网,点击download,进入下载页面 这里选择下载 Robo ...
- vue.js(2)--v-cloak v-text v-html
v-cloak v-text v-html的使用 (1)实例 <!DOCTYPE html> <html lang="en"> <head> ...