DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

kimseng avatar image
kimseng asked ·

Getting "No such file" error copying snapshots for Backup exercise 02.02 in DS210

I am going to Step 3 while I want to restore the detail using sstableloader.

When i copy the snapshots files into the data directory using

sudo sh -c 'cp /var/lib/cassandra/data/killr_video/user_by_email- */snapshots/*/aa-* /var/lib/cassandra/data/killr_video/user_by_email- */'

I have the error by linux command saying

cp: cannot stat '/var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-': No such file or directory

Why is it so and how to rectify that?

ds210
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.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

This specific error:

cannot stat '/var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-'

indicates that you missed the wildcard (*) at the end of aa-* in your copy command.

The full command is:

sudo sh -c 'cp 
  /var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-*
  /var/lib/cassandra/data/killr_video/user_by_email-*/'

Cheers!

4 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 have followed your format.

ubuntu@ds210-node1:~$ sudo sh -c 'cp /var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-* /var/lib/cassandra/data/killr_video/user_by_email-*/'

There is an error as stated:

cp: cannot stat '/var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-*': No such file or directory

Linux still state there is no such file for /var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-*

What is the problem here? Do I miss any steps?

0 Likes 0 ·

That error means that there are no files in the snapshots subdirectories. So you either (a) did not create a snapshot of the table, or (b) there is no data in the table to backup.

Review the previous steps in the exercise and try again. Cheers!

0 Likes 0 ·
kimseng avatar image kimseng Erick Ramirez ♦♦ ·

I believe I know the error already.

The snapshots that is created is ac-21-bits-Compression.db, it is not aa-.

So, Linux will state there is no such file for /var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/aa-*

it should be /var/lib/cassandra/data/killr_video/user_by_email-*/snapshots/*/ac-*

You shoud copy from the directories that have the snapshot file names starting with ac-, and not aa-.

Maybe when DataStax develops the course, they should be aware of these changes. People might just give up if they strictly follow to the letter and are not aware of "Linux command lines".

Anyway, this is a good learning experience in Cassandra and Linux command lines

0 Likes 0 ·
Show more comments