系统centos
127.0.0.1:9200
{
"name" : "zSZoiQ9",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "bowIxvOVR8OrrCZ3PDVumg",
"version" : {
"number" : "6.3.2",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "053779d",
"build_date" : "2018-07-20T05:20:23.451332Z",
"build_snapshot" : false,
"lucene_version" : "7.3.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
通过主机id访问被拒绝
无法访问此网站 192.168.130.105 拒绝了我们的连接请求。
修改为任意主机都可访问
修改 config 下 elasticsearch.yml 配置
network.host: 0.0.0.0
重新访问 ok 啦
{
"name" : "zSZoiQ9",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "bowIxvOVR8OrrCZ3PDVumg",
"version" : {
"number" : "6.3.2",
"build_flavor" : "default",
"build_type" : "zip",
"build_hash" : "053779d",
"build_date" : "2018-07-20T05:20:23.451332Z",
"build_snapshot" : false,
"lucene_version" : "7.3.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
设置为多个主机地址 可访问
network.bind_host: ["yourhost", "localhost"]
参考地址
https://stackoverflow.com/questions/20222093/elasticsearch-listen-to-multiple-ips