how can i generate enrollment token for elasticsearch to connect with kibana?

35k views Asked by At

I am having running elastic-search on my Kubernetes cluster with host http://192.168.18.35:31200/. Now I have to connect my elastic search to the kibana. For that an enrollment token needs to be generated but how? When I login to the root directory of elastic-search from kibana dashboard and type the following command to generate a new enrollment token, it shows the error:

enter image description here

command : bin/elasticsearch-create-enrollment-token --scope kibana
error: bash: bin/elasticsearch-create-enrollment-token: No such file or directory

I have created a file elasticsearch-create-enrollment-token inside the bin directory and gave full permission. Still, no tokens are generated. Have any ideas on enrollment token guys?

4

There are 4 answers

0
Okpo On

If you're running on Docker Desktop, say on MacOS:

  1. Make sure both Kibana and ElasticSearch are running like so:

enter image description here

  1. Click to open the running ElasticSearch Docker instance.

  2. Open the Terminal tab on the Docker Desktop and run the following command: bin/elasticsearch-create-enrollment-token -s kibana

Note: The token is only valid for 30mins.

Get more info from the docs: Create Enrolment Token

0
Val On

Since you're running ES 7.9, you also need Kibana 7.9. You cannot run Kibana 8 on ES 7.9.

That's the reason why you don't have the elasticsearch-create-enrollment-token script in your bin folder, since that's new in ES8

1
chris dany On

Assuming that you are on debian/ ubuntu, this should help

cd /usr/share/elasticsearch/bin/

then

./elasticsearch-create-enrollment-token --scope kibana
0
Yiannis Kakavas On

The enrollment flow for configuration is available in version 8.0 and onwards only and is designed to work only with the TLS configuration that is generated automatically on the first start of the node.

You can still use the documentation to setup TLS manually and configure Kibana to connect to your elasticsearch cluster as you would do in previous versions, this is always supported too.

I’d strongly suggest that you look into using ECK and take advantage of the documentation available.