apache cassandra restore
2 min readJan 17, 2025
cqlsh:catalogkeyspace> select * from magazine ;
id | name | publisher
----+---------------------------+------------------
1 | Couchbase Magazine | Couchbase
0 | Apache Cassandra Magazine | Apache Cassandra
(2 rows)
cqlsh:catalogkeyspace>
cqlsh:catalogkeyspace>
cqlsh:catalogkeyspace> truncate table magazine ;
cqlsh:catalogkeyspace>
cqlsh:catalogkeyspace>select * from magazine ;
id | name | publisher
----+---------------------------+------------------
RESTORE
sstableloader -d <ip-adres > - k <keyspace_adi> <backupdizini>
root@d9bedc3c7406:/opt/cassandra/data/data/catalogkeyspace# sstableloader -d 172.17.0.2 -k catalogkeyspace /opt/cassandra/data/data/catalogkeyspace/magazine-3a2b1220d38f11efa712d97537d7bc0b/backups
Established connection to initial hosts
Opening sstables and calculating sections to stream
Streaming relevant part of /var/lib/cassandra/data/catalogkeyspace/magazine-3a2b1220d38f11efa712d97537d7bc0b/backups/nb-1-big-Data.db to [/172.17.0.2:7000]
progress: [/172.17.0.2:7000]0:1/5 95 % total: 95% 1.811KiB/s (avg: 1.811KiB/s)
progress: [/172.17.0.2:7000]0:2/5 96 % total: 96% 12.845KiB/s (avg: 1.816KiB/s)
progress: [/172.17.0.2:7000]0:3/5 97 % total: 97% 348.063KiB/s (avg: 1.852KiB/s)
progress: [/172.17.0.2:7000]0:4/5 99 % total: 99% 99.704KiB/s (avg: 1.873KiB/s)
progress: [/172.17.0.2:7000]0:5/5 100% total: 100% 138.806KiB/s (avg: 1.890KiB/s)
progress: [/172.17.0.2:7000]0:5/5 100% total: 100% 0.000B/s (avg: 1.864KiB/s)
Summary statistics:
Connections per host : 1
Total files transferred : 5
Total bytes transferred : 4.946KiB
Total duration : 2655 ms
Average transfer rate : 1.863KiB/s
Peak transfer rate : 1.890KiB/s
root@d9bedc3c7406:/opt/cassandra/data/data/catalogkeyspace#
root@d9bedc3c7406:/opt/cassandra/data/data/catalogkeyspace# cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.2.0 | Cassandra 5.0.2 | CQL spec 3.4.7 | Native protocol v5]
Use HELP for help.
cqlsh>
cqlsh> use catalogkeyspace ;
cqlsh:catalogkeyspace> select * from magazine ;
id | name | publisher
----+---------------------------+------------------
1 | Couchbase Magazine | Couchbase
0 | Apache Cassandra Magazine | Apache Cassandra
(2 rows)
cqlsh:catalogkeyspace>