# Elasticsearch failed when i try to setup x-pack

**URL:** <https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984>\
**Category:** Elasticsearch\
**Created:** [June 28, 2020, 4:25am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984 "2020-06-28T04:25:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amine\_Aloui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amine_aloui/32/46158_2.png) [@Amine\_Aloui](https://discuss.elastic.co/u/Amine_Aloui)\
**Post date:** [June 28, 2020, 4:25am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/1 "2020-06-28T04:25:22Z")

</div>

when i try to setup x-pack in remote server i have some issues  
(in my local ,it works perfectly) ,but it dosn't in remote sever

first :  
vi /etc/elasticsearch/elasticsearch.yml  
i add this option:

```
xpack.security.enabled: true
discovery.type: single.node

 ---------------------------------- Network -----------------------------------
#network.host: 0.0.0.0
network.host: 192.168.1.10
#http.port: 9200

```

root@xxxx:/home/cloud\_user# /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive  
warning: Falling back to java on path. This behavior is deprecated. Specify JAVA\_HOME

Connection failure to: [http://192.168.1.10:9200/\_xpack/security/\_authenticate?pretty](http://192.168.1.10:9200/_xpack/security/_authenticate?pretty) failed: Connection timed out (Connection timed out)

ERROR: Failed to connect to elasticsearch at [http://192.168.1.10:9200/\_xpack/security/\_authenticate?pretty](http://192.168.1.10:9200/_xpack/security/_authenticate?pretty). Is the URL correct and elasticsearch running?

```
this is the log:
tail -f /var/log/elasticsearch/elasticsearch.log
root@xxxxxxx:/home/cloud_user# tail -f /var/log/elasticsearch/elasticsearch.log
    at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:446) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:417) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:148) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.node.Node.<init>(Node.java:374) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.10.jar:6.8.10]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.10.jar:6.8.10]
    ... 6 more

```

* * *

even when i desactivate x-pack security ,i have the same issue, and i don't see the 9200 port

````
   ```Preformatted text Preformatted text root@xxxxxx:/home/cloud_user# netstat -nlpPreformatted text
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name    
    tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 1193/Xtightvnc      
    tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 1193/Xtightvnc      
    tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 734/systemd-resolve 
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1028/sshd           
    tcp 0 0 0.0.0.0:5601 0.0.0.0:* LISTEN 3231/node           
    tcp 0 0 0.0.0.0:31297 0.0.0.0:* LISTEN 1667/node           
    tcp6 0 0 :::5044 :::* LISTEN 3351/java           
    tcp6 0 0 :::22 :::* LISTEN 1028/sshd           
    tcp6 0 0 127.0.0.1:9600 :::* LISTEN 3351/java           
    udp 0 0 127.0.0.53:53 0.0.0.0:* 734/systemd-resolve 
    udp 0 0 172.31.106.118:68 0.0.0.0:* 700/systemd-network 
    udp6 0 0 fe80::4b3:1fff:feea:546 :::* 700/systemd-network 
    raw6 0 0 :::58 :::* 7 700/systemd-networkPreformatted text```
````

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 28, 2020, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/2 "2020-06-28T08:02:12Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

Also please share the full logs.

---

<div class="post-metadata">

**Author:** ![Amine\_Aloui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amine_aloui/32/46158_2.png) [@Amine\_Aloui](https://discuss.elastic.co/u/Amine_Aloui)\
**Post date:** [June 28, 2020, 5:39pm UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/3 "2020-06-28T17:39:50Z")

</div>

it's done, thanks

---

<div class="post-metadata">

**Author:** ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)\
**Post date:** [June 28, 2020, 9:30pm UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/4 "2020-06-28T21:30:04Z")

</div>

Amine\_Aloui  
Your ES server has not started. You may want to check / post rest of the start up logs.

There is one issue I noticed in your yaml. discovery.type value should be **single-node** not single.node

[https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html#single-node-discovery](https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html#single-node-discovery)

---

<div class="post-metadata">

**Author:** ![Amine\_Aloui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amine_aloui/32/46158_2.png) [@Amine\_Aloui](https://discuss.elastic.co/u/Amine_Aloui)\
**Post date:** [June 29, 2020, 12:00am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/5 "2020-06-29T00:00:24Z")

</div>

Thanks Vinayak\_Sapre,

in /etc/elasticsearch/elasticsearch.yml  
I keep only this option:

```auto
xpack.security.enabled: true

```

```auto
root@xxxx:/home/user# systemctl restart elasticsearch
Job for elasticsearch.service failed because a timeout was exceeded.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

```

```auto
root@xxxx:/home/user# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Sun 2020-06-28 23:49:00 UTC; 6min ago
     Docs: https://www.elastic.co
  Process: 18330 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=143)
 Main PID: 18330 (code=exited, status=143)

Jun 28 23:47:29 xxxx systemd[1]: Starting Elasticsearch...
Jun 28 23:48:59 xxxx systemd[1]: elasticsearch.service: Start operation timed out. Terminating.
Jun 28 23:49:00 xxxx systemd[1]: elasticsearch.service: Failed with result 'timeout'.
Jun 28 23:49:00 xxxx systemd[1]: Failed to start Elasticsearch.

```

---

<div class="post-metadata">

**Author:** ![Vinayak\_Sapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak_sapre/32/45939_2.png) [@Vinayak\_Sapre](https://discuss.elastic.co/u/Vinayak_Sapre)\
**Post date:** [June 29, 2020, 12:09am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/6 "2020-06-29T00:09:55Z")

</div>

@Amine_Aloui  
By startup log I meant entries in /var/log/elasticsearch/elasticsearch.log during ES start up.

Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![Amine\_Aloui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amine_aloui/32/46158_2.png) [@Amine\_Aloui](https://discuss.elastic.co/u/Amine_Aloui)\
**Post date:** [June 29, 2020, 12:30am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/7 "2020-06-29T00:30:56Z")

</div>

I add this option:

sudo vim /usr/lib/systemd/system/elasticsearch.service

```auto
 TimeoutStartSec=180

```

sudo sytemctl reload-daemon  
systemctl restart elasticsearch

```auto
root@xxxx:/home/user# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-06-29 00:20:32 UTC; 4s ago
     Docs: https://www.elastic.co
 Main PID: 20356 (java)
    Tasks: 78 (limit: 4613)
   CGroup: /system.slice/elasticsearch.service
           ├─20356 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encodin
           └─20571 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

```

It works perfectly now,  
this is the link of the solution,

[https://blog.sleeplessbeastie.eu/2020/02/29/how-to-prevent-systemd-service-start-operation-from-timing-out/](https://blog.sleeplessbeastie.eu/2020/02/29/how-to-prevent-systemd-service-start-operation-from-timing-out/)

---

<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:** [July 27, 2020, 12:31am UTC](https://discuss.elastic.co/t/elasticsearch-failed-when-i-try-to-setup-x-pack/238984/8 "2020-07-27T00:31:05Z")

</div>

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