Local Kibana installation¶
In some scenarios, you might prefer to run your own local instance of Kibana, instead of the ObjectRocket-hosted instance. For example, you might want to install Kibana plug-ins that only you have access to or create a different set of Kibana visualizations that only display in your local Kibana.
Installation¶
The ObjectRocket recommended setup uses docker containers to run locally, so your local machine must have docker and docker-compose. You should have the following versions installed:
- docker 1.10.0+
- docker-compose 1.6.0+
Next, clone the objectrocket/local-kibana GitHub repo to a directory on your local machine.
$ git clone https://github.com/objectrocket/local-kibana.git
An alternative approach is to run Kibana on your local system without containers. This approach removes the docker requirement, but adds different requirements, like having Java on your local machine. For more information about that approach, consult elastic’s documentation .
Configuration¶
This section provides information about the configuration.
Kibana version¶
The default version of Kibana used in the repository is 5.4.3. If you’re using a different or a non-compatible version,
you can change to the appropriate version by editing the Dockerfile
in local-kibana/kibana
.
# https://github.com/elastic/kibana-docker
FROM docker.elastic.co/kibana/kibana:5.4.3
# Remove X-Pack
RUN kibana-plugin remove x-pack
# Install other plugins with
# RUN kibana-plugin install <name|url>
Change the number at the end of the line FROM docker.elastic.co/kibana/kibana:5.4.3
to match the version of Kibana you want to use.
You can see which versions of Kibana are compatible with your version of Elasticsearch in the official Elastic support matrix .
kibana.yml¶
In the newly cloned repository, the Kibana configuration file is local-kibana/kibana/config/kibana.yml
.
You’ll need to update the included file with one of the https connection strings from the ObjectRocket UI/API (NOT the Kibana string) and users with the password as configured in the ObjectRocket UI.
---
## Default Kibana configuration from kibana-docker.
## from https://github.com/elastic/kibana-docker/blob/master/build/kibana/config/kibana-oss.yml
#
server.name: kibana
server.host: "0"
elasticsearch.url: "https://your-host.es.objectrocket.com:your-port"
elasticsearch.username: "your-user"
elasticsearch.password: "your-password"
Note
Kibana can only accept a single host for the Elasticsearch URL. You must take the list of hosts provided in the ObjectRocket UI and select only one host to use for the local Kibana instance.
ObjectRocket ACLs¶
You also need to ensure that you have an Elasticsearch access control list (ACL) set up to enable connection from your local machine.
To set up an Elasticsearch ACL from the ObjectRocket UI, use the following steps:
- Select the instance that you want to connect to.
- Select + Add ACL.
- Select Elasticsearch for ACL Role.
- Select MyIP.
- Select Add ACL Entry.
This process ensures that a local installation of Kibana can connect to your ObjectRocket Elasticsearch cluster.
Launching Kibana¶
Now that you have your Kibana configuration file and access from your local machine set up, you can launch Kibana. From a terminal in the newly cloned ‘local-kibana’ directory run the following commands:
$ docker-compose build --no-cache
$ docker-compose up
This launches the Kibana Docker container. Status information from Kibana starts printing to your terminal. After Kibana finishes loading, you should see something similar to the following code:
kibana_1 | {"type":"log","@timestamp":"2017-06-29T21:34:36Z","tags":["status","ui settings","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Elasticsearch plugin is yellow"}
Connecting to Kibana¶
In a browser, you can now navigate to localhost:5601
.
Kibana starts loading and you need to enter your Elasticsearch username and password again.
You are now connecting to your ObjectRocket Elasticsearch cluster with a local Kibana installation. Because it’s still using the same index for Kibana visualizations and dashboards, you see the same dashboards as the hosted version.
Using the non-default Kibana index¶
By default on the ObjectRocket service, Kibana stores its data in an Elasticsearch index called “.kibana”. To create your own set of Kibana items that don’t show up in the hosted ObjectRocket Kibana, add the following setting to your kibana.yml file:
kibana.index: "yourkibanaindexname"
When using a different Kibana index name, be sure to reconfigure your Kibana index patterns for the new index.
Shutting down Kibana¶
To shut down the Docker Kibana, navigate to the local-kibana directory from your terminal and run the docker-compose down command:
$ cd /some/directory/local-kibana
$ docker-compose down