Ubuntu: Ubuntu 16.04 install ElasticSearch 5.x, failed to start



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.


Solution:1

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  


Solution: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


Solution:3

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  


Solution:4

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »