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

Comments

Projects
None yet
6 participants
@johnbeynon
Copy link

commented Jul 19, 2012

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Jul 19, 2012

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Jul 19, 2012

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

@karmi

This comment has been minimized.

Copy link
Member

commented Jul 21, 2012

@johnbeynon Any news, or closing?

@johnbeynon johnbeynon closed this Jul 23, 2012

@johnbeynon

This comment has been minimized.

Copy link
Author

commented Jul 23, 2012

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

@vjpr

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

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 notifications@github.com 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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Dec 29, 2012

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

@ghost

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.