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

Elasticsearch service restart at each chef run #104

Closed
kamaradclimber opened this issue Jun 26, 2013 · 11 comments
Closed

Elasticsearch service restart at each chef run #104

kamaradclimber opened this issue Jun 26, 2013 · 11 comments

Comments

@kamaradclimber
Copy link

Elasticsearch restart at each run due to ark provider which create a symlink and execute a ruby_blockat each run. I'll open a ticket in ark cookbook too.

@karmi
Copy link
Contributor

karmi commented Jun 26, 2013

Cool. Also please see: #98 (comment)

@kamaradclimber
Copy link
Author

yes indeed, if you don't use ark it will fix the issue
I can probably make a MR with rpm support if you want

@karmi
Copy link
Contributor

karmi commented Jun 26, 2013

"MR with rpm support"?

@kamaradclimber
Copy link
Author

merge request adding a way to download and install a rpm package for rhel family :)

@karmi
Copy link
Contributor

karmi commented Jun 26, 2013

There is some rudimentary support in https://github.com/elasticsearch/cookbook-elasticsearch/blob/master/recipes/rpm.rb to kick the tires and try it out.

As said in other issues, I'd like to move to a more fine grained layout, which would allow to install either from tar.gr, or .deb, or .rpm -- but we need to figure out how to properly set up configs, etc etc, and test the whole refactoring.

@nukemberg
Copy link

it seems the cookbook (with elasticsearch::default recipe) will remove /usr/local/elasticsearch due to resource bash "remove the elasticsearch user home"
changing the not_if condition to check for symlink as well as directory solves the issue:

home_dir = "#{node.elasticsearch[:dir]}/elasticsearch"
bash "remove the elasticsearch user home" do
  user    'root'
  code    "rm -rf  #{node.elasticsearch[:dir]}/elasticsearch"
  only_if { ::File.directory?(home_dir) and not ::File.symlink?(home_dir) }
end

@Pneumatus
Copy link

This issue also goes away if you drop back to ark 0.1.0. Ark 0.3.0 seems to trigger the restart where the older version does not.

@jsirex
Copy link

jsirex commented Jul 4, 2013

http://tickets.opscode.com/browse/COOK-2444 - may be this helps somebody...
And this: fewbytes-cookbooks/ark@a5f30f1

@dosercz
Copy link

dosercz commented Jul 4, 2013

I have updated ES cookbook today and I have the same problem, but downgrade ark to 0.1.0 helps and it's the simplest way for now, as recommends @Pneumatus

@karmi
Copy link
Contributor

karmi commented Aug 1, 2013

@avishai-ish-shalom Thanks for identifying the culprit for removing the /usr/local/elasticsearch directory

karmi added a commit that referenced this issue Aug 1, 2013
…mlink.

This means it was created by Ark, not by Chef when creating the user.

h/t: @avishai-ish-shalom

Related: #104
@karmi karmi closed this as completed in d73dae3 Aug 1, 2013
@karmi
Copy link
Contributor

karmi commented Aug 1, 2013

Everybody, this issue should now be solved -- no re-downloads or service restarts on each Chef run.

Verified in Vagrant and EC2 (both Chef-Solo only).

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