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

Failure when adding elasticsearch service #204

Closed
ajardan opened this issue Apr 24, 2014 · 18 comments
Closed

Failure when adding elasticsearch service #204

ajardan opened this issue Apr 24, 2014 · 18 comments

Comments

@ajardan
Copy link

ajardan commented Apr 24, 2014

[2014-04-24T08:56:59+00:00] DEBUG: Chef::Exceptions::Exec: service[elasticsearch] (elasticsearch::default line 65) had an error: Chef::Exceptions::Exec: /usr/sbin/update-rc.d elasticsearch defaults returned 1, expected 0
---- Begin output of /usr/sbin/update-rc.d elasticsearch defaults ----
STDOUT: update-rc.d: using dependency based boot sequencingSTDERR: insserv: warning: script 'elasticsearch' missing LSB tags and overrides
insserv: There is a loop between service monit and elasticsearch if stopped
insserv:  loop involving service elasticsearch at depth 2
insserv:  loop involving service monit at depth 1
insserv: Stopping elasticsearch depends on monit and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
---- End output of /usr/sbin/update-rc.d elasticsearch defaults ----
@michaeldeman
Copy link

It would be helpful to know what cookbook version are you using and what version of elasticsearch are you installing.

@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

Well, it didn't get to downloading ES itself (however I'm trying to install 0.20.5), the cookbook version is 0.3.8

@michaeldeman
Copy link

Should be ES 1.0 or higher unless I am misunderstanding things. Also for a first dry-run install no need to have monit and such enabled? I don't think the cookbook will work with anything less than elastic search version 0.90.x (where I am not even sure about x).

@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

It is not possible to install an earlier version ? monit is part of our infrastructure and cannot be excluded unfortunately, but anyway it shouldn't generate such an error even with an old version of ES (as I don't get to the point where it is downloaded, the init script is generated from a template as I can see), and monit shouldn't also be the root caus of the issue ?

@michaeldeman
Copy link

I don't know for sure, but I think the cookbook is oriented around 1.x and higher. I have installed 0.90.x before with it and it worked before.

Monit should be fine, normal stuff, I just don't think the install scripts in the cookbook are going to work right with this version of the cookbook against old version of ES like that.
Even from 0.9 to 1.0 there were changes in startup scripts and such like '-d' for elastic search to specify daemon mode.

@michaeldeman
Copy link

are you trying to install via .gz or via RPM?

@michaeldeman
Copy link

Above was for linux related deployments as well, it should be easy to make a quick cookbook if you need to install ES to other platforms like FreeBSD, Solaris, or Linux/Solaris slices on IBM/Fujitzu z-systems, etc. Everything you need can unbundle into /opt or wherever you want it, only thing the cookbook really does is help with the /etc/rc.d script configurations. Plus cookbook also has monit and other configs that maybe you might or might not want or could be wreaking havoc with conflicts against your existing monit. Most ES deployments are fairly custom to the user's environment and I think they provided this cookbook as sort of a 'get started on a linux box quick' rather than for real world environments.

@karmi
Copy link
Contributor

karmi commented Apr 24, 2014

@ajardan Hmm, never saw this error pop up. In either case, 0.20 is an ancient Elasticsearch version, you shouldn't really use it for anything serious. (Moreover, the cookbook does indeed assume 1.0 or recent versions)

@michaeldeman Thanks for helping here!

@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

Thank you for your help guys !

I still don't know how all this (I mean old ES, etc) would lead to such an error, it looks more like an issue in the init script, but that's not important anymore.

@karmi
Copy link
Contributor

karmi commented Apr 24, 2014

Most ES deployments are fairly custom to the user's environment and I think they provided this cookbook as sort of a 'get started on a linux box quick' rather than for real world environments.

@michaeldeman Not really, the cookbook is used in many real world environments :)

@karmi
Copy link
Contributor

karmi commented Apr 24, 2014

@ajardan So, how did you resolve it in the end?

@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

I didn't. I will write a custom cookbook as I don't need all the features from this one.

@karmi
Copy link
Contributor

karmi commented Apr 24, 2014

@ajardan Fair! Just please don't use Elasticsearch 0.20, the recent versions have been significantly improved.

@karmi karmi closed this as completed Apr 24, 2014
@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

I believe the issue is related to the fact the init script is for RedHat based distros, and I was trying to deploy a Debian machine.

It is probably a good idea to add a debian init script which should help people in the future :)

@karmi
Copy link
Contributor

karmi commented Apr 24, 2014

Actually, the init script has separate paths for Debain and Redhat based distros: https://github.com/elasticsearch/cookbook-elasticsearch/blob/master/templates/default/elasticsearch.init.erb#L43

@ajardan
Copy link
Author

ajardan commented Apr 24, 2014

Yeah, but this part should also be different for Debian:

# chkconfig:   - 57 47
# description: elasticsearch
# processname: elasticsearch
# config:      <%= node[:elasticsearch][:path][:conf] %>/elasticsearch.yml

I would say something like

### BEGIN INIT INFO
# Provides:          elasticsearch
# Required-Start:    $network $remote_fs $named
# Required-Stop:     $network $remote_fs $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts elasticsearch
# Description:       Starts elasticsearch using start-stop-daemon
### END INIT INFO

@ajardan
Copy link
Author

ajardan commented Apr 25, 2014

Anyone available to review this ? I could still use this if it works with the patch :)

@karmi ?

@karmi
Copy link
Contributor

karmi commented Apr 25, 2014

@ajardan I'll try to verify it on Centos and Ubuntu in Vagrant soon, thanks for the patch!

karmi pushed a commit that referenced this issue May 6, 2014
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

3 participants