首页 > 解决方案 > 在 scylladb 中备份一个键空间

问题描述

我正在尝试将我的数据备份到scylladb. 目前,我的 Scylla 在 docker 中。

所以我正在运行这个命令:

docker exec -it saif-scylla nodetool snapshot testkeyspace

Requested creating snapshot(s) for [testkeyspace] with snapshot name [1564405495089] Snapshot directory: 1564405495089

/var/lib/scylla/data但我在文件夹中找不到任何备份。

还有“请求”的确切含义。

此外,当我通过运行命令列出快照时:

docker exec -it saif-scylla nodetool listsnapshots

我能看到的是:

Snapshot name       Keyspace name                Column family name           True size          Size on disk
1564405495089       testkeyspace                 new_events                   0 bytes            0 bytes
1564405495089       testkeyspace                 new_pings                    0 bytes            0 bytes
1564405495089       testkeyspace                 test_pings                   0 bytes            0 bytes

我不明白这里发生了什么问题。

任何想法,我做错了什么?

任何帮助都会有所帮助。

谢谢

标签: apachecassandradatabase-backupsdatabase-restorescylla

解决方案


快照文件位于“快照”下的表目录中。例如,对于 keyspace mykeyspace 和 table heartrate_ttl,运行后nodetool snapshot mykeyspace;

ls -l /var/lib/scylla/data/mykeyspace/heartrate_ttl-75359ce0b22611e9b18b000000000000/snapshots/1564421433190/
total 44
-rw-r--r--. 2 root root   66 Jul 29 17:30 la-4-big-CompressionInfo.db
-rw-r--r--. 2 root root  189 Jul 29 17:30 la-4-big-Data.db
-rw-r--r--. 2 root root   10 Jul 29 17:30 la-4-big-Digest.sha1
-rw-r--r--. 2 root root   16 Jul 29 17:30 la-4-big-Filter.db
-rw-r--r--. 2 root root   30 Jul 29 17:30 la-4-big-Index.db
-rw-r--r--. 2 root root   54 Jul 29 17:30 la-4-big-Scylla.db
-rw-r--r--. 2 root root 4466 Jul 29 17:30 la-4-big-Statistics.db
-rw-r--r--. 2 root root   92 Jul 29 17:30 la-4-big-Summary.db
-rw-r--r--. 2 root root  101 Jul 29 17:30 la-4-big-TOC.txt
-rw-r--r--. 1 root root   38 Jul 29 17:30 manifest.json

nodetool listsnapshots 应该给你快照大小

nodetool listsnapshots
Snapshot Details: 
Snapshot name Keyspace name Column family name True size Size on disk
1564421433190 mykeyspace    heartrate_ttl      0 bytes   4.91 KB   

我在上面的例子中使用了 Scylla 3.0.5 Docker。

会不会是这些表中没有数据?


推荐阅读