Yohan Chung
Yohan Chung

Reputation: 539

How to remotely access Kibana in Elastic

I am currently trying to make my Kibana dashboard remotely accessible via the browser. So, a user can monitor index and run scripts in a remote manner. As background, my elastic is currently ran on Windows server and I could successfully set 'elastic uri search' (e.g. http://[IP_ADDRESS]:9200) remotely accessible by updating elasticsearch.yml and opening the port 9200. For this reason, I took similar actions to remotely access Kibana, updating kibana.yml and opening the port 5601, but I couldn't remotely access kibana on the browser from my local machine. It throws ERR_CONNECTION_TIMED_OUT on the browser. See attributes that I have updated for kibana.yml:

server.port: "5601"
server.host: "0.0.0.0"
elasticsearch.url: "http://localhost:9200"

Upvotes: 3

Views: 14447

Answers (2)

Aneesh Panoli
Aneesh Panoli

Reputation: 216

I followed these steps to connect remote Elasticsearch on AWS EC2 to my local kibana.

Backup your original .yml files

sudo cp /etc/elasticsearch/elasticsearch.yml elasticsearch.yml.bk

sudo cp /etc/kibana/kibana.yml kibana.yml.bk

  1. Edit security groups and add a new rule - custom TCP with port 9200 accessible via your public IP v4.

  2. ssh to your server and tweak ufw to allow your ip over 9200 sudo ufw allow from <your public v4 IP> to any port 9200

  3. edit elasticsearch.yml to add network.host: 0.0.0.0 discovery.type: single-node Ref

  4. on your local machine edit kibana.yml and add elasticsearch.hosts: ["http://34.103.134.135:9200"]

  5. go to http://localhost:5601/ you should see your remote index under Discover> index management. `

Upvotes: 0

Marcelo Gazzola
Marcelo Gazzola

Reputation: 1083

You need to configure the file /etc/kibana/kibana.yml as root: Uncomment the lines:

server.port: 5601

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

server.host: "0.0.0.0"

# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "0.0.0.0"

elasticsearch.hosts

Change the <your-elastic-server-ip> to your elastic search server IP, something like 192.168.1.XX

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://<your-elastic-server-ip>:9200"]

And check the ports on your firewall:

$ sudo firewall-cmd --list-all

Output:

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources: 
  services: cockpit dhcpv6-client ftp ssh
  ports: 10000/tcp 3306/tcp 9200/tcp 5601/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

If you don't see the ports 9200/tcp 5601/tcp opened then do the following command as sudo:

$ sudo firewall-cmd --zone=public --permanent --add-port 9200/tcp
$ sudo firewall-cmd --zone=public --permanent --add-port 5601/tcp

Upvotes: 6

Related Questions