Ubuntu 16.04 install ElasticSearch 5.x, failed to start












3















On fresh install Ubuntu 16.04 I use next steps to install ElasticSearch 5.0.1 or 5.0.2 and ES failed to start. Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?




  1. su

  2. add-apt-repository ppa:webupd8team/java

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install oracle-java8-installer

  6. java -version

  7. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

  8. apt-get install apt-transport-https

  9. echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list


  10. apt-get update && sudo apt-get install elasticsearch


  11. service elasticsearch status



Elasticsearch 5.x failed to start on Ubuntu 16.04.
Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?



I also try with the new version of Elasticsearch 5.1.1 with this few steps




  1. su

  2. apt-get purge elasticsearch

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install elasticsearch


-- new version elasticsearch 5.1.1 is installed




  1. now if I check status I get this




service elasticsearch status





● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)



Active: inactive (dead)



 Docs: http : / / www.elastic.co


Dec 09 22:49:49 elastic systemd[1]: Stopped Elasticsearch.










share|improve this question

























  • Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

    – origaminal
    May 24 '17 at 22:58
















3















On fresh install Ubuntu 16.04 I use next steps to install ElasticSearch 5.0.1 or 5.0.2 and ES failed to start. Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?




  1. su

  2. add-apt-repository ppa:webupd8team/java

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install oracle-java8-installer

  6. java -version

  7. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

  8. apt-get install apt-transport-https

  9. echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list


  10. apt-get update && sudo apt-get install elasticsearch


  11. service elasticsearch status



Elasticsearch 5.x failed to start on Ubuntu 16.04.
Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?



I also try with the new version of Elasticsearch 5.1.1 with this few steps




  1. su

  2. apt-get purge elasticsearch

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install elasticsearch


-- new version elasticsearch 5.1.1 is installed




  1. now if I check status I get this




service elasticsearch status





● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)



Active: inactive (dead)



 Docs: http : / / www.elastic.co


Dec 09 22:49:49 elastic systemd[1]: Stopped Elasticsearch.










share|improve this question

























  • Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

    – origaminal
    May 24 '17 at 22:58














3












3








3


2






On fresh install Ubuntu 16.04 I use next steps to install ElasticSearch 5.0.1 or 5.0.2 and ES failed to start. Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?




  1. su

  2. add-apt-repository ppa:webupd8team/java

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install oracle-java8-installer

  6. java -version

  7. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

  8. apt-get install apt-transport-https

  9. echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list


  10. apt-get update && sudo apt-get install elasticsearch


  11. service elasticsearch status



Elasticsearch 5.x failed to start on Ubuntu 16.04.
Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?



I also try with the new version of Elasticsearch 5.1.1 with this few steps




  1. su

  2. apt-get purge elasticsearch

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install elasticsearch


-- new version elasticsearch 5.1.1 is installed




  1. now if I check status I get this




service elasticsearch status





● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)



Active: inactive (dead)



 Docs: http : / / www.elastic.co


Dec 09 22:49:49 elastic systemd[1]: Stopped Elasticsearch.










share|improve this question
















On fresh install Ubuntu 16.04 I use next steps to install ElasticSearch 5.0.1 or 5.0.2 and ES failed to start. Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?




  1. su

  2. add-apt-repository ppa:webupd8team/java

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install oracle-java8-installer

  6. java -version

  7. wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

  8. apt-get install apt-transport-https

  9. echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list


  10. apt-get update && sudo apt-get install elasticsearch


  11. service elasticsearch status



Elasticsearch 5.x failed to start on Ubuntu 16.04.
Does anyone know how can I run ES 5.x on Ubuntu 16.04 or 14.04?



I also try with the new version of Elasticsearch 5.1.1 with this few steps




  1. su

  2. apt-get purge elasticsearch

  3. apt-get update

  4. apt-get upgrade

  5. apt-get install elasticsearch


-- new version elasticsearch 5.1.1 is installed




  1. now if I check status I get this




service elasticsearch status





● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)



Active: inactive (dead)



 Docs: http : / / www.elastic.co


Dec 09 22:49:49 elastic systemd[1]: Stopped Elasticsearch.







