amorton / cassback

Backup tool for Apache Cassandra based on https://github.com/synack/tablesnap
BSD 3-Clause "New" or "Revised" License
22 stars 13 forks source link

Error when backing up to S3 #2

Open ameyb opened 11 years ago

ameyb commented 11 years ago

OSError: [Errno 18] Invalid cross-device link

Installed cassback according to the instructions. When I am running the backup command -

cassback --endpoint s3 --aws-key xx --aws-secret xx --bucket-name cassandra-backup backup --include-system --cassandra_data_dir=/mnt/cassandra/data/

I get the following error. Let me know if this can be fixed.

Error: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/cassback-0.1.1-py2.7.egg/cassback/scripts.py", line 126, in cassback_main rv, out = sub_command() File "/usr/local/lib/python2.7/dist-packages/cassback-0.1.1-py2.7.egg/cassback/subcommands/backup_subcommand.py", line 119, in call watcher.start() File "/usr/local/lib/python2.7/dist-packages/cassback-0.1.1-py2.7.egg/cassback/subcommands/backup_subcommand.py", line 254, in start enqueue=not(self.ignore_existing)) File "/usr/local/lib/python2.7/dist-packages/cassback-0.1.1-py2.7.egg/cassback/subcommands/backup_subcommand.py", line 286, in _maybe_queue_file with file_util.FileReferenceContext(file_path) as file_ref: File "/usr/local/lib/python2.7/dist-packages/cassback-0.1.1-py2.7.egg/cassback/file_util.py", line 142, in enter os.link(self._source_path, stable_path) OSError: [Errno 18] Invalid cross-device link

Thanks, Amey

echoajohnson commented 10 years ago

The problem is most likely that the systems tmp directory is on a different partition than the cassandra data directory.

The workaround I used was to set the tmp directory to be on the same partition within the context of the cassback run.

For example:

export TMPDIR=/data/cassback/tmp

The python function will honor that setting.

I do not recommend setting that as a global so create a small wrapper script that will set it as needed on each run.