无法将数据发布到远程Elasticsearch服务器

时间:2019-04-25 12:51:44

标签: elasticsearch post

当我从浏览器访问:9200时,我已经设置好我的elasticsearch运行正常。我可以将数据放入ssh并在命令中运行波纹管后将其发布到elasticsearch中

curl -X POST -H "Content-Type: application/json" 'http://localhost:9200/tutorial/helloworld/1' -d '{ "message": "Hello World!" }'

它返回了

{"_index":"tutorial","_type":"helloworld","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}

但是我试图使用

在另一台服务器上做同样的事情
curl -X POST -H "Content-Type: application/json" 'http://x.x.x.x:9200/tutorial/helloworld/1' -d '{ "message": "Hello World!" }'

那我会得到

curl: (7) Failed to connect to 139.59.160.246 port 9200: Connection timed out

它不起作用。我无法从浏览器访问elasticsearch,所以我很确定9200端口对世界是开放的

有人有同样的问题,知道如何解决吗?

0 个答案:

没有答案
相关问题