Should I be copying the `/etc/elasticsearch/service_tokens` to several elastic nodes?

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?

Someone from 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 to manage your service account tokens.

1 Like

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