Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

igor.rmarinho_185445 avatar image
igor.rmarinho_185445 asked bettina.swynnerton answered

How do I automate nodetool import?

Hi,

I'm using nodetool import after restoreing my backup using this doc.

https://docs.datastax.com/en/upgrade/doc/upgrade/datastax_enterprise/upgrdRollbackDSEPackages.html

I'm running

nodetool import system_auth role_members /media/cassandra/data/system_auth/role_members-0ecdaa87f8fb3e6088d174fb36fe5c0or

But I'd like to automate it. You guys has a shell script reference for it? Or a better way to do it.

Thank you.

cassandranodetool
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered

I am sorry that we managed to confuse you.

Restoring by copying sstables directly into the data directories is only applicable in very narrow cases, as in restoring from a local node, so in the general sense it is not the correct method.

https://docs.datastax.com/en/dse/6.8/dse-admin/datastax_enterprise/operations/opsBackupSnapshotRestore.html#Restoringfromlocalnodes

and yes, nodetool refresh is deprecated as of DSE 6.8, use nodetool import instead, but it requires the additional directory parameter.

I have passed this on to the docs team, as the above document still references nodetool refresh

Thanks for the feedback.

3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi Bettina,

So just to make sure understand, for all restore mothods I'll need to retsore table by table? Since Sstableloader and nodetool import does not offer a more autmatic way to restore my data.

0 Likes 0 ·

yes, this is correct.

There are tools for backups and restores, such as OpsCenter for DSE or Medusa for Cassandra, which make this a lot easier. I'll post you some links here, hope they will be helpful:

https://docs.datastax.com/en/opscenter/6.8/opsc/online_help/services/opscBackupService.html

https://thelastpickle.com/blog/2019/11/05/cassandra-medusa-backup-tool-is-open-source.html

1 Like 1 ·
navjyotnishant avatar image navjyotnishant bettina.swynnerton ♦♦ ·

Good to know about medusa. Another nice tool i am aaware of with GUI & orchestration but "paid" is - https://www.rubrik.com/en/solutions/cassandra

0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez converted comment to answer

The quick answer is no, there isn't a shell script for it.

I have to admit that I'm struggling to understand what your requirements are since I don't know what there is to automate.

Also in case you weren't aware the import command is new in Cassandra 4.0 and only available in DSE 6.8.0+. Cheers!

3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I’m try to automate my full backup restore. I’m using nodetool import to load my keyspaces/tables, but doing one by one don’t seems to be logical.

0 Likes 0 ·

Using nodetool import isn't a valid way of performing restores.

As we've pointed out in question #5943, the way you're restoring data is invalid. You need to follow the recommended procedures or you'll keep running into issues which you'll keep asking us about and the answer will be the same. Cheers!

0 Likes 0 ·

Well in this case your colleague suggested sstablleloader and nodetool retesh (which doesn’t work in 6.8). Nodetool import does the same thing and it work as restore since mine is working... So I’m not sure if I understand your point.

0 Likes 0 ·