简体   繁体   中英

cassandra Backup from one node to another node

我是 cassandra 和 gremlin 的新手。我正在使用 gremlin 从 cassandra 输入和检索数据。我想进行备份并在新节点上恢复它。我使用 nodetool 拍摄了快照。请帮助我提供一些链接或文档

I used the secound approach of this post : How do I replicate a Cassandra's local node for other Cassandra's remote node?

If structure of the tables is the same, you could create two bash's scripts like below:

1. Export the data using these commands:

nodetool flush <your-keyspace-name>
nodetool cleanup <your-keyspace-name>
nodetool -h localhost -p 7199 snapshot <your-keyspace-name>
zip -r /tmp/bkp.zip /var/lib/cassandra/data/<your-keyspace-name>/
sshpass -p <password> scp -v /tmp/bkp.zip root@<ip>:/tmp

2. Import the data:

unzip /tmp/bkp.zip
nodetool cleanup <your-keyspace-name>
cd /var/lib/cassandra/data/<your-keyspace-name>/ && find /var/lib/cassandra/data/<your-keyspace-name>/ -maxdepth 5 -type d -exec sstableloader -v --nodes 127.0.0.1 {} \;

If you note some slow process, please check this another post: Cassandra's sstableloader too slow in import data

Important: You should adapt this informaction to your reallity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM