Kibana installed, but cannot be access through 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?

You set server.host to namenode2. But it looks like you are trying to access the instance per ip. Try setting server.host to the ip you are using to access the server.

From the docs:

server.host:
Default: "localhost" This setting specifies the host of the back end server. To allow remote users to connect, set the value to the IP address or DNS name of the Kibana server.

The reason your elasticsearch request works is the second _local_ host setting which allows everyone from the local network to connect.

Thanks!

I modified it, still not working.

Can you copy/paste the exact contents of your kibana.yml?

Now 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
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- 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

This looks like the config of your Elasticsearch server, could you also add the Kibana config file? Also, please put the contents in a code block, otherwise it will mess up the formatting.

Okay.

Here is the kibana file:

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: namenode2

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

# Specifies whether Kibana should rewrite requests that are prefixed with
# `server.basePath` or require that they are rewritten by your reverse proxy.
# This setting was effectively always `false` before Kibana 6.3 and will
# default to `true` starting in Kibana 7.0.
#server.rewriteBasePath: false

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name.  This is used for display purposes.
#server.name: "your-hostname"

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: "http://localhost:9200"
#elasticsearch.url: "http://172.15.7.169:9200"

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# The default application to load.
#kibana.defaultAppId: "home"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
elasticsearch.username: "kibana"
elasticsearch.password: "pass"

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
#server.ssl.enabled: false
#server.ssl.certificate: /path/to/your/server.crt
#server.ssl.key: /path/to/your/server.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files are used to verify the identity of Kibana to Elasticsearch and are required when
# xpack.security.http.ssl.client_authentication in Elasticsearch is set to required.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
#elasticsearch.ssl.key: /path/to/your/client.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
#elasticsearch.ssl.certificateAuthorities: [ "/path/to/your/CA.pem" ]

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
#elasticsearch.ssl.verificationMode: full

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send *no* client-s
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid
# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
#ops.interval: 5000

# Specifies locale to be used for all localizable strings, dates and number formats.
# Supported languages are the following: English - en , by default , Chinese - zh-CN .
#i18n.locale: "en"
#

Thanks! How to put the contents in a code block? I can't find a way to do that.

Above, I wrote

But in your config file, you are still using

server.host: namenode2

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