11

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?

ashique
  • 935
  • 2
  • 8
  • 26
  • Have you tried `./bin/...` (i.e. add `./` ad the beginning of the command). If not, are you sure you have the `elasticsearch-create-enrollment-token` script in your `bin` folder? If that's not the case, you're running ES 7 (and not ES8) – Val Feb 21 '22 at 10:13
  • yeah my es is 7.9 and kibana is 8 – ashique Feb 21 '22 at 10:19

4 Answers4

16

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

cd /usr/share/elasticsearch/bin/

then

./elasticsearch-create-enrollment-token --scope kibana
chris dany
  • 330
  • 1
  • 6
  • Note that the OP not running ES8, but ES 7.9 and Kibana 8 which are not compatible – Val Feb 22 '22 at 06:06
3

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

Val
  • 207,596
  • 13
  • 358
  • 360
2

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

Okpo
  • 375
  • 4
  • 9
1

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.

Yiannis Kakavas
  • 597
  • 3
  • 9