简体   繁体   English

LAN上的Elasticsearch未连接

[英]Elasticsearch on LAN not connecting

I have an elasticsearch running on a server (ubuntu) hosted on a local machine in our network. 我在我们网络中的本地计算机上托管的服务器(ubuntu)上运行了elasticsearch。 We have used it for testing and want to connect from local computers. 我们已将其用于测试,并希望通过本地计算机进行连接。 The machines lan ip is 192.168.1.100. 机器lan ip是192.168.1.100。 My ip is 192.168.1.54. 我的IP是192.168.1.54。 It is running when I do 当我这样做时它正在运行

curl -X GET 'http://localhost:9200'
{
  "name" : "node-1",
  "cluster_name" : "norrath",
  "cluster_uuid" : "0EqCQH1ZTSGzOOdq_Sf7EQ",
  "version" : {
    "number" : "6.2.1",
    "build_hash" : "7299dc3",
    "build_date" : "2018-02-07T19:34:26.990113Z",
    "build_snapshot" : false,
    "lucene_version" : "7.2.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

When I try from my machine.. 当我从机器尝试时..

curl 'http://192.168.1.100:9200'
curl: (7) Failed to connect to 192.168.1.100 port 9200: Connection refused

First thing I did was follow digital oceans instructions and changed 我要做的第一件事是按照数字海洋的指示进行更改

network.host: 0.0.0.0

Using netstat -atun 使用netstat -atun

tcp6       0      0 :::9200                 :::*                    LISTEN
tcp6       0      0 :::9300                 :::*                    LISTEN

UFW status UFW状态

sudo ufw status
Status: inactive

I have tried multiple config file changes.. 我尝试了多个配置文件更改。

#http.cors.enabled: true
#http.cors.allow-origin: "/.*/"
#transport.host: 0.0.0.0
#transport.tcp.port: 9300
#http.port: 9200
network.host:  0.0.0.0
#network.bind_host: 0.0.0.0
#network.publish_host: 0.0.0.0
systemctl restart elasticsearch

Still not able to connect over lan. 仍然无法通过局域网连接。

After examining my netstat output, I realized it is listening for tcp6 requests but not ipv4. 检查我的netstat输出后,我意识到它正在侦听tcp6请求,而不是ipv4。 Changing my curl request to the inet6 address, and setting up tcp/udp rather than tcp only fixed our issue. 将我的curl请求更改为inet6地址,并设置tcp / udp而不是tcp只能解决我们的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM