2015-02-13 19:22:02 +01:00
[[production]]
2018-05-17 18:31:23 +02:00
== Using Kibana in a production environment
2016-10-25 03:41:32 +02:00
2019-01-08 17:48:36 +01:00
* <<configuring-kibana-shield>>
2019-02-04 15:09:40 +01:00
* <<csp-strict-mode>>
2019-01-08 17:48:36 +01:00
* <<enabling-ssl>>
* <<load-balancing>>
2019-06-24 19:58:46 +02:00
* <<high-availability>>
2015-02-13 19:22:02 +01:00
How you deploy Kibana largely depends on your use case. If you are the only user,
2015-07-15 10:48:49 +02:00
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
2015-02-13 19:22:02 +01:00
number of heavy Kibana users, you might need to load balance across multiple
Kibana instances that are all connected to the same Elasticsearch instance.
2015-07-15 10:48:49 +02:00
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
2016-05-17 03:19:18 +02:00
[float]
[[configuring-kibana-shield]]
2019-01-08 17:48:36 +01:00
=== Using {stack} {security-features}
2016-05-17 03:19:18 +02:00
2019-10-17 23:41:13 +02:00
You can use {stack} {security-features} to control what {es} data users can
access through Kibana.
2016-10-23 22:29:06 +02:00
2019-01-08 17:48:36 +01:00
When {security-features} are enabled, Kibana users have to log in. They need to
2019-05-22 16:44:36 +02:00
have a role granting <<kibana-privileges, Kibana privileges>> as well as access
to the indices they will be working with in Kibana.
2016-05-17 03:19:18 +02:00
2016-10-15 01:50:09 +02:00
If a user loads a Kibana dashboard that accesses data in an index that they
are not authorized to view, they get an error that indicates the index does
2019-05-22 16:44:36 +02:00
not exist.
2016-05-17 03:19:18 +02:00
2019-05-22 16:44:36 +02:00
For more information on granting access to Kibana, see <<xpack-security-authorization>>.
2015-05-28 20:26:02 +02:00
2019-02-04 15:09:40 +01:00
[float]
[[csp-strict-mode]]
=== Require Content Security Policy
Kibana uses a Content Security Policy to help prevent the browser from allowing
unsafe scripting, but older browsers will silently ignore this policy. If your
organization does not need to support Internet Explorer 11 or much older
versions of our other supported browsers, we recommend that you enable Kibana's
`strict` mode for content security policy, which will block access to Kibana
for any browser that does not enforce even a rudimentary set of CSP
protections.
To do this, set `csp.strict` to `true` in your `kibana.yml`:
--------
csp.strict: true
--------
2015-03-03 23:16:13 +01:00
[float]
[[enabling-ssl]]
2015-02-13 19:22:02 +01:00
=== Enabling SSL
2018-05-17 18:31:23 +02:00
2018-08-16 00:14:41 +02:00
See <<configuring-tls>>.
2015-02-13 19:22:02 +01:00
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
2016-11-29 19:16:55 +01:00
across the nodes is to run an Elasticsearch _Coordinating only_ node on the same machine as Kibana.
Elasticsearch Coordinating only nodes are essentially smart load balancers that are part of the cluster. They
2015-07-15 10:48:49 +02:00
process incoming HTTP requests, redirect operations to the other nodes in the cluster as needed, and
gather and return the results. For more information, see
2017-06-27 19:13:42 +02:00
{ref}/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:
2015-07-15 10:48:49 +02:00
. Install Elasticsearch on the same machine as Kibana.
2016-11-29 19:16:55 +01:00
. Configure the node as a Coordinating only node. In `elasticsearch.yml`, set `node.data`, `node.master` and `node.ingest` to `false`:
2015-03-03 23:16:13 +01:00
+
--------
2016-11-29 19:16:55 +01:00
# 3. You want this node to be neither master nor data node nor ingest node, but
2015-03-03 23:16:13 +01:00
# to act as a "search load balancer" (fetching data from nodes,
# aggregating results, etc.)
#
node.master: false
node.data: false
2017-06-27 19:13:42 +02:00
node.ingest: false
2015-03-03 23:16:13 +01:00
--------
2015-07-15 10:48:49 +02:00
. Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the
2015-03-03 23:16:13 +01:00
name of your cluster.
+
--------
cluster.name: "my_cluster"
--------
2017-02-13 23:16:19 +01:00
. Check your transport and HTTP host configs in `elasticsearch.yml` under `network.host` and `transport.host`. The `transport.host` needs to be on the network reachable to the cluster members, the `network.host` is the network for the HTTP connection for Kibana (localhost:9200 by default).
+
--------
network.host: localhost
http.port: 9200
# by default transport.host refers to network.host
transport.host: <external ip>
transport.tcp.port: 9300 - 9400
--------
2018-12-18 20:22:43 +01:00
. Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch.hosts` setting should be set to
`["localhost:9200"]`.
2015-03-03 23:16:13 +01:00
+
--------
# The Elasticsearch instance to use for all your queries.
2018-12-18 20:22:43 +01:00
elasticsearch.hosts: ["http://localhost:9200"]
2015-05-18 04:31:43 +02:00
--------
2019-06-24 19:58:46 +02:00
[float]
[[high-availability]]
=== High Availability Across Multiple Elasticsearch Nodes
Kibana can be configured to connect to multiple Elasticsearch nodes in the same cluster. In situations where a node becomes unavailable,
Kibana will transparently connect to an available node and continue operating. Requests to available hosts will be routed in a round robin fashion.
Currently the Console application is limited to connecting to the first node listed.
In kibana.yml:
--------
elasticsearch.hosts:
- http://elasticsearch1:9200
- http://elasticsearch2:9200
--------
Related configurations include `elasticsearch.sniffInterval`, `elasticsearch.sniffOnStart`, and `elasticsearch.sniffOnConnectionFault`.
These can be used to automatically update the list of hosts as a cluster is resized. Parameters can be found on the {kibana-ref}/settings.html[settings page].