簡體   English   中英

如何使用cassandra-snapshotter進行數據備份?

[英]How to take data backup using cassandra-snapshotter?

我必須對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'

這是怎么回事 我該如何解決這個問題?

Cassandra-snapshotter確實會向主機SSH,因此請確保在.ssh / authorized-keys文件中列出了“ ubuntu”用戶的rsa-pub密鑰。 (可選)您可以在代碼中關閉ssh選項。

僅當需要密碼才能訪問主機時,我才發現同樣的問題,我也通過傳遞密碼來解決了該問題。

求助:

$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=*****

我可以備份。

設定

  • 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM