ElasticSearch and Kibana installed successfully, but cannot be accessed by web browser

Below is the setting from kibana.yml:
server.port: 5601
server.host: namenode2
elasticsearch.url: "http://namenode2:9200"

Below is the setting from elasticsearch.yml:
cluster.name: es-prod
node.name: master-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: ["namenode2", local]

When I tried vi /etc/hosts, I get:
172.15.7.169 namenode2

But when I typed http://172.15.7.169:5601, I get the following error message:

This site can’t be reached

172.15.7.169 refused to connect

Actually, it can be seen from the following results:
root@namenode2: /etc/elasticsearch> curl -X GET 'http://localhost:5601' -v

  • About to connect() to localhost port 5601 (#0)
  • Trying ::1...
  • Connection refused
  • Trying 127.0.0.1...
  • Connected to localhost (127.0.0.1) port 5601 (#0)
    *> GET / HTTP/1.1
    *> User-Agent: curl/7.29.0
    *> Host: localhost:5601
    *> Accept: /
    *>
    *< HTTP/1.1 302 Found
    *< location: /spaces/enter
    *< kbn-name: namenode2
    *< kbn-license-sig: *b9c6f9f9a3160f5ca28c2b723dfa02f5cc0901042cf3f9868f1f5ea0f48eb3a1
    *< kbn-xpack-sig: a01841de727f78f70d3c61089bd6feac
    *< cache-control: no-cache
    *< content-length: 0
    *< Date: Thu, 20 Feb 2020 00:46:38 GMT
    *< Connection: keep-alive
    *<
  • Connection #0 to host localhost left intact

root@namenode2: /etc/elasticsearch> curl -X GET 'http://localhost:9200' -v

  • About to connect() to localhost port 9200 (#0)
  • Trying ::1...
  • Connected to localhost (::1) port 9200 (#0)

GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:9200
Accept: /

< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 534
<
{
"name" : "namenode2",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "fKBvGU5HTmeBkh40Z3Umgg",
"version" : {
"number" : "7.6.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
"build_date" : "2020-02-06T00:09:00.449973Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

  • Connection #0 to host localhost left intact

However, if I changed "localhost" to "172.15.7.169", I get:
root@namenode2: /etc/elasticsearch> curl -X GET 'http://172.15.7.169:9200' -v

  • About to connect() to 172.15.7.169 port 9200 (#0)
  • Trying 172.15.7.169...
  • Connection refused
  • Failed connect to 172.15.7.169:9200; Connection refused
  • Closing connection 0
    curl: (7) Failed connect to 172.15.7.169:9200; Connection refused

root@namenode2: /etc/elasticsearch> curl -X GET 'http://172.15.7.169:5601' -v

  • About to connect() to 172.15.7.169 port 5601 (#0)
  • Trying 172.15.7.169...
  • Connection refused
  • Failed connect to 172.15.7.169:5601; Connection refused
  • Closing connection 0
    curl: (7) Failed connect to 172.15.7.169:5601; Connection refused

What is wrong with my setting?

by default, Elasticsearch only listens on localhost. Has this been changed in your YAML configuration?

Yes, you can see from the above, I modified it, but still not working.

I made some changes, so the master node can work, but data node cannot work. And kibana web browser can run.

Here is the configuration file for the data node:

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

cluster.name: es-prod

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

node.name: data-1

Add custom attributes to the node:

#node.attr.rack: r1

----------------------------------- Paths ------------------------------------

Path to directory where to store the data (separate multiple locations by comma):

path.data: /var/lib/elasticsearch

Path to log files:

path.logs: /var/log/elasticsearch

----------------------------------- Memory -----------------------^X------------

Lock the memory on startup:

#bootstrap.memory_lock: true

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: ["172.15.7.184", local]

Set a custom port for HTTP:

#http.port: 9200

For more information, consult the network module documentation.

--------------------------------- Discovery ----------------------------------

Pass an initial list of hosts to perform discovery when this node is started:

The default list of hosts is ["127.0.0.1", "[::1]"]

discovery.seed_hosts: ["172.15.7.169", "172.15.7.182", "172.15.7.183"]

Bootstrap the cluster using an initial set of master-eligible nodes:

cluster.initial_master_nodes: ["master-1", "master-2", "master-3"]

For more information, consult the discovery and cluster formation module documentation.

---------------------------------- Gateway -----------------------------------

Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

For more information, consult the gateway module documentation.

---------------------------------- Various -----------------------------------

Require explicit names when deleting indices:

#action.destructive_requires_name: true
node.master: false
node.data: true

first, please format your code snippets. This is very hard to read and it's hard to extract the real configuration options, maybe also leave out the comments.
Second, please share the first lines of elasticsearch until it is started, this will show on which network interfaces Elasticsearch is bound to.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.