从本地主机可见Elasticsearch页面,但从远程服务器看不到

时间:2019-04-25 13:23:49

标签: elasticsearch centos

Elasticsearch 7.0.0的配置类似于CentOS 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

我可以在浏览器上的http://172.16.xx.x:5601上输入Kibana,但我无法输入 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

1 个答案:

答案 0 :(得分:0)

这可以解决问题:

network.host: 0.0.0.0
discovery.seed_hosts: 127.0.0.1