如何使用cassandra-snapshotter进行数据备份?

时间:2015-04-16 14:52:44

标签: amazon-web-services amazon-s3 cassandra

我必须对我的cassandra节点进行数据备份,然后将其上传到amazon AWS s3。当我执行以下命令时,

cassandra-snapshotter --aws-access-key-id=**** --aws-secret-access-key=**** --s3-bucket-name=inblox-exp-buck --s3-bucket-region=ap-southeast-2 --s3-base-path=test1 backup --hosts=52.64.45.152,52.64.28.145 --user=ubuntu

我收到以下错误,

[52.64.45.152] Executing task 'node_start_backup'
[52.64.28.145] Executing task 'node_start_backup'

Fatal error: Needed to prompt for a connection or sudo password (host: 52.64.28.145), but input would be ambiguous in parallel mode

Aborting.
Needed to prompt for a connection or sudo password (host: 52.64.28.145), but input would be ambiguous in parallel mode

Fatal error: Needed to prompt for a connection or sudo password (host: 52.64.45.152), but input would be ambiguous in parallel mode

Aborting.
Needed to prompt for a connection or sudo password (host: 52.64.45.152), but input would be ambiguous in parallel mode

Fatal error: One or more hosts failed while executing task 'node_start_backup'

Aborting.
[52.64.45.152] Executing task 'clear_node_snapshot'
[52.64.28.145] Executing task 'clear_node_snapshot'
[52.64.28.145] sudo: /usr/bin/nodetool clearsnapshot -t "20150416144918"
[52.64.45.152] sudo: /usr/bin/nodetool clearsnapshot -t "20150416144918"

Fatal error: Needed to prompt for a connection or sudo password (host: 52.64.28.145), but input would be ambiguous in parallel mode

Aborting.
Needed to prompt for a connection or sudo password (host: 52.64.28.145), but input would be ambiguous in parallel mode

Fatal error: Needed to prompt for a connection or sudo password (host: 52.64.45.152), but input would be ambiguous in parallel mode

Aborting.
Needed to prompt for a connection or sudo password (host: 52.64.45.152), but input would be ambiguous in parallel mode

Fatal error: One or more hosts failed while executing task 'clear_node_snapshot'

Aborting.
One or more hosts failed while executing task 'clear_node_snapshot'

这里发生了什么?我该如何解决这个问题?

3 个答案:

答案 0 :(得分:1)

Cassandra-snapshotter会对主机执行ssh操作,因此请确保在.ssh / authorized-keys文件中列出了“ubuntu”用户的rsa-pub密钥。 (可选)您可以在代码中关闭ssh选项。

答案 1 :(得分:0)

仅当需要密码才能访问主机时 我发现同样的问题,我也通过传递密码来解决它

寻求帮助:

$cassandra-snapshotter backup -h
你的命令中的

应该像

 cassandra-snapshotter --aws-access-key-id=**** --aws-secret-access-key=**** --s3-bucket-name=inblox-exp-buck --s3-bucket-region=ap-southeast-2 --s3-base-path=test1 backup --hosts=xx.xx.xx.xx,xx.xx.xx.xx --user=ubuntu --password=*****

答案 2 :(得分:0)

我可以备份。

<强>设置

  • 3节点群集
  • 运行备份命令的单独机器
  • 所有都是aws ec2机器。

我使用了以下命令。

cassandra-snapshotter --s3-bucket-name=BUCKET_NAME \
--s3-bucket-region=us-east-1 \
--s3-base-path=CLUSTER_BACKUP \
--aws-access-key-id=KEY \
--aws-secret-access-key=SECRET \
 backup \
--hosts=PUBLIC_IP_1,PUBLIC_IP_2,PUBLIC_IP_3 \
--sshkey=YOUR_PEM_FILE.pem