dwradcliffe / chef-solr

Chef cookbook for solr.
http://community.opscode.com/cookbooks/solr
MIT License
23 stars 39 forks source link

Add debian support. #5

Closed dkinzer closed 10 years ago

dkinzer commented 10 years ago

This PR adds a template init.d script that is specific to debian systems. (Tested on Ubuntu Precise64)


This PR also makes the following minor changes.

dkinzer commented 10 years ago

@dwradcliffe so that previous PR didn't work because I hadn't realized that the solr.jar file was in the example subfolder (it was bit of head scratcher for me :)

So I took the opportunity to make a couple of more changes that I elaborate on above.

dkinzer commented 10 years ago

Hey, @dwradcliffe... so as a solr newbie I came across a couple of things installing solr with this cookbook that you may be willing to address.

  1. The solr data directory is empty initially so even though solr is up an running the server throws because it has nothing to serve. If one overrides this directory with the example data, then one can see a running server. I overrode my data_dir locally with a value of /opt/solr/example/solr and that worked nicely for me. I'm not sure it makes sense to make that the default since an experienced user will prefer to use this cookbook with their own data anyway. Also, I don't know how many newbies play around with chef-cookbooks :) but maybe something in the README can give newbies a heads up.
  2. This cookbook uses the Jetty wrapper that comes in the example to serve solr. When I was doing research I kept getting results about Tomcat and Solr, which added to my confusion. What do you think about adding another recipe that uses the default recipe but then starts up the servlet using Tomcat? This would give users more of an option.
  3. Finally, the last point of confusion for me has been the security aspect. This cookbook uses the root user to run the server. So, potentially there is a risk that if and when the server gets compromised, then the attacker would have root access to the machine. I learned that when installing solr up with Tomcat a TOMCAT_USER gets created and used. Should this cookbook set up a jetty_user to serve solr?
dkinzer commented 10 years ago

OK, so I answered (3) by reading https://wiki.apache.org/solr/SolrSecurity

I found a much better init script on those pages that purportedly even works with cygwin; It also has the added benefit of starting up the service with a JETTY_USER if defined:

http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk/jetty-distribution/src/main/resources/bin/jetty.sh


Re. (2) I've decided that at least for my case using the included Jetty app makes the most sense since I only need the one solr instance.

dkinzer commented 10 years ago

OK, since I haven't heard from you I'm assuming that you are not interested in the changes I proposed. Therefore, I'm closing this PR and pursuing my concerns on my own. Thanks for the great jumping off point.

dwradcliffe commented 10 years ago

hey @dkinzer sorry for not responding. I was testing your changes over the weekend and haven't had time to finish testing. I hadn't heard of ark before, looks awesome and perfect for this. Hopefully I'll have time to finish testing and merge this in the next day or so.

dkinzer commented 10 years ago

@dwradcliffe OK, thanks. I was actually thinking of addressing some of the security concerns next (at the minimum not using the root user to start the solr daemon.

My goal is to set up solr chef cookbook specifically to run searches for a Drupal site. Something like:

https://www.lullabot.com/blog/article/installing-solr-use-drupal

They use Tomcat in that example, but that's an unnecessary complication IMHO. If someone wants to get up and running quickly it makes a lot more sense to use the server that comes with solr.