Elasticsearch页面可从localhost显示,但不能从远程服务器显示

问题描述 投票:0回答:1

Elasticsearch 7.0.0CentOS 7.6上配置如下:

sudo cat /etc/elasticsearch/elasticsearch.yml

cluster.name: elk-log-elasticsearch
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
http.port: 9200

从服务器内部:curl --verbose http://127.0.0.1:9200

< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 525
<
{
  "name" : "Cardif.software.altkom.pl",
  "cluster_name" : "elk-log-elasticsearch",
  "cluster_uuid" : "rTMG9hXBTk-CuA73G9KHSA",
  "version" : {
    "number" : "7.0.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "b7e28a7",
    "build_date" : "2019-04-05T22:55:32.697037Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.7.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

从服务器外部(命名为'A'),在服务器'B'上我可以ping服务器'A':我知道它的IP是这样的:172.16.xx.x

我可以在浏览器中输入Kibana:http://172.16.xx.x:5601,但我无法在http://172.16.xx.x:9200上输入Elasticsearch页面

如何更改配置以使其工作?

在firewalld中启用端口:

firewall-cmd --list-all

  ports: 5432/tcp 80/tcp 5601/tcp 5602/tcp 9200/tcp 9201/tcp 15672/tcp 8080/tcp 8081/tcp 8082/tcp 5488/tcp

我试过了:1)

  network.host : 0.0.0.0

2)

network.bind_host: 172.x.x.x
elasticsearch centos
1个回答
0
投票

这样做的诀窍:

network.host: 0.0.0.0
discovery.seed_hosts: 127.0.0.1
© www.soinside.com 2019 - 2024. All rights reserved.