Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing ElasticSearch on Ubuntu 12.04

I have a VM running Ubuntu 12.04, and am trying to install ElasticSearch. I have followed this gist in the best 'learn X the hard way' spirit, and everything installs fine - packages are downloaded, untarred, copied to right place etc.

The problem comes when I run it - either by calling:

$ /usr/local/share/elasticsearch/bin/elasticsearch

or by using the service wrapper ($ rselasticsearch console)

The output is logged to wrapper.log and is included below. I think that I may be having JAVA home / classpath issues, but am not sure.

Any help most gratefully received!

Running ElasticSearch...
wrapper  | Unable to write to the configured log directory: /usr/local/share/elasticsearch/logs (No such file or directory)
wrapper  |   The directory does not exist.
wrapper  | Unable to write to the configured log file: /usr/local/share/elasticsearch/logs/service.log (No such file or directory)
wrapper  |   Falling back to the default file in the current working directory: wrapper.log
wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 32-bit 3.5.14
wrapper  |   Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved.
wrapper  |     http://wrapper.tanukisoftware.com
wrapper  | 
wrapper  | Launching a JVM...
jvm 1    | WrapperManager: Initializing...
jvm 1    | WrapperSimpleApp Error: Unable to locate the class org.elasticsearch.bootstrap.ElasticSearchF : java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.ElasticSearchF
jvm 1    | 
jvm 1    | WrapperSimpleApp Usage:
jvm 1    |   java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class{/app_method}} [app_arguments]
jvm 1    | 
jvm 1    | Where:
jvm 1    |   app_class:      The fully qualified class name of the application to run.
jvm 1    |   app_arguments:  The arguments that would normally be passed to the
jvm 1    |                   application.
wrapper  | JVM exited while loading the application.
...
wrapper  | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
wrapper  |   There may be a configuration problem: please check the logs.
wrapper  | <-- Wrapper Stopped

Update

Given that we are now in 2016, the easiest way to run ES on Ubuntu is to use Docker. docker run elasticsearch will download the latest and run it in the foreground, and obviously you can run it as a daemon, or run a specific version (e.g. elasticsearch:1.7.2), and set the ports etc.

like image 366
Hugo Rodger-Brown Avatar asked Jan 11 '13 12:01

Hugo Rodger-Brown


2 Answers

Word of warning to anyone trying what I did before - the URL specified in the Gist is to the source version, not the compiled version, hence there being no *.class files.

You can use the Gist as is, but substitute the latest download URL from the ElasticSearch site instead of the github URL that is there at the moment, e.g.:

....
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
...

** This is the lastest version as of 20/5/2014. To get more updated version, visit this page, right click on the TAR link (under Downloads Section), copy the link and replace the wget argument in the first line.

like image 85
Hugo Rodger-Brown Avatar answered Oct 15 '22 10:10

Hugo Rodger-Brown


I installed elasticsearch the same way you did and ran into the same issue. In the end I fixed the issue by installing the compiled version rather than from github. It involves using the same steps as the gist, except use the tar from http://www.elasticsearch.org/download/2012/12/27/0.20.2.html rather than github. I forked and updated the gist, which is available at https://gist.github.com/4512530. Hope this helps.

like image 38
Scott Avatar answered Oct 15 '22 08:10

Scott