2015-11-04 87 views
1

環境描述:如何在Node js中使用ElasticSearch快照?

  • ElasticSearch:1.4.3
  • 的NodeJS:v0.12.7

我願做ElasticSearch集羣的快照與API的NodeJS。 我看了API文檔,但沒有一個例子,所以我甚至不知道如何編寫它。我唯一的事情是語法:

client.snapshot.create([params, [callback]]) 

您可以在這裏看到的文檔:Here

我試圖做到這一點的:

client.snapshot.create({"waitForCompletion":true, "snapshot":"snapshot_4", "repository":"my_backup"}); 

但它給我這個錯誤:

Unhandled rejection Error: InvalidIndexNameException[[_snapshot] Invalid index name [_snapshot], must not start with '_'] 
at respond (D:\Users\ermaro\Documents\SG\kyc\trunk\kyc\node_modules\elasticsearch\src\lib\transport.js:256:15) 
at checkRespForFailure (D:\Users\ermaro\Documents\SG\kyc\trunk\kyc\node_modules\elasticsearch\src\lib\transport.js:219:7) 
at HttpConnector.<anonymous> (D:\Users\ermaro\Documents\SG\kyc\trunk\kyc\node_modules\elasticsearch\src\lib\connectors\http.js:155:7) 
at IncomingMessage.wrapper (D:\Users\ermaro\Documents\SG\kyc\trunk\kyc\node_modules\lodash\index.js:3095:19) 
at IncomingMessage.emit (events.js:129:20) 
at _stream_readable.js:908:16 
at process._tickCallback (node.js:355:11) 

有沒有人試過這個並給出提示?

謝謝

+0

嘿..如果滿意。請接受答案 – piyushGoyal

回答