# Should I be copying the \`/etc/elasticsearch/service\_tokens\` to several elastic nodes?

**URL:** <https://discuss.elastic.co/t/should-i-be-copying-the-etc-elasticsearch-service-tokens-to-several-elastic-nodes/326185>\
**Category:** Kibana\
**Created:** [February 22, 2023, 2:03pm UTC](https://discuss.elastic.co/t/should-i-be-copying-the-etc-elasticsearch-service-tokens-to-several-elastic-nodes/326185 "2023-02-22T14:03:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [February 22, 2023, 2:03pm UTC](https://discuss.elastic.co/t/should-i-be-copying-the-etc-elasticsearch-service-tokens-to-several-elastic-nodes/326185/1 "2023-02-22T14:03:33Z")

</div>

I have an elastic cluster with three nodes: `n1`, `n2` and `n3`. And I have a new kibana instance on a separate linux server.

On n1, I ran this command `/usr/share/elasticsearch/bin/elasticsearch-service-token elastic/kibana kibana_token`.

On my kibana server, I pasted the token into `/etc/kibana/kibana.yml -> elasticsearch.serviceAccountToken: <the token>`.

I also updated my `/etc/kibana/kibana.yml -> elasticsearch.hosts: ['n1', 'n2', 'n3']`. But Kibana won't boot up like this. I can get kibana to boot up if I choose ONE of these options:

Option 1: remove `n2` and `n3` from `elasticsearch.hosts`

OR

Option 2: copy the `/etc/elasticsearch/service_tokens` to `n2` and `n3` then reboot those nodes.

Are any of these considered best practices? Or should I be doing something else?

---

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [February 25, 2023, 8:37pm UTC](https://discuss.elastic.co/t/should-i-be-copying-the-etc-elasticsearch-service-tokens-to-several-elastic-nodes/326185/2 "2023-02-25T20:37:15Z")

</div>

Someone from [https://opster.com](https://opster.com) replied to me on slack gave me this solution which worked for me:

> You can avoid that by instead using the [REST interface](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html) to manage your service account tokens.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 25, 2023, 8:37pm UTC](https://discuss.elastic.co/t/should-i-be-copying-the-etc-elasticsearch-service-tokens-to-several-elastic-nodes/326185/3 "2023-03-25T20:37:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
