首页  

aerospike备份恢复测试     所属分类 aerospike 浏览量 1277
使用aql   insert 数据
 
INSERT INTO ns1.backup1 (PK,DATA) VALUES ('a','a');
INSERT INTO ns1.backup1 (PK,DATA) VALUES ('b','b');
INSERT INTO ns1.backup1 (PK,DATA) VALUES ('c','c');
INSERT INTO ns1.backup1(PK,DATA) VALUES ('d','d');
 
INSERT INTO ns1.backup2 (PK,DATA) VALUES ('a','a');
INSERT INTO ns1.backup2 (PK,DATA) VALUES ('b','b');
INSERT INTO ns1.backup2 (PK,DATA) VALUES ('c','c');
INSERT INTO ns1.backup2(PK,DATA) VALUES ('d','d');
INSERT INTO ns1.backup2 (PK,DATA) VALUES ('e','e');
INSERT INTO ns1.backup2(PK,DATA) VALUES ('f','f');
 
show sets ,可以查看各个节点上的记录数   

记录数太少,看起来不均衡

------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
 
| disable-eviction | ns    | set-enable-xdr | objects | stop-writes-count | set         | memory_data_bytes | truncate_lut   | tombstones |
 
+------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
| "false"          | "ns1" | "use-default"  | "3"     | "0"               | "backup1"   | "60"              | "299064402438" | "0"        |
 
| "false"          | "ns1" | "use-default"  | "4"     | "0"               | "backup2"   | "80"              | "299064602937" | "0"        |
 
+------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
 
[127.0.0.1:3000] 3 rows in set (0.001 secs)
 
 
+------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
 
| disable-eviction | ns    | set-enable-xdr | objects | stop-writes-count | set         | memory_data_bytes | truncate_lut   | tombstones |
 
+------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
| "false"          | "ns1" | "use-default"  | "2"     | "0"               | "backup2"   | "40"              | "299064602937" | "0"        |
 
| "false"          | "ns1" | "use-default"  | "1"     | "0"               | "backup1"   | "20"              | "299064402438" | "0"        |
 
+------------------+-------+----------------+---------+-------------------+-------------+-------------------+----------------+------------+
 
[192.168.0.11:3000] 7 rows in set (0.002 secs)
查看数据  

select * from ns1.backup1
select * from ns1.backup2

设置 显示元数据信息
set  RECORD_PRINT_METADATA true

select * from ns1.backup1
+------+--------------------------------+-----------+---------+-------+
 
| DATA | {edigest}                      | {set}     | {ttl}   | {gen} |
 
+------+--------------------------------+-----------+---------+-------+
 
| "c"  | "sSJgnpnFHTz3Ki84gn8FolWKwhw=" | "backup1" | 7774309 | 1     |
 
| "a"  | "TiUUhdn4W0ilDB5xVSHomcQwKVE=" | "backup1" | 7774215 | 1     |
 
| "b"  | "iLmCvDRzDMtEcaF383EHTN47BLY=" | "backup1" | 7774220 | 1     |
 
| "d"  | "yLPWqvjPXd27vgvsfxferGoClmk=" | "backup1" | 7774314 | 1     |
 
+------+--------------------------------+-----------+---------+-------+
 
4 rows in set (0.032 secs)
 

备份数据
asbackup --host 192.168.0.10 --no-udfs --namespace ns1 -s backup1 --output-file  /home/dyyx/asbackup/backup1.asb
asbackup --host 192.168.0.10 --no-udfs --namespace ns1 -s backup2 --output-file  /home/dyyx/asbackup/backup2.asb
# 不支持 -s backup1,backup2
asbackup --host 192.168.0.10 --no-udfs --namespace ns1 -s backup1,backup2 --output-file  /home/dyyx/asbackup/backup12.asb
 

恢复数据
 
恢复数据前先删除数据
truncate ns1.backup1
truncate ns1.backup2

asrestore --host 192.168.0.10  --input-file  /home/dyyx/asbackup/backup1.asb
asrestore --host 192.168.0.10  --input-file  /home/dyyx/asbackup/backup2.asb

上一篇     下一篇
mysql5.7.26安装

centos7防火墙配置

mysql5.7 JSON 数据类型测试

springboot2.0项目pom首行报错问题解决

漫步华尔街经典语录

《华尔街:金钱永不眠》经典台词