14.04 16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 9 '16 at 22:13







Pajsije

















asked Nov 24 '16 at 12:10









PajsijePajsije

7629




7629













  • Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

    – origaminal
    May 24 '17 at 22:58



















  • Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

    – origaminal
    May 24 '17 at 22:58

















Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

– origaminal
May 24 '17 at 22:58





Also it's worth to check whether java is installed. Cause the log message that no java binaries available falls into journalctl not under elasticsearch.service tag.

– origaminal
May 24 '17 at 22:58










5 Answers
5






active

oldest

votes


















2














I had the same issue and I saw that the group of my elasticsearch.yml file was not right. You can check it by using:



ubuntu@mymachine:~$ sudo ls -al /etc/elasticsearch/
total 24
drwxr-x--- 3 root elasticsearch 4096 Dec 19 10:58 .
drwxr-xr-x 94 root root 4096 Dec 19 10:58 ..
-rw-rw---- 1 root elasticsearch 3069 Dec 6 12:39 elasticsearch.yml
-rw-rw---- 1 root elasticsearch 2862 Dec 6 12:39 jvm.options
-rw-rw---- 1 root elasticsearch 3992 Dec 6 12:39 log4j2.properties
drwxr-x--- 2 root elasticsearch 4096 Dec 6 12:39 scripts


It can be that the elasticsearch.yml is in the root group.



-rw-rw----  1 root root   3069 Dec  6 12:39 elasticsearch.yml


When I changed the group I was able to start elasticsearch again.



$ sudo chgrp elasticsearch /etc/elasticsearch/elasticsearch.yml





share|improve this answer
























  • Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

    – Pajsije
    Dec 19 '16 at 22:41



















2














I was sceptical and thought I would not be able to find the answer to this question but your (@user305883) advice turned out to be a good. Thanks for help.



I changed /etc/elasticsearch/jvm.option -Xms2g and -Xmx2g to #-Xms2g and #-Xmx2g and on ubuntu terminal after I run this command



service elasticsearch start



ES run well on Ubuntu 16.04.



This was right answer. Thanks again to @user305883.
stackoverflow






