elasticSearch / npm:Elasticdump返回一个"自签名证书"错误

时间:2017-05-24 03:44:42

标签: node.js elasticsearch npm

我能够通过http客户端获取弹性搜索查询的json响应,但是在尝试通过elasticdump时,它会给出错误声明 - 自签名证书。对此有什么可行的解决方案?

###> elasticdump --input "https://<server_ip>/elasticsearch/_cat/indi
ces?v" --output "c:\edmp.log" --type data
Wed, 24 May 2017 03:38:07 GMT | starting dump
Wed, 24 May 2017 03:38:08 GMT | Error Emitted => self signed certificate
Wed, 24 May 2017 03:38:08 GMT | Total Writes: 0
Wed, 24 May 2017 03:38:08 GMT | dump ended with error (get phase) => Error: self
 signed certificate

查询搜索也一样:

###> elasticdump  --input "https://<server_ip>/elasticsearch/_search"
 --output "c:\edmp.log" --searchbody {"query": {"filtered":{"filter":{"bool":{"m
ust":[{"range":{"timestamp":{"gte":"now-5m"}}}]}},"query":{"query_string":{"anal
yze_wildcard":true,"query":"filter:value"}}}},"size":"100","sort":[{"timestamp":{
"order":"desc","unmapped_type":"boolean"}}]} --type data
Wed, 24 May 2017 03:31:14 GMT | starting dump
Wed, 24 May 2017 03:31:15 GMT | Error Emitted => self signed certificate
Wed, 24 May 2017 03:31:15 GMT | Total Writes: 0
Wed, 24 May 2017 03:31:15 GMT | dump ended with error (get phase) => Error: self
 signed certificate

1 个答案:

答案 0 :(得分:1)

编辑:忽略下面,你可以试试这个

NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump --input=.....

我认为你可以将它分叉并为strictSSL false添加request选项。

更具体地说,此文件https://github.com/taskrabbit/elasticsearch-dump/blob/master/lib/transports/elasticsearch.js