Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

you must set ES_CLASSPATH #20

Closed
johnbeynon opened this issue Jul 19, 2012 · 17 comments
Closed

you must set ES_CLASSPATH #20

johnbeynon opened this issue Jul 19, 2012 · 17 comments

Comments

@johnbeynon
Copy link

I've just build a new server with your elasticsearch recipe - when I go to start it it says you must set ES_CLASSPATH - did I miss a step out? I don't think I did...

@karmi
Copy link
Contributor

karmi commented Jul 19, 2012

It depends on how you've built it and how are you starting elasticsearch. The ES_CLASSPATH environment variable is set in https://github.com/karmi/cookbook-elasticsearch/blob/master/templates/default/elasticsearch-env.sh.erb.

@johnbeynon
Copy link
Author

I've just added the elasticsearch recipe to my run_list - sudo elasticsearch start results in the error. I can see it's put a file in the /etc/rc5.d folder. Any help would be much appreciated.

@karmi
Copy link
Contributor

karmi commented Jul 19, 2012

You can do several things.

First, check the /usr/local/etc/elasticsearch/elasticsearch-env.sh file, if it contains proper locations. Then, check the service init file, if it contains correct ES_INCLUDE. If you made some customized configs (different paths etc.), check for them.

If the problem still persists, please store the content of the elasticsearch-env.sh and the init file in a gist/pastie/hastebin/etc and post here... Or try the #elasticsearch IRC channel, I'm there most of the time.

@johnbeynon
Copy link
Author

that's the thing - I haven't changed any paths, custom configs or anything...I'll dig some more and come back.

@karmi
Copy link
Contributor

karmi commented Jul 21, 2012

@johnbeynon Any news, or closing?

@johnbeynon
Copy link
Author

closing - no news, no further on - ended up hacking it together.

@vjpr
Copy link

vjpr commented Aug 20, 2012

I'm having same problem.

Running sudo elasticsearch shows that message.

Running /etc/init.d/elasticsearch start shows this message:

{0.19.8}: Initialization Failed ...
- NoClassSettingsException[Failed to load class setting [discovery.type] with value [ec2]]
    ClassNotFoundException[ec2]

@karmi
Copy link
Contributor

karmi commented Aug 20, 2012

@vjpr I need more info then. First thing, try to build a test machine with Vagrant (see https://github.com/karmi/cookbook-elasticsearch#testing-with-vagrant). Then, pastie/gist/hastebin/etc your Chef config (run_list, node config, etc)

@vjpr
Copy link

vjpr commented Aug 21, 2012

The issue seems to be that running 'elasticsearch' instead of
'/etc/init.d/elasticsearch start' after cookbook doesn't correctly set the
env vars. I don't think this is an issue.

I think my second error came from the 'elasticsearch::default' recipe
trying to install cloud aws plugin. I'll investigate further, I could have
messed it up with some manual commands.

On 21/08/2012, at 3:00 AM, Karel Minarik [email protected] wrote:

@vjpr https://github.com/vjpr I need more info then. First thing, try to
build a test machine with Vagrant (see
https://github.com/karmi/cookbook-elasticsearch#testing-with-vagrant).
Then, pastie/gist/hastebin/etc your Chef config (run_list, node config, etc)


Reply to this email directly or view it on
GitHubhttps://github.com/karmi/cookbook-elasticsearch/issues/20#issuecomment-7875881.

@karmi
Copy link
Contributor

karmi commented Aug 21, 2012

The issue seems to be that running 'elasticsearch' instead of
'/etc/init.d/elasticsearch start' after cookbook doesn't correctly set the
env vars.

Absolutely -- the elasticsearch script won't set any ENV variables. You have to use the service or the init script.

I think my second error came from the 'elasticsearch::default' recipe
trying to install cloud aws plugin. I'll investigate further, I could have
messed it up with some manual commands.

That would be very surprising. Report it please if that would be the case.

@maanas
Copy link

maanas commented Nov 4, 2012

Even with service wrapper i m getting this error.
Starting ElasticSearch...
Waiting for ElasticSearch...............................
WARNING: ElasticSearch may have failed to start.
service elasticsearch status
ElasticSearch is not running.
Please help.
On Command line i get this
bin/elasticsearch -f
bin/elasticsearch.in.sh: line 3: $ES_CLASSPATH:$ES_HOME/lib/${project.build.finalName}.jar:$ES_HOME/lib/:$ES_HOME/lib/sigar/: bad substitution
You must set the ES_CLASSPATH var

@rjurney
Copy link

rjurney commented Dec 28, 2012

I have this problem too. bin/elasticsearch -f should 'just work.' That it stopped working since 0.18.6 is a bug.

Can you please fix this bug? This makes elasticsearch much harder to use, especially for new users.

@karmi
Copy link
Contributor

karmi commented Dec 28, 2012

@rjurney I'm afraid I don't know what specific problem you have. Could you describe it in more detail so I can understand and reproduce it?

@Juul
Copy link

Juul commented Dec 29, 2012

This "bug" appears if you download the source release via e.g. http://www.elasticsearch.org/download/master/ instead of the release from http://www.elasticsearch.org/download/ and try to run elasticsearch without compiling.

Maybe adding some kind of notice on the http://www.elasticsearch.org/download/master/ page will avoid this being reported as an issue in the future.

@karmi
Copy link
Contributor

karmi commented Dec 29, 2012

@Juul Good point, but I can't figure out how it's related to the Chef cookbook? People change the download URL to master?

@rjurney
Copy link

rjurney commented Dec 29, 2012

My bad, it's not a cookbook issue. This is the only place I've seen it discussed, though.

@ghost
Copy link

ghost commented Oct 6, 2013

To any one who arrives here on the boat that I did ( compile ocd),
Ubuntu 12.04.2 LTS
Java version "1.6.0_26" ( installed via the file jre-6u34-linux-i586.bin)

Pull from git
Check what the official elasticsearch website says is release version ( or not )
check it out ( at least a stable one )
build using the command mvn clean package -DskipTests

When you run it you will run into some problems that I worked through by ( admittedly I don`t know what things fixed what problems )

Changing /bin/sh to /bin/bash in the files bin/elasticsearch bin/elasticsearch.in.sh
Checking that you are happy with line 50 of file /elasticsearch ( you may may not be )

Noticing that the file bin/elasticsearch.in.sh is a config file for the java machine and adding the line ES_CLASSPATH="target/classes:target/lib/*" BEFORE ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/*:$ES_HOME/lib/sigar/*

now you should be able to bring it up.


P.s
Elastic search is one of my favorite projects ever. TY for having have worked on it there is not a lot of source code you can read through thats is as exactly what it should be

Thank you

  • James

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants