Elasticsearch curl:(7)无法连接到主机

编程入门 行业动态 更新时间:2024-10-27 06:33:48
本文介绍了Elasticsearch curl:(7)无法连接到主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试用mongodb进行弹性搜索。

我已经按照步骤从 satishgandham/2012/09/a-complete-guide-to-integrating- mongodb-with-elastic-search /

但是当我尝试通过

设置索引时

curl -XPUT'http:// localhost:9200 / _river / mongodb / _meta'-d' {type:mongodb,mongodb:{db:smmc-dart,collection:smmc_collectionDetails},index:{ name:caseName,type:string} }'

我收到错误

curl:(7)无法连接到主机

当我尝试 http:// localhost:9200 / 在我的浏览器上显示

{status:200,name Nicholas Scratch,version:{number:1.1.0,build_hash:2181e113dea80b4a9e31e58e9686658a2d46e363,build_timestamp: -03-25T15:59:51Z,build_snapshot:false,lucene_version:4.7},tagline搜索}

我也在终端试过了

curl -XGET 10.20.4.220:9200/

结果

curl:(7)无法连接到主机

为什么会发生这种情况,以及如何修复它。

解决方案

在我的Mac OS X,我使用 127.0.0.1:9200 / 而不是 http: 9200 / 因为我有同样的问题。

我认为当你使用命令终端替换localhost它的IPv6地址,我不知道curl支持。

请检查并通知我。

I was trying out elastic search with mongodb.

I have followed steps from satishgandham/2012/09/a-complete-guide-to-integrating-mongodb-with-elastic-search/

But when I try to set index by

curl -XPUT 'localhost:9200/_river/mongodb/_meta' -d ' { "type": "mongodb", "mongodb": { "db": "smmc-dart", "collection": "smmc_collectionDetails" }, "index": { "name": "caseName", "type": "string" } }'

I'm getting error

curl: (7) couldn't connect to host

When I tried localhost:9200/ on my browser it shows

{ "status" : 200, "name" : "Nicholas Scratch", "version" : { "number" : "1.1.0", "build_hash" : "2181e113dea80b4a9e31e58e9686658a2d46e363", "build_timestamp" : "2014-03-25T15:59:51Z", "build_snapshot" : false, "lucene_version" : "4.7" }, "tagline" : "You Know, for Search" }

I also tried this in terminal

curl -XGET 10.20.4.220:9200/

It resulted

curl: (7) couldn't connect to host

Why is this happening and how to fix it.

解决方案

On my Mac OS X, I use 127.0.0.1:9200/ instead of localhost:9200/ cause I had the same problem.

I think that when you use the command the terminal replaces the localhost by it's IPv6 address and I'm not sure that curl supports that.

Please check and let me know.

更多推荐

Elasticsearch curl:(7)无法连接到主机

本文发布于:2023-06-05 01:11:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/508793.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   主机   Elasticsearch   curl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!