# Unable to start Elasticsearch 7.4.2 as service while installing with zip file in centos

**URL:** <https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052>\
**Category:** Elasticsearch\
**Created:** [March 4, 2020, 11:03am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052 "2020-03-04T11:03:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)\
**Post date:** [March 4, 2020, 11:03am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/1 "2020-03-04T11:03:14Z")

</div>

Hello,

I am not able to start elastic search 7.4.2 as service while using elastic search-7.4.2.zip file in centos.

Process of instalaltion:  
Step1 : download zip file  
Step 2: Extract in folder  
Step3 : Create service (elasticsearch-7.4.2.service) file in /usr/lib/systemd/system  
service file content is given below -  
[Unit]  
Description=Elasticsearch-7.4.2  
Documentation=http://www.elastic.co  
Wants=network-online.target  
After=network-online.target  
[Service]  
Environment=ES\_HOME=/opt/elasticsearch-7.4.2  
Environment=CONF\_DIR=/opt/elasticsearch-7.4.2/config  
Environment=DATA\_DIR=/opt/elasticsearch-7.4.2/data  
Environment=LOG\_DIR=/opt/elasticsearch-7.4.2/logs  
Environment=PID\_DIR=/opt/elasticsearch-7.4.2  
EnvironmentFile=-/opt/elasticsearch-7.4.2/elasticsearch-7.4.2

WorkingDirectory=/opt/elasticsearch-7.4.2  
User=elasticsearch-7.4.2  
Group=elasticsearch-7.4.2  
#ExecStartPre=/opt/elasticsearch-7.4.2/bin/elasticsearch-systemd-pre-exec  
ExecStart=/opt/elasticsearch-7.4.2/bin/elasticsearch -p {PID\_DIR}/elasticsearch.pid --quiet -Edefault.path.logs={LOG\_DIR} -Edefault.path.data={DATA\_DIR} -Edefault.path.conf={CONF\_DIR}

# StandardOutput is configured to redirect to journalctl since

# some error messages may be logged in standard output before

# elasticsearch logging system is initialized. Elasticsearch

# stores its logs in /var/log/elasticsearch and does not use

# journalctl by default. If the user also want to enable journalctl

# logging, user can simply remove the "quiet" option from ExecStart.

StandardOutput=journal  
StandardError=inherit

# Specifies the maximum file descriptor number that can be opened by this process

LimitNOFILE=65536

# Specifies the maximum number of processes

LimitNPROC=2048

# Specifies the maximum size of virtual memory

LimitAS=infinity

# Specifies the maximum file size

LimitFSIZE=infinity

# Specifies the maximum file size

LimitFSIZE=infinity

# Disable timeout logic and wait until process is stopped

TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process

KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group

KillMode=process

# Java process is never killed

SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143

SuccessExitStatus=143  
[Install]  
WantedBy=multi-user.target

# Built for distribution-7.4.2 (distribution)

After starting elastic search  
sudo systemctl start elasticsearch-7.4.2.service , i am getting error like below

sudo systemctl status elasticsearch-7.4.2.service  
elasticsearch-7.4.2.service: main process exited, code=exited, status=1/FAILURE  
Unit elasticsearch-7.4.2.service entered failed state.  
elasticsearch-7.4.2.service failed.

could you please help me out of this .

---

<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:** [March 4, 2020, 12:28pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/2 "2020-03-04T12:28:45Z")

</div>

Welcome!

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.

---

<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:** [March 4, 2020, 12:29pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/3 "2020-03-04T12:29:09Z")

</div>

Could you share elasticsearch logs as well?

---

<div class="post-metadata">

**Author:** ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)\
**Post date:** [March 4, 2020, 1:04pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/4 "2020-03-04T13:04:38Z")

</div>

Hi,

Thanks for your reply.  
log is not generating i am just sharing my service file and folder structure .

Check once let me know if you need anything.

Thanks,

Abhishek

 ![centos_elasticsearch](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a1214932074c8989a73a96da49ca20ff97ae3062.jpeg) ![elasticsearch_test](https://us1.discourse-cdn.com/elastic/original/3X/8/e/8ef54828d5605409dd015cfa4acda4d29432e405.jpeg)

---

<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:** [March 4, 2020, 3:02pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/5 "2020-03-04T15:02:18Z")

</div>

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

---

<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:** [March 4, 2020, 3:04pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/6 "2020-03-04T15:04:15Z")

</div>

May be something is wrong in your `elasticsearch.yml` file? Did you modify it?

Is it possible to use instead the rpm package which should configure everything for you?  
So follow the instructions in this guide: [https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html)

---

<div class="post-metadata">

**Author:** ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)\
**Post date:** [March 5, 2020, 5:27am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/7 "2020-03-05T05:27:22Z")

</div>

Hi,  
Thanks for your reply,  
Yes already i have verified with rpm , it is working fine but my challenge is use zip file where need to create service file manually.

I have mentioned two scenario for zip file  
Scenario 1:  
after installing execute ./elasticsearch & from bin file on that time it was working fine.

Scenario 2:  
After installing and creating service file, execute the below command  
systemctl start elasticsearch-7.4.2.service  
systemctl status elasticsearch-7.4.2.service

on that time i am getting error  
elasticsearch-7.4.2.service - Elasticsearch-7.4.2  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch-7.4.2.service; disabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Thu 2020-03-05 10:48:19 IST; 14s ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Process: 24229 ExecStart=/opt/elasticsearch-7.4.2/bin/elasticsearch -p {PID\_DIR}/elasticsearch.pid --quiet -Edefault.path.logs={LOG\_DIR} -Edefault.path.data={DATA\_DIR} -Edefault.path.conf={CONF\_DIR} (code=exited, status=1/FAILURE)  
Main PID: 24229 (code=exited, status=1/FAILURE)

elasticsearch-7.4.2.service: main process exited, code=exited, status=1/FAILURE  
Unit elasticsearch-7.4.2.service entered failed state.  
elasticsearch-7.4.2.service failed

---

<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:** [March 5, 2020, 7:32am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/8 "2020-03-05T07:32:19Z")

</div>

> [@abhishek1](#):
>
> Yes already i have verified with rpm , it is working fine but my challenge is use zip file where need to create service file manually.

Great. Wondering why you don't want to use the best practices here.  
May be you should look at the script that rpm created and uses them as a template?

I'm not on the ops side so I can't help more I'm afraid. May be others?

---

<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:** [April 2, 2020, 7:32am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-7-4-2-as-service-while-installing-with-zip-file-in-centos/222052/9 "2020-04-02T07:32:21Z")

</div>

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