# Failed to enable security by setting \[xpack.security.enabled\] to \[true\] in the elasticsearch.yml

**URL:** <https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [February 17, 2021, 10:53am UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554 "2021-02-17T10:53:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![haithem899](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@haithem899](https://discuss.elastic.co/u/haithem899)\
**Post date:** [February 17, 2021, 10:53am UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/1 "2021-02-17T10:53:49Z")

</div>

Hello,

I'm trying to enable security by setting [xpack.security.enabled] to [true] in the elasticsearch.yml but after this action, the elasticsearch service failed to start. have you any idea to rsolve this issue? thanks.

Best Regards,

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 17, 2021, 10:58am UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/2 "2021-02-17T10:58:58Z")

</div>

What is in the Elasticsearch logs? If you have more than a single node you will need to configure TLS and not just change the setting you described.

---

<div class="post-metadata">

**Author:** ![haithem899](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@haithem899](https://discuss.elastic.co/u/haithem899)\
**Post date:** [February 17, 2021, 3:24pm UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/3 "2021-02-17T15:24:41Z")

</div>

Hello,

Thank you Christian for your help. I didn't find the location of Elasticsearch logs. could you please help me to find it. Actually i run a cluster of 3 nodes elasticsearch.

Best regards

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 17, 2021, 4:08pm UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/4 "2021-02-17T16:08:28Z")

</div>

[Location depends on how you installed/are running Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/logging.html).

---

<div class="post-metadata">

**Author:** ![haithem899](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@haithem899](https://discuss.elastic.co/u/haithem899)\
**Post date:** [February 22, 2021, 4:08pm UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/5 "2021-02-22T16:08:48Z")

</div>

Hello,

Thank you for your help. actually i didn't see any error in the log.  
This is the log:

[2021-02-22T17:47:36,276][INFO][o.e.n.Node] [host2] started  
[2021-02-22T17:49:37,588][INFO][o.e.n.Node] [host2] stopping ...  
[2021-02-22T17:49:37,594][INFO][o.e.x.w.WatcherService] [host2] stopping watch service, reason [shutdown initiated]  
[2021-02-22T17:49:37,595][INFO][o.e.x.w.WatcherLifeCycleService] [host2] watcher has stopped and shutdown  
[2021-02-22T17:49:37,596][INFO][o.e.x.m.p.l.CppLogMessageHandler] [host2] [controller/8048] [Main.cc@154] ML controller exiting  
[2021-02-22T17:49:37,597][INFO][o.e.x.m.p.NativeController] [host2] Native controller process has stopped - no new native processes can be started  
[2021-02-22T17:49:37,688][INFO][o.e.c.c.Coordinator] [host2] master node [{hsot3}{3F6-oRPARdCoA5WIWRA0kg}{nWF2KzUiQuGftExJEm6fkw}{x.x.x.x}{x.x.x.x:9300}{cdhilmrstw}{ml.machine\_memory=3973660672, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}] failed, restarting discovery  
org.elasticsearch.transport.NodeDisconnectedException: [host3][x.x.x.x:9300][disconnected] disconnected  
[2021-02-22T17:49:37,814][INFO][o.e.n.Node] [host2] stopped  
[2021-02-22T17:49:37,815][INFO][o.e.n.Node] [host2] closing ...  
[2021-02-22T17:49:37,828][INFO][o.e.n.Node] [host2] closed

and i run a cluster of 3 nodes elasticsearch .Have you any idea to resolv the issue?

Best Regards,

---

<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 22, 2021, 4:09pm UTC](https://discuss.elastic.co/t/failed-to-enable-security-by-setting-xpack-security-enabled-to-true-in-the-elasticsearch-yml/264554/6 "2021-03-22T16:09:01Z")

</div>

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