Deploy Kibana Using Docker
Server Requirements
- 1GB of RAM
Related Posts
Steps
It's very simple to just get started with a basic Kibana deployment.
Simply create a docker-compose.yml file with the following contents, and update the SERVER_NAME
and ELASTICSEARCH_HOSTS
variables appropriately.
version: '3'
services:
kibana:
image: kibana:7.9.0
ports:
- 5601:5601
volumes:
- ./kibana.yml:/usr/share/kibana/config/kibana.yml
Configuration
Now we need to create the kibana.yml
configuration file. Its easiest to download a fully commented out example and edit it to our needs:
wget https://raw.githubusercontent.com/elastic/kibana/master/config/kibana.yml
Configuration - Server Host
Uncomment the server.host
and change the value to 0.0.0.0
like so:
# 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: "0.0.0.0"
... without this, even when kibana is launched, you won't be able to access it.
Configuration - Elasticsearch Hosts
Set location(s) of your elastic search hosts. E.g.
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://elastic-search.programster.org:9200"]
Start Kibana
Now that you have finished making the necessary configuration changes, you can launch your kibana server with:
docker-compose up
Your kibana service will now start up, which takes quite a while. When it eventually finishes, you can view it in your browser at:
http://kibana.mydomain.com:5601
Debugging
Hosts Issue
If you are trying this out locally, and editing your server's hosts files to point to each of the services, this is unlikely to work. Instead, add the elastic-search server's hostname to your docker-compose file directly:
extra_hosts:
- "elastic-search.mydomain.com:192.168.1.xxx"
No Living Connections (SSL)
If you get the following error message from Kibana when deploying:
kibana_1 | {"type":"log","@timestamp":"2020-08-23T10:20:41Z","tags":["warning","elasticsearch","data"],"pid":6,"message":"No living connections"}
Then it's probably because you have not set up and using SSL certificates on your elastic search server. You can "fix" this (other than by setting up SSL certs), by setting:
elasticsearch.ssl.verificationMode: none
... in your yaml configuration.
Incompatible Versions
You may get the message:
This version of Kibana (v7.9.0) is incompatible with the following Elasticsearch nodes in your cluster
The easiest way to resolve this is to make sure your Kibana and Elastic search versions are the same (change the tags in the relevant docker-compose files).
References
- https://discuss.elastic.co/t/error-kibana-server-is-not-ready-yet/156834/6
- https://discuss.elastic.co/t/no-living-connections/183480
First published: 23rd August 2020