# Elasticsearch listening on /127.0.0.1:9001 . Also shows Main PID: 12471 (code=exited, status=1/FAILURE) error messages- ubuntu server 16.04.3

**URL:** <https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810>\
**Category:** Elasticsearch\
**Created:** [January 10, 2018, 8:16am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810 "2018-01-10T08:16:43Z")\
**Posts on this page:** 7\
**Page:** 2

<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:** [January 11, 2018, 3:13pm UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/21 "2018-01-11T15:13:55Z")

</div>

Actually when I said

> Much better.

I was wrong. You are using the citation icon instead of `</>`.

So please fix the format. It should be like:

```auto
bsaitechnosales@storage:~/Downloads$ sudo /etc/init.d/elasticsearch start
Starting elasticsearch: /etc/init.d/elasticsearch: line 108: daemon:
command not found

bsaitechnosales@storage:~/Downloads$ sudo service elasticsearch status
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-01-11 16:59:06 +0545; 8s ago
Docs: http://www.elastic.co
Process: 28630 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 28630 (code=exited, status=1/FAILURE)

Jan 11 16:59:06 storage systemd[1]: Started Elasticsearch.
Jan 11 16:59:06 storage elasticsearch[28630]: /usr/share/elasticsearch/bin/elasticsearch-env: line 70: /etc/sysconfig/elasticsearch: Permission denied
Jan 11 16:59:06 storage systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 11 16:59:06 storage systemd[1]: elasticsearch.service: Unit entered failed state.
Jan 11 16:59:06 storage systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
...skipping...

```

Thanks.

Then about your question. This is important indeed:

> `line 70: /etc/sysconfig/elasticsearch: Permission denied`

It indicates that this file can not be read by elasticsearch. Which probably means that you did not clean all the existing files before reinstalling.

I'd probably check the rights for this file.

---

<div class="post-metadata">

**Author:** ![bsaitechnosales](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bsaitechnosales](https://discuss.elastic.co/u/bsaitechnosales)\
**Post date:** [January 12, 2018, 4:50am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/22 "2018-01-12T04:50:45Z")

</div>

lets do from start. I have uninstall elasticsearch in following way. Now  
let's start in a clean way. Please suggest me the steps for installing  
elasticsearch. This time i would like to follow your instructions

(1) Remove previous versions of ElasticSearch:

sudo apt-get --purge autoremove elasticsearch

(2) Remove the ElasticSearch directories:

sudo rm -rf /var/lib/elasticsearch/  
sudo rm -rf /etc/elasticsearch  
sudo rm -rf /opt/sonar/elasticsearch  
sudo rm -rf /usr/share/elasticsearch/

(3) Search and Remove  
bsaitechnosales@storage:~$ sudo find / "elasticsearch" | grep "elasticsearch"  
/etc/systemd/system/multi-user.target.wants/elasticsearch.service  
/root/Downloads/elasticsearch-6.1.1.rpm  
/root/Downloads/elasticsearch-2.3.1.deb  
/home/bsaitechnosales/Downloads/elasticsearch-6.1.1.rpm  
/tmp/hsperfdata\_elasticsearch  
find: ‘/run/user/1000/gvfs’: Permission denied  
/opt/sonar/lib/common/elasticsearch-rest-client-5.6.3.jar  
/opt/sonar/lib/common/elasticsearch-5.6.3.jar  
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/peek-1.0.1/lib/peek/adapters/elasticsearch.rb  
find: ‘elasticsearch’: No such file or directory  
bsaitechnosales@storage:~$ sudo rm -rf /tmp/hsperfdata\_elasticsearch  
bsaitechnosales@storage:~$ sudo rm -rf etc/systemd/system/multi-user.target.wants/elasticsearch\*

---

<div class="post-metadata">

**Author:** ![bsaitechnosales](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bsaitechnosales](https://discuss.elastic.co/u/bsaitechnosales)\
**Post date:** [January 12, 2018, 6:11am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/23 "2018-01-12T06:11:13Z")

</div>

David R u there ?

---

<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:** [January 12, 2018, 6:36am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/24 "2018-01-12T06:36:10Z")

</div>

Yes. But it happens that people are sleeping or doing other stuff.  
Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

Again, please format your code.

I can see by chance that Sonar is supposed to use a 5.6 version but you are trying to install a 6.1 version. There is a chance that this is not going to work.

Anyway, to install elasticsearch, please follow the guide @warkolm linked to previously.

---

<div class="post-metadata">

**Author:** ![bsaitechnosales](https://avatars.discourse-cdn.com/v4/letter/b/bbe5ce/32.png) [@bsaitechnosales](https://discuss.elastic.co/u/bsaitechnosales)\
**Post date:** [January 14, 2018, 4:36am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/25 "2018-01-14T04:36:54Z")

</div>

Once again would like to confirm first and then only i trigger the command. I will be following below steps for elasticsearch installation steps. Please guide me

**The below steps is taken from this url --\> [Install Elasticsearch with Debian Package | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html)**

> [@](#):
>
> **Download and install the Debian package manually**  
> edit
> 
> The Debian package for Elasticsearch v6.1.1 can be downloaded from the website and installed as follows:
> 
> wget [https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb)  
> wget [https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb.sha512](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb.sha512)  
> shasum -a 512 -c elasticsearch-6.1.1.deb.sha512  
> sudo dpkg -i elasticsearch-6.1.1.deb

**Also i have uninstall SONARQUBE as well**

> [@](#):
>
> root@storage:/home/bsaitechnosales# sudo find / "sonar" | grep "sonar" | morefind: ‘/run/user/1000/gvfs’: Permission denied  
> find: ‘sonar’: No such file or directory  
> /etc/init.d/sonar  
> /etc/rc3.d/S02sonar  
> /root/Downloads/sonar-scanner-msbuild-4.0.2.892.zip  
> /root/Downloads/sonarqube-6.7.1.zip  
> /home/bsaitechnosales/Downloads/sonar\_qube\_installation\_steps  
> /home/bsaitechnosales/Downloads/sonar-intellij-plugin-2.2.0.zip  
> /home/bsaitechnosales/Downloads/sonar-runner-dist-2.4.zip  
> /home/bsaitechnosales/sonar\_qube\_installation\_steps  
> root@storage:/home/bsaitechnosales#

Now would like to follow your footsteps for both eleasticsearch and sonarqube.

Awaiting for your response

---

<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:** [January 14, 2018, 5:16am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/26 "2018-01-14T05:16:51Z")

</div>

I can't tell for sonarqube and as I said at the beginning you should ask in sonarqube forums about this.

I just noted that IMO it's useless to install elasticsearch 6.x as Sonarqube seems to expect a version 5.x. But I imagine that sonarqube installation guide mentions that.

Then, if you install elasticsearch and follow the exact steps that you linked to, it should be fine. If not, please copy and paste here all the steps you did and the output of each command.

---

<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:** [February 11, 2018, 5:16am UTC](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810/27 "2018-02-11T05:16:54Z")

</div>

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

[Previous page](https://discuss.elastic.co/t/elasticsearch-listening-on-127-0-0-1-9001-also-shows-main-pid-12471-code-exited-status-1-failure-error-messages-ubuntu-server-16-04-3/114810.md?page=1)