share|improve this answer

































    1














    Worked for me. My jvm.options file:



    ## JVM configuration

    ################################################################
    ## IMPORTANT: JVM heap size
    ################################################################
    ##
    ## You should always set the min and max JVM heap
    ## size to the same value. For example, to set
    ## the heap to 4 GB, set:
    ##
    ## -Xms4g
    ## -Xmx4g
    ##
    ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
    ## for more information
    ##
    ################################################################

    # Xms represents the initial size of total heap space
    # Xmx represents the maximum size of total heap space


    --- Commented out ---



    #-Xms2g
    #-Xmx2g


    --- Commented out ---



    ```


    Worked for me as above. Thank you.






    share|improve this answer
























    • Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

      – Matt Janda
      Mar 27 '17 at 0:16





















    1














    I have been facing the same issue (i.e permission denied error while accessing /etc/elasticsearch), I have installed ES 6.0.1 and somehow my ES was failed to start. I came to know that my ES service script located in /etc/init.d/elasticsearch can not be able to read the following files need to run ES:
    1) /etc/elasticsearch/elasticsearch.yml
    2) /etc/elasticsearch/jvm.options
    3) /etc/elasticsearch/log4j2.properties



    So, what I did is first given elasticsearch the executable rights:



    /etc$ sudo chmod +x elasticsearch


    Then after, I given the permission of all the files located in /etc/elasticsearch like this:



    /etc/elasticsearch$ sudo chmod 777 .


    And then I just restart ES Like this:



    sudo systemctl restart elasticsearch


    Now, ES is working fine and you can test it by issuing following command



    curl -X GET "localhost:9200"





    share|improve this answer































      0














      make sure /etc/elasticsearch/log4j2.properties exists, otherwise create it:



      appender.console.type = Console
      appender.console.name = console
      appender.console.layout.type = PatternLayout
      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n

      rootLogger.level = info
      rootLogger.appenderRef.console.ref = console





      share|improve this answer


























      • On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

        – Pajsije
        Dec 6 '16 at 4:10













      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f853100%2fubuntu-16-04-install-elasticsearch-5-x-failed-to-start%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      I had the same issue and I saw that the group of my elasticsearch.yml file was not right. You can check it by using:



      ubuntu@mymachine:~$ sudo ls -al /etc/elasticsearch/
      total 24
      drwxr-x--- 3 root elasticsearch 4096 Dec 19 10:58 .
      drwxr-xr-x 94 root root 4096 Dec 19 10:58 ..
      -rw-rw---- 1 root elasticsearch 3069 Dec 6 12:39 elasticsearch.yml
      -rw-rw---- 1 root elasticsearch 2862 Dec 6 12:39 jvm.options
      -rw-rw---- 1 root elasticsearch 3992 Dec 6 12:39 log4j2.properties
      drwxr-x--- 2 root elasticsearch 4096 Dec 6 12:39 scripts


      It can be that the elasticsearch.yml is in the root group.



      -rw-rw----  1 root root   3069 Dec  6 12:39 elasticsearch.yml


      When I changed the group I was able to start elasticsearch again.



      $ sudo chgrp elasticsearch /etc/elasticsearch/elasticsearch.yml





      share|improve this answer
























      • Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

        – Pajsije
        Dec 19 '16 at 22:41
















      2














      I had the same issue and I saw that the group of my elasticsearch.yml file was not right. You can check it by using:



      ubuntu@mymachine:~$ sudo ls -al /etc/elasticsearch/
      total 24
      drwxr-x--- 3 root elasticsearch 4096 Dec 19 10:58 .
      drwxr-xr-x 94 root root 4096 Dec 19 10:58 ..
      -rw-rw---- 1 root elasticsearch 3069 Dec 6 12:39 elasticsearch.yml
      -rw-rw---- 1 root elasticsearch 2862 Dec 6 12:39 jvm.options
      -rw-rw---- 1 root elasticsearch 3992 Dec 6 12:39 log4j2.properties
      drwxr-x--- 2 root elasticsearch 4096 Dec 6 12:39 scripts


      It can be that the elasticsearch.yml is in the root group.



      -rw-rw----  1 root root   3069 Dec  6 12:39 elasticsearch.yml


      When I changed the group I was able to start elasticsearch again.



      $ sudo chgrp elasticsearch /etc/elasticsearch/elasticsearch.yml





      share|improve this answer
























      • Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

        – Pajsije
        Dec 19 '16 at 22:41














      2












      2








      2







      I had the same issue and I saw that the group of my elasticsearch.yml file was not right. You can check it by using:



      ubuntu@mymachine:~$ sudo ls -al /etc/elasticsearch/
      total 24
      drwxr-x--- 3 root elasticsearch 4096 Dec 19 10:58 .
      drwxr-xr-x 94 root root 4096 Dec 19 10:58 ..
      -rw-rw---- 1 root elasticsearch 3069 Dec 6 12:39 elasticsearch.yml
      -rw-rw---- 1 root elasticsearch 2862 Dec 6 12:39 jvm.options
      -rw-rw---- 1 root elasticsearch 3992 Dec 6 12:39 log4j2.properties
      drwxr-x--- 2 root elasticsearch 4096 Dec 6 12:39 scripts


      It can be that the elasticsearch.yml is in the root group.



      -rw-rw----  1 root root   3069 Dec  6 12:39 elasticsearch.yml


      When I changed the group I was able to start elasticsearch again.



      $ sudo chgrp elasticsearch /etc/elasticsearch/elasticsearch.yml





      share|improve this answer













      I had the same issue and I saw that the group of my elasticsearch.yml file was not right. You can check it by using:



      ubuntu@mymachine:~$ sudo ls -al /etc/elasticsearch/
      total 24
      drwxr-x--- 3 root elasticsearch 4096 Dec 19 10:58 .
      drwxr-xr-x 94 root root 4096 Dec 19 10:58 ..
      -rw-rw---- 1 root elasticsearch 3069 Dec 6 12:39 elasticsearch.yml
      -rw-rw---- 1 root elasticsearch 2862 Dec 6 12:39 jvm.options
      -rw-rw---- 1 root elasticsearch 3992 Dec 6 12:39 log4j2.properties
      drwxr-x--- 2 root elasticsearch 4096 Dec 6 12:39 scripts


      It can be that the elasticsearch.yml is in the root group.



      -rw-rw----  1 root root   3069 Dec  6 12:39 elasticsearch.yml


      When I changed the group I was able to start elasticsearch again.



      $ sudo chgrp elasticsearch /etc/elasticsearch/elasticsearch.yml






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Dec 19 '16 at 11:14









      SebastienPattynSebastienPattyn

      5931419




      5931419













      • Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

        – Pajsije
        Dec 19 '16 at 22:41



















      • Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

        – Pajsije
        Dec 19 '16 at 22:41

















      Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

      – Pajsije
      Dec 19 '16 at 22:41





      Thank's for advise, but I still can not run ES on Ubuntu even if I try to change the group of a file as you said. I get: Loaded: loaded, Active: failed, elasticsearch.service: Failed with result exit-code.

      – Pajsije
      Dec 19 '16 at 22:41













      2














      I was sceptical and thought I would not be able to find the answer to this question but your (@user305883) advice turned out to be a good. Thanks for help.



      I changed /etc/elasticsearch/jvm.option -Xms2g and -Xmx2g to #-Xms2g and #-Xmx2g and on ubuntu terminal after I run this command



      service elasticsearch start



      ES run well on Ubuntu 16.04.



      This was right answer. Thanks again to @user305883.
      stackoverflow






      share|improve this answer






























        2














        I was sceptical and thought I would not be able to find the answer to this question but your (@user305883) advice turned out to be a good. Thanks for help.



        I changed /etc/elasticsearch/jvm.option -Xms2g and -Xmx2g to #-Xms2g and #-Xmx2g and on ubuntu terminal after I run this command



        service elasticsearch start



        ES run well on Ubuntu 16.04.



        This was right answer. Thanks again to @user305883.
        stackoverflow






        share|improve this answer




























          2












          2








          2







          I was sceptical and thought I would not be able to find the answer to this question but your (@user305883) advice turned out to be a good. Thanks for help.



          I changed /etc/elasticsearch/jvm.option -Xms2g and -Xmx2g to #-Xms2g and #-Xmx2g and on ubuntu terminal after I run this command



          service elasticsearch start



          ES run well on Ubuntu 16.04.



          This was right answer. Thanks again to @user305883.
          stackoverflow






          share|improve this answer















          I was sceptical and thought I would not be able to find the answer to this question but your (@user305883) advice turned out to be a good. Thanks for help.



          I changed /etc/elasticsearch/jvm.option -Xms2g and -Xmx2g to #-Xms2g and #-Xmx2g and on ubuntu terminal after I run this command



          service elasticsearch start



          ES run well on Ubuntu 16.04.



          This was right answer. Thanks again to @user305883.
          stackoverflow







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 23 '17 at 12:39









          Community

          1




          1










          answered Dec 28 '16 at 3:29









          PajsijePajsije

          7629




          7629























              1














              Worked for me. My jvm.options file:



              ## JVM configuration

              ################################################################
              ## IMPORTANT: JVM heap size
              ################################################################
              ##
              ## You should always set the min and max JVM heap
              ## size to the same value. For example, to set
              ## the heap to 4 GB, set:
              ##
              ## -Xms4g
              ## -Xmx4g
              ##
              ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
              ## for more information
              ##
              ################################################################

              # Xms represents the initial size of total heap space
              # Xmx represents the maximum size of total heap space


              --- Commented out ---



              #-Xms2g
              #-Xmx2g


              --- Commented out ---



              ```


              Worked for me as above. Thank you.






              share|improve this answer
























              • Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

                – Matt Janda
                Mar 27 '17 at 0:16


















              1














              Worked for me. My jvm.options file:



              ## JVM configuration

              ################################################################
              ## IMPORTANT: JVM heap size
              ################################################################
              ##
              ## You should always set the min and max JVM heap
              ## size to the same value. For example, to set
              ## the heap to 4 GB, set:
              ##
              ## -Xms4g
              ## -Xmx4g
              ##
              ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
              ## for more information
              ##
              ################################################################

              # Xms represents the initial size of total heap space
              # Xmx represents the maximum size of total heap space


              --- Commented out ---



              #-Xms2g
              #-Xmx2g


              --- Commented out ---



              ```


              Worked for me as above. Thank you.






              share|improve this answer
























              • Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

                – Matt Janda
                Mar 27 '17 at 0:16
















              1












              1








              1







              Worked for me. My jvm.options file:



              ## JVM configuration

              ################################################################
              ## IMPORTANT: JVM heap size
              ################################################################
              ##
              ## You should always set the min and max JVM heap
              ## size to the same value. For example, to set
              ## the heap to 4 GB, set:
              ##
              ## -Xms4g
              ## -Xmx4g
              ##
              ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
              ## for more information
              ##
              ################################################################

              # Xms represents the initial size of total heap space
              # Xmx represents the maximum size of total heap space


              --- Commented out ---



              #-Xms2g
              #-Xmx2g


              --- Commented out ---



              ```


              Worked for me as above. Thank you.






              share|improve this answer













              Worked for me. My jvm.options file:



              ## JVM configuration

              ################################################################
              ## IMPORTANT: JVM heap size
              ################################################################
              ##
              ## You should always set the min and max JVM heap
              ## size to the same value. For example, to set
              ## the heap to 4 GB, set:
              ##
              ## -Xms4g
              ## -Xmx4g
              ##
              ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
              ## for more information
              ##
              ################################################################

              # Xms represents the initial size of total heap space
              # Xmx represents the maximum size of total heap space


              --- Commented out ---



              #-Xms2g
              #-Xmx2g


              --- Commented out ---



              ```


              Worked for me as above. Thank you.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 26 '17 at 23:36









              Matt JandaMatt Janda

              111




              111













              • Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

                – Matt Janda
                Mar 27 '17 at 0:16





















              • Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

                – Matt Janda
                Mar 27 '17 at 0:16



















              Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

              – Matt Janda
              Mar 27 '17 at 0:16







              Above solution will work if you do not set network.host in yml file. WHEN YOU SET e.g. *** network.host: "192.168.1.72" *** in elasticsearch.yml file it stopped starting again. :) I found in logs that it actually now need the same initial and maximum size of heap so I HAVE UNCOMMENTED -Xmg2g and -Xmx2g

              – Matt Janda
              Mar 27 '17 at 0:16













              1














              I have been facing the same issue (i.e permission denied error while accessing /etc/elasticsearch), I have installed ES 6.0.1 and somehow my ES was failed to start. I came to know that my ES service script located in /etc/init.d/elasticsearch can not be able to read the following files need to run ES:
              1) /etc/elasticsearch/elasticsearch.yml
              2) /etc/elasticsearch/jvm.options
              3) /etc/elasticsearch/log4j2.properties



              So, what I did is first given elasticsearch the executable rights:



              /etc$ sudo chmod +x elasticsearch


              Then after, I given the permission of all the files located in /etc/elasticsearch like this:



              /etc/elasticsearch$ sudo chmod 777 .


              And then I just restart ES Like this:



              sudo systemctl restart elasticsearch


              Now, ES is working fine and you can test it by issuing following command



              curl -X GET "localhost:9200"





              share|improve this answer




























                1














                I have been facing the same issue (i.e permission denied error while accessing /etc/elasticsearch), I have installed ES 6.0.1 and somehow my ES was failed to start. I came to know that my ES service script located in /etc/init.d/elasticsearch can not be able to read the following files need to run ES:
                1) /etc/elasticsearch/elasticsearch.yml
                2) /etc/elasticsearch/jvm.options
                3) /etc/elasticsearch/log4j2.properties



                So, what I did is first given elasticsearch the executable rights:



                /etc$ sudo chmod +x elasticsearch


                Then after, I given the permission of all the files located in /etc/elasticsearch like this:



                /etc/elasticsearch$ sudo chmod 777 .


                And then I just restart ES Like this:



                sudo systemctl restart elasticsearch


                Now, ES is working fine and you can test it by issuing following command



                curl -X GET "localhost:9200"





                share|improve this answer


























                  1












                  1








                  1







                  I have been facing the same issue (i.e permission denied error while accessing /etc/elasticsearch), I have installed ES 6.0.1 and somehow my ES was failed to start. I came to know that my ES service script located in /etc/init.d/elasticsearch can not be able to read the following files need to run ES:
                  1) /etc/elasticsearch/elasticsearch.yml
                  2) /etc/elasticsearch/jvm.options
                  3) /etc/elasticsearch/log4j2.properties



                  So, what I did is first given elasticsearch the executable rights:



                  /etc$ sudo chmod +x elasticsearch


                  Then after, I given the permission of all the files located in /etc/elasticsearch like this:



                  /etc/elasticsearch$ sudo chmod 777 .


                  And then I just restart ES Like this:



                  sudo systemctl restart elasticsearch


                  Now, ES is working fine and you can test it by issuing following command



                  curl -X GET "localhost:9200"





                  share|improve this answer













                  I have been facing the same issue (i.e permission denied error while accessing /etc/elasticsearch), I have installed ES 6.0.1 and somehow my ES was failed to start. I came to know that my ES service script located in /etc/init.d/elasticsearch can not be able to read the following files need to run ES:
                  1) /etc/elasticsearch/elasticsearch.yml
                  2) /etc/elasticsearch/jvm.options
                  3) /etc/elasticsearch/log4j2.properties



                  So, what I did is first given elasticsearch the executable rights:



                  /etc$ sudo chmod +x elasticsearch


                  Then after, I given the permission of all the files located in /etc/elasticsearch like this:



                  /etc/elasticsearch$ sudo chmod 777 .


                  And then I just restart ES Like this:



                  sudo systemctl restart elasticsearch


                  Now, ES is working fine and you can test it by issuing following command



                  curl -X GET "localhost:9200"






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 4 at 6:04









                  ARKhanARKhan

                  111




                  111























                      0














                      make sure /etc/elasticsearch/log4j2.properties exists, otherwise create it:



                      appender.console.type = Console
                      appender.console.name = console
                      appender.console.layout.type = PatternLayout
                      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n

                      rootLogger.level = info
                      rootLogger.appenderRef.console.ref = console





                      share|improve this answer


























                      • On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                        – Pajsije
                        Dec 6 '16 at 4:10


















                      0














                      make sure /etc/elasticsearch/log4j2.properties exists, otherwise create it:



                      appender.console.type = Console
                      appender.console.name = console
                      appender.console.layout.type = PatternLayout
                      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n

                      rootLogger.level = info
                      rootLogger.appenderRef.console.ref = console





                      share|improve this answer


























                      • On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                        – Pajsije
                        Dec 6 '16 at 4:10
















                      0












                      0








                      0







                      make sure /etc/elasticsearch/log4j2.properties exists, otherwise create it:



                      appender.console.type = Console
                      appender.console.name = console
                      appender.console.layout.type = PatternLayout
                      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n

                      rootLogger.level = info
                      rootLogger.appenderRef.console.ref = console





                      share|improve this answer















                      make sure /etc/elasticsearch/log4j2.properties exists, otherwise create it:



                      appender.console.type = Console
                      appender.console.name = console
                      appender.console.layout.type = PatternLayout
                      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n

                      rootLogger.level = info
                      rootLogger.appenderRef.console.ref = console






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 29 '16 at 21:54









                      bummi

                      3802713




                      3802713










                      answered Nov 29 '16 at 21:41









                      itiiti

                      1




                      1













                      • On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                        – Pajsije
                        Dec 6 '16 at 4:10





















                      • On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                        – Pajsije
                        Dec 6 '16 at 4:10



















                      On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                      – Pajsije
                      Dec 6 '16 at 4:10







                      On fresh install Ubuntu 16.04 after I install elasticsearch 5.0.1 or 5.0.2 with update, log4j2.properties file exist in /etc/elasticsearch directory & ES is failed to start. This is not the right answer.

                      – Pajsije
                      Dec 6 '16 at 4:10




















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f853100%2fubuntu-16-04-install-elasticsearch-5-x-failed-to-start%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