如何在节点js中的ElasticSearch快照?

环境描述:

  • ElasticSearch:v1.4.3
  • NodeJS:v0.12.7

我想用nodeJs API做一个ElasticSearch集群的快照。 我看API文档,但没有一个例子,所以我甚至不知道如何写它。 我唯一拥有的是语法:

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

你可以看到这里的文档: 这里

我试着去做:

 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) 

有没有人试过这个提示?

谢谢

检查node.js的git页面。 为此logging一个错误。 参考:

https://github.com/elastic/elasticsearch-js/issues/170

https://github.com/elastic/elasticsearch-js/pull/108