2015-02-13 19:22:02 +01:00
[[production]]
== Using Kibana in a Production Environment
2015-03-03 23:16:13 +01:00
* <<configuring-kibana-shield, Configuring Kibana to Work with Shield>>
* <<enabling-ssl, Enabling SSL>>
* <<controlling-access, Controlling Access>>
* <<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>
2015-02-13 19:22:02 +01:00
How you deploy Kibana largely depends on your use case. If you are the only user,
you can run Kibana on your local machine and configure it to point to whatever
Elasticsearch instance you want to interact with. Conversely, if you have a large
number of heavy Kibana users, you might need to load balance across multiple
Kibana instances that are all connected to the same Elasticsearch instance.
While Kibana isn't terribly resource intensive, we still recommend running Kibana
2015-03-03 23:16:13 +01:00
separate from your Elasticsearch data or master nodes. To distribute Kibana
traffic across the nodes in your Elasticsearch cluster, you can run Kibana
and an Elasticsearch client node on the same machine. For more information, see
<<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>.
2015-02-13 19:22:02 +01:00
2015-03-03 23:16:13 +01:00
[float]
[[configuring-kibana-shield]]
2015-02-13 19:22:02 +01:00
=== Configuring Kibana to Work with Shield
If you are using Shield to authenticate Elasticsearch users, you need to provide
2015-03-03 23:16:13 +01:00
the Kibana server with credentials so it can access the `.kibana` index and monitor
the cluster.
2015-02-13 19:22:02 +01:00
2015-05-01 19:59:15 +02:00
To configure credentials for the Kibana server:
2015-02-13 19:22:02 +01:00
2015-05-01 19:59:15 +02:00
. Assign the `kibana4_server` role to a user in Shield. For more information, see
{shield}/_shield_with_kibana_4.html[Configuring a Role for the Kibana 4 Server]
in the Shield documentation.
. Set the `kibana_elasticsearch_username` and
`kibana_elasticsearch_password` properties in `kibana.yml` to specify the credentials
of the user you assigned the `kibana4_server`
role:
+
[source,text]
2015-02-13 19:22:02 +01:00
----
2015-05-01 19:59:15 +02:00
kibana_elasticsearch_username: kibana4-user
kibana_elasticsearch_password: kibana4-password
2015-02-13 19:22:02 +01:00
----
2015-03-03 23:16:13 +01:00
2015-05-01 19:59:15 +02:00
Kibana 4 users also need access to the `.kibana` index so they can save and load searches, visualizations, and dashboards.
For more information, see {shield}/_shield_with_kibana_4.html#kibana4-roles[Configuring Roles for Kibana 4 Users] in the Shield documentation.
2015-03-03 23:16:13 +01:00
[float]
[[enabling-ssl]]
2015-02-13 19:22:02 +01:00
=== Enabling SSL
Kibana supports SSL encryption for both client requests and the requests the Kibana server
sends to Elasticsearch.
To encrypt communications between the browser and the Kibana server, you configure the `ssl_key_file `and `ssl_cert_file` properties in `kibana.yml`:
2015-05-01 19:59:15 +02:00
[source,text]
2015-02-13 19:22:02 +01:00
----
# SSL for outgoing requests from the Kibana Server (PEM formatted)
ssl_key_file: /path/to/your/server.key
ssl_cert_file: /path/to/your/server.crt
----
If you are using Shield or a proxy that provides an HTTPS endpoint for Elasticsearch,
you can configure Kibana to access Elasticsearch via HTTPS so communications between
the Kibana server and Elasticsearch are encrypted.
To do this, you specify the HTTPS
protocol when you configure the Elasticsearch URL in `kibana.yml`:
2015-05-01 19:59:15 +02:00
[source,text]
2015-02-13 19:22:02 +01:00
----
elasticsearch: "https://<your_elasticsearch_host>.com:9200"
----
If you are using a self-signed certificate for Elasticsearch, set the `ca` property in
`kibana.yml` to specify the location of the PEM file. Setting the `ca` property lets you leave the `verify_ssl` option enabled.
2015-05-01 19:59:15 +02:00
[source,text]
2015-02-13 19:22:02 +01:00
----
# If you need to provide a CA certificate for your Elasticsarech instance, put
# the path of the pem file here.
ca: /path/to/your/ca/cacert.pem
----
2015-03-03 23:16:13 +01:00
[float]
[[controlling-access]]
2015-02-13 19:22:02 +01:00
=== Controlling access
2015-03-17 02:18:50 +01:00
You can use http://www.elastic.co/overview/shield/[Elasticsearch Shield]
2015-02-13 19:22:02 +01:00
(Shield) to control what Elasticsearch data users can access through Kibana.
Shield provides index-level access control. If a user isn't authorized to run
the query that populates a Kibana visualization, the user just sees an empty
visualization.
2015-03-03 23:16:13 +01:00
To configure access to Kibana using Shield, you create Shield roles
2015-02-13 19:22:02 +01:00
for Kibana using the `kibana4` default role as a starting point. For more
2015-03-17 02:18:50 +01:00
information, see http://www.elastic.co/guide/en/shield/current/_shield_with_kibana_4.html[Using Shield with Kibana 4].
2015-03-03 23:16:13 +01:00
[float]
[[load-balancing]]
=== Load Balancing Across Multiple Elasticsearch Nodes
If you have multiple nodes in your Elasticsearch cluster, the easiest way to distribute Kibana requests
across the nodes is to run an Elasticsearch _client_ node on the same machine as Kibana.
Elasticsearch client nodes are essentially smart load balancers that are part of the cluster. They
process incoming HTTP requests, redirect operations to the other nodes in the cluster as needed, and
2015-03-17 02:18:50 +01:00
gather and return the results. For more information, see http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html[Node] in the Elasticsearch reference.
2015-03-03 23:16:13 +01:00
To use a local client node to load balance Kibana requests:
. Install Elasticsearch on the same machine as Kibana.
. Configure the node as a client node. In `elasticsearch.yml`, set both `node.data` and `node.master` to `false`:
+
--------
# 3. You want this node to be neither master nor data node, but
# to act as a "search load balancer" (fetching data from nodes,
# aggregating results, etc.)
#
node.master: false
node.data: false
--------
. Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the
name of your cluster.
+
--------
cluster.name: "my_cluster"
--------
. Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch_url` should be set to
`localhost:9200`.
+
--------
# The Elasticsearch instance to use for all your queries.
elasticsearch_url: "http://localhost:9200"
2015-03-09 06:30:42 +01:00
--------