how to

Up and Running with Kibana 4 on ObjectRocket Elasticsearch

By October 5, 2015 August 18th, 2022 No Comments

If you’re looking to transform your millions (or billions!) of Elasticsearch documents into eye-catching charts, graphs, and tables, Kibana is the answer. As an Elastic product, it integrates closely with Elasticsearch and provides an easy-to-use interface for making sense of mounds of data.

Currently, all ObjectRocket Elasticsearch instances come pre-loaded with Kibana 3, which you can access at /_plugin/kibana on any of your Elasticsearch HTTP endpoints. However, Kibana 4 introduces a number of improvements and new features, so we are working hard to provide it alongside every Elasticsearch instance you create with ObjectRocket. In the meantime, this tutorial will walk you through connecting to your Elasticsearch instance using Kibana 4 running in a Docker container.

Prerequisites

If you already have Docker installed and an Elasticsearch instance with us, you are good to go. Just make sure your Docker host’s IP address is whitelisted on the Elasticsearch instance and take your connection information to the “Running Kibana 4 in Docker” section below.

Elasticsearch

To get started, you are going to need an Elasticsearch instance on ObjectRocket. If you do not already have one, we have excellent documentation on getting started with Elasticsearch. We are going to be running Docker locally, so be sure to whitelist your current IP address (from icanhazip.com) in the ACLs. Once your instance is up, you will need the following information to connect from Kibana 4:

  • The HTTPS connection string for your instance, e.g. https://iad1-19999-0.es.objectrocket.com:29999. For HA purposes, each instance has four client nodes which you can connect to, however you will only need one in this case.
  • A username/password combination for an admin user on the instance.

Docker

The easiest way to get started with Docker these days is Docker Machine. Getting it installed and configured is out of the scope of this article, but their getting started guide is a good place to start.

Running Kibana 4 in Docker

Now that you have an Elasticsearch instance online and Docker installed, it is time to get Kibana 4 up and running!

If you are using Docker Machine, be sure to set up your environment appropriately:

$ docker-machine ls
NAME        ACTIVE   DRIVER       STATE     URL                         SWARM
dockerbox            virtualbox   Running   tcp://192.168.99.100:2376
$ eval "$(docker-machine env dockerbox)"
$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Create the environment file

The Kibana 4 Docker image which we will be using (objectrocket/kibana) requires that the ELASTICSEARCH_URL environment variable be set so that it knows how to connect to Elasticsearch. In this example, we’re connecting to the host iad1-19999-3.es.objectrocket.com on port 29999 (HTTPS) with username alice and password password.

$ echo 'ELASTICSEARCH_URL=https://alice:password@iad1-19999-3.es.objectrocket.com:29999' > kibana4.env

Note: You could just as easily pass in these environment variables with the -e flag, but since they contain sensitive credentials, it’s wise to place them in an env file.

Start the container

Now we can start our Kibana 4 container:

# Use `-p $PORT:5601` if you wish to change the bind port
$ docker run -d --name kibana4 -p 5601:5601 --env-file kibana4.env objectrocket/kibana:4.1.2
Unable to find image 'objectrocket/kibana:4.1.2' locally
4.1.2: Pulling from objectrocket/kibana

8a648f689ddb: Pull complete
6a9f09112d11: Pull complete
98c91eb0b06a: Pull complete
f5030fbbffc3: Pull complete
0a7a2d9eb5d6: Pull complete
1f9563800fc7: Pull complete
f43ab0bd66e0: Pull complete
Digest: sha256:352e95077d0312fa12de6cec3bc66d221391952b8cf98e890cd7324b6b6605ce
Status: Downloaded newer image for objectrocket/kibana:4.1.2
cc341ff14d492a30e106007896201639964bdef6a93d03d497957a2738f5ac24

Update: If you’re running Elasticsearch 2.0+, you’ll need to use the objectrocket/kibana:4.2.0 (or higher) image.

After your container is created, it should be visible in the output of docker ps:

$ docker ps
CONTAINER ID        IMAGE                 COMMAND                CREATED              STATUS              PORTS                    NAMES
cc341ff14d49        objectrocket/kibana   "/opt/kibana/run.sh"   About a minute ago   Up About a minute   0.0.0.0:5601->5601/tcp   kibana4

If you’re having issues getting the container running, double check your ELASTICSEARCH_URL variable and make sure that each portion of the URL is correct. It’s also worth noting that passwords with symbols such as @ or : can break the URL scheme. You can also run docker logs kibana4 to show any error messages which Kibana has sent to stdout or stderr.

Connect to Kibana 4

You should now be able to connect to Kibana 4 on port 5601 (or whichever port you chose in the previous step) on your Docker host. If you are running locally, use http://localhost:5601. If you are running Docker Machine, use the IP address of your Docker Machine VM from docker-machine ip , e.g. http://192.168.99.100:5601.

After you have successfully connected, you need to configure Kibana to use indices from your Elasticsearch instance. See the Connect Kibana with Elasticsearch documentation from Elastic for more information. You may also want to read their Getting Started with Kibana guide to learn more about some of the key features in Kibana 4.

Wrapping Up

When you’re done crafting visualizations in Kibana, you can stop the Docker container by running the following command:

$ docker stop kibana4
kibana4

And then the next time you wish to connect again, just run docker start kibana4 and you’re ready to go.

As mentioned earlier, hosted Kibana 4 is already in the works for our Elasticsearch product offering, but running Kibana locally will allow you to quickly get started in the meantime. And since Kibana stores all of its configuration in Elasticsearch indices, you won’t lose any of your precious dashboards or visualizations when you make the switch!