Installed elasticsearch and Kibana on my GCP Red Hat Linux 9 but its not working

I installed elastic and kibana v.7.17.9 using rpm and was able to start the service with no issues. I don't see any errors in logs but when I try to access http://localhost:5601, it doesn't work and I get can't connect to the server.
My Elasticsearch.yml looks like:

# ======================== Elasticsearch Configuration =========================
cluster.name: my-application
node.name: node-1
path.data: /var/lib/elasticsearch
action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
#network.host: 192.168.0.1
http.port: 9200

Kibana.yml looks like:

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

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

kibana.index: ".kibana"

#elasticsearch.username: "kibana_system"
#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
sudo lsof -i :5601
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    210881 kibana   22u  IPv4 200212      0t0  TCP *:esmagent (LISTEN)
lsof -Pi :5601
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    210881 kibana   22u  IPv4 200212      0t0  TCP *:5601 (LISTEN)

These curl commands is from my single node server on which I installed Kibana and elasticsearch:

curl -I http://127.0.0.1:5601
HTTP/1.1 302 Found
location: /spaces/enter
x-content-type-options: nosniff
referrer-policy: no-referrer-when-downgrade
content-security-policy: script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'
kbn-name: instance-1
kbn-license-sig: 0191c0303446d0274606dde830b797296e1243cde3dc5b6298fd30404f6818c5
cache-control: private, no-cache, no-store, must-revalidate
content-length: 0
Date: Thu, 11 May 2023 23:30:28 GMT
Connection: keep-alive
Keep-Alive: timeout=120
curl localhost:9200
{
  "name" : "node-1",
  "cluster_name" : "name",
  "cluster_uuid" : "uuid",
  "version" : {
    "number" : "7.17.9",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "ef48222227ee6b9e70e502f0f0daa52435ee634d",
    "build_date" : "2023-01-31T05:34:43.305517834Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
journalctl -u kibana.service
May 11 22:43:16 instance-1 systemd[1]: Started Kibana.
May 11 22:46:19 instance-1 systemd[1]: Stopping Kibana...
May 11 22:46:19 instance-1 systemd[1]: kibana.service: Deactivated successfully.
May 11 22:46:19 instance-1 systemd[1]: Stopped Kibana.
May 11 22:46:19 instance-1 systemd[1]: kibana.service: Consumed 25.168s CPU time.
May 11 22:46:19 instance-1 systemd[1]: Started Kibana.
May 11 22:52:26 instance-1 systemd[1]: Stopping Kibana...
May 11 22:52:26 instance-1 systemd[1]: kibana.service: Deactivated successfully.
May 11 22:52:26 instance-1 systemd[1]: Stopped Kibana.
May 11 22:52:26 instance-1 systemd[1]: kibana.service: Consumed 28.506s CPU time.
May 11 22:52:26 instance-1 systemd[1]: Started Kibana.
May 11 22:57:50 instance-1 systemd[1]: Stopping Kibana...
May 11 22:57:50 instance-1 systemd[1]: kibana.service: Deactivated successfully.
May 11 22:57:50 instance-1 systemd[1]: Stopped Kibana.
May 11 22:57:50 instance-1 systemd[1]: kibana.service: Consumed 26.449s CPU time.
May 11 22:57:50 instance-1 systemd[1]: Started Kibana.
journalctl -u elasticsearch.service
May 11 22:34:12 instance-1 systemd[1]: Starting Elasticsearch...
May 11 22:34:40 instance-1 systemd[1]: Started Elasticsearch.
May 11 22:52:47 instance-1 systemd[1]: Stopping Elasticsearch...
May 11 22:52:47 instance-1 systemd[1]: elasticsearch.service: Deactivated successfully.
May 11 22:52:47 instance-1 systemd[1]: Stopped Elasticsearch.
May 11 22:52:47 instance-1 systemd[1]: elasticsearch.service: Consumed 1min 58.885s CPU time.
May 11 22:52:47 instance-1 systemd[1]: Starting Elasticsearch...
May 11 22:53:13 instance-1 systemd[1]: Started Elasticsearch.

I am not able to figure out what's wrong in here, please help.

I think that in your kibana.yml you must set the

server.host: "192.168.1.xxx"

for example not localhost, if you dont change the localhost option you mai not access outside of the machine, and be carrefully with the port mapping.

Hello cperzrt10,
I tried that. I changed it to internal IP of the VM instance. But I still can't access the kibana page on that 192.168.x.x:5601 IP address.
The strange thing is I am able to partly access the kibana page on the external IP of the VM. I have not mentioned that IP anywhere in my elasticsearch or kibana yml files.
What I mean by partly is, if I go to http://external-ip:5601 it auto appends /app/home to the URL and I also see elastic name appear on tab and it keeps on trying to render the page. But it just does that in loop and nothing happens.

Try to open the ports

centos:
firewall-cmd --permanent --add-port=1-9999/tcp && firewall-cmd --reload

This not for production machines, only to do in not productive enviroments, this comand open ports to acces from outside the machine without problems of firewall, try it.

If your problem continues please add traces or image to your comment.

To se the kibana and elasticsearch log use

tail -f /var/log/kibana/kibana.log
tail -f /var/log/elasticsearch/*.log

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