Install elsaticsearch on Ubuntu16

Is there a complete and definite guide for installing ES on Ubuntu16? I only find bits and pieces...

What I know so far is:

  1. Install Java

    apt-get update
    apt-get -y upgrade
    apt-get install default-jre
    apt-get install default-jdk
    add-apt-repository ppa:webupd8team/java
    apt-get update
    apt install oracle-java8-installer
    apt install oracle-java8-set-default
    javac -version

  2. Install elasticsearch

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz
    tar -xzf elasticsearch-6.2.4.tar.gz

  3. add non-root user (you cannot start ES as root) + change permissions of ES directories

    adduser nonroot
    chown -R root:nonroot elasticsearch-6.2.4
    chown -R root:nonroot elasticsearch-6.2.4/bin

  4. Now I can start ES as nonroot (su nonroot):

    cd elasticsearch-6.2.4/
    ./bin/elasticsearch

But now I get an error message:
"error: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker"

It has something to do with starting up Java as non-user. So I checked java-version as nonroot (javac -version) and I saw no version...

So I changed /etc/profile with:

nano /etc/profile

And added:
JAVA_HOME=/usr/lib/jvm/default-java
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

After a reboot I started ES as nonroot but I got the same error:
"error: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker"

The good thing is that I saw a java version as nonroot (java version "1.8.0_171)".

But what did I do wrong?

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