Closed thesmart closed 10 years ago
Looks like adding env.use_ssh_config = True
to main.py
did the trick. However, it still doesn't work because the script insists on using a password for sudo:
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915194646 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/"
Aborting.
Fatal error: One or more hosts failed while executing task 'upload_node_backups'
I added the ubuntu user to the sudoers so that it would not require password. This is very common when using with Capistrano.
Hi John, Thank you for reporting about this issue. You are right, the tool does not parse ssh config settings (I am going to add that and release in few hours) and expects the backup user to be in the sudoers group (with no password prompt) I should add that somewhere in the docs
Tommaso
2014-09-15 21:50 GMT+02:00 John Smart notifications@github.com:
Looks like adding env.use_ssh_config = True to main.py did the trick. However, it still doesn't work because the script insists on using a password for sudo:
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915194646 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/"
Aborting.
Fatal error: One or more hosts failed while executing task 'upload_node_backups'
I added the ubuntu user to the sudoers so that it would not require password. This is very common when using with Capistrano.
— Reply to this email directly or view it on GitHub https://github.com/tbarbugli/cassandra_snapshotter/issues/31#issuecomment-55647813 .
this is solved in 0.3.0
Thanks for the submission. The script now executes on the server using the config. However, I'm still getting an error about sudo password:
Fatal error: sudo() received nonzero return code 1 while executing!
Requested: cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/"
Aborting.
Fatal error: One or more hosts failed while executing task 'upload_node_backups'
I have verified that this user is part of the sudo group and that they do not need a password for sudo commands.
do you have more output from the execution? perhaps you can ssh the machine and issue the command yourself
cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/
2014-09-15 22:53 GMT+02:00 John Smart notifications@github.com:
Thanks for the submission. The script now executes on the server using the config. However, I'm still getting an error about sudo password:
Fatal error: sudo() received nonzero return code 1 while executing!
Requested: cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/ Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/"
Aborting.
Fatal error: One or more hosts failed while executing task 'upload_node_backups'
I have verified that this user is part of the sudo group and that they do not need a password for sudo commands.
— Reply to this email directly or view it on GitHub https://github.com/tbarbugli/cassandra_snapshotter/issues/31#issuecomment-55656995 .
$ sudo cassandra-snapshotter-agent create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20140915205230 --snapshot_keyspaces= --snapshot_table= --data_path=/var/lib/cassandra/data/
Traceback (most recent call last):
File "/usr/local/bin/cassandra-snapshotter-agent", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2872, in <module>
working_set = WorkingSet._build_master()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 449, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 745, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: ecdsa
hmm, maybe an issue with my python packages...
that seems indeed something broken with pip / install packages; perhaps you can get away by updating pip and re install cassandra_snapshotter
2014-09-15 23:03 GMT+02:00 John Smart notifications@github.com:
ecdsa
Ok, looks like Paramiko was failing to install properly on Ubuntu because it would not compile properly without python-dev. I had to run:
sudo pip uninstall paramiko
sudo apt-get install python-dev
sudo pip install paramiko
Thanks a lot for your help!
Hi John,
Thank you for reporting this problem; I think I will add a verify install command at some point, it seems like lot can go wrong with python and fabric installs.
Tommaso
2014-09-15 23:23 GMT+02:00 John Smart notifications@github.com:
Ok, looks like Paramiko was failing to install properly on Ubuntu because it would not compile properly without python-dev. I had to run:
sudo pip uninstall paramiko sudo apt-get install python-dev sudo pip install paramiko
— Reply to this email directly or view it on GitHub https://github.com/tbarbugli/cassandra_snapshotter/issues/31#issuecomment-55661166 .
Does this script support use of SSH config files? It doesn't seem to work for me. I have a host, user, port, and IdentityFile defined in my
~/.ssh/config
file, but the script still says:I have verified that no password is required for SSH nor sudo once logged in. Here's the config: