'cassandra Backup from one node to another node

I'm new to cassandra and gremlin.i am using gremlin to enter and retrive the data from cassandra .i want to take a bakup and restore it on new node.i took a snapshot using nodetool.please help me with some links or documents



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1