2

我试图重新安装 Cassandra,现在数据丢失了!我发现 SSTables 仍然存在并且占用了大量磁盘空间。

我做了什么

sudo apt-get --purge remove cassandra
sudo apt-get install dsc20

如何将数据返回到 cassandra。

4

1 回答 1

2

This is kind of hacky (the tool isn't being used as intended) but you could use sstable2json to export the data from the old sstables into json, and then re-import it back to your new C* install. To do this you must:

  1. Export the data from the old sstables using sstable2json
  2. Re-create the CF that you previously had (same structure)
  3. Flush the newly created identical cf (./nodetool flush)
  4. Stop cassandra
  5. Import the json you exported previously into the newly created sstables using json2sstable.

This is hacky because json2sstable and sstable2json are debug tools rather than export/import tools.

于 2013-10-11T23:11:58.480 回答