Note that there are some explanatory texts on larger screens.

plurals
  1. POSolr/Jetty confusion - how to get persistent service?
    primarykey
    data
    text
    <p>I'm on Ubuntu 12.04, using jetty (9_M4), solr (4.0.0) through django-haystack (2.0beta) installed in a django 1.4.2 site.</p> <p>I've had to make a number of jumps through hoops to get this up and running, as there is very little documentation for getting solr 4.0 up and running in Ubuntu with django-haystack. But how hard could it be?</p> <p>My main confusion is between what Jetty is doing, and what Solr is doing.</p> <p>So, I <a href="http://pietervogelaar.nl/ubuntu-12-04-install-jetty-9" rel="nofollow">installed Jetty via this tutorial</a> making a small adjustment to the init file <a href="http://pietervogelaar.nl/ubuntu-12-04-install-jetty-9/#comment-1729" rel="nofollow">as I note in the comment on that tutorial</a>. Jetty is now running, I can see it in browser, even after a reboot.</p> <p>Great. </p> <p>Move onto <a href="http://pietervogelaar.nl/ubuntu-12-04-install-solr-4-with-jetty-9/" rel="nofollow">installing Solr via this tutorial</a> again with adjustments. Instead of:</p> <pre><code>cp -R apache-solr-4.0.0/example/solr /opt </code></pre> <p>I use:</p> <pre><code>cp -R apache-solr-4.0.0/example/* /opt/solr/ </code></pre> <p>and therefore add the following to /etc/default/jetty:</p> <pre><code>JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr/solr $JAVA_OPTIONS" </code></pre> <p>I can't exactly remember why I did that, but there was a reason at the time. I stop using that tutorial at that point, as I don't understand the solr concept of core very well, and I'm already flustered at how annoyingly difficult this is.</p> <p>(For context, when I set up django-haystack 2.0 with solr 3.5 about 6 months ago it was terrifyingly easy and didn't require a separate jetty installation - all up took me about two hours)</p> <p>Anyway, I go back to my Django installation, create the schema.xml, make the stopwords-en.txt changes, copy it across to /opt/solr/solr/collection1/conf.</p> <p>I edit /opt/solr/solr/collection1/conf/solrconfig.xml to remove the reference to updateLog since any attempt I made to add <em>version</em> field to schema.xml failed dismally with some sort of character error. See <a href="http://osdir.com/ml/solr-user.lucene.apache.org/2012-10/msg00792.html" rel="nofollow">here (lucene -solr-user mailing list)</a> and <a href="https://github.com/toastdriven/django-haystack/issues/671" rel="nofollow">here (django-haystack github)</a> for more info on this.</p> <p>Finally, I cd into /opt/solr and run it:</p> <pre><code>sudo java -jar start.jar </code></pre> <p>Ba-da-boom! I get some results (when I go to my django site and use the search I've set up). Fantastic. This is really great. Now I just need to make the starting of solr persistent.</p> <p>I create an /etc/init/solr that looks like this:</p> <pre><code>description "Solr Search Server" # Make sure the file system and network devices have started before # we begin the daemon start on (filesystem and net-device-up IFACE!=lo) # Stop the event daemon on system shutdown stop on shutdown # Respawn the process on unexpected termination respawn # The meat and potatoes exec /usr/bin/java -jar /opt/solr/start.jar &gt;&gt; /var/log/solr.log 2&gt;&amp;1 </code></pre> <p>I restart the server and nothing - I can see solr running, but I'm not getting any results in my django search.</p> <p>I remove the init file and try running from the cli again - yep, sweet. </p> <p>So, my questions are:</p> <ol> <li><p>What the hell have I done wrong? </p></li> <li><p>How do I get solr to start at boot and respawn if it dies accidentally AND produce results through my Django/haystack interface</p></li> <li><p>Why do I need jetty and solr running simultaneously, and what is the relationship of /opt/jetty/webapps/solr.war to my /opt/solr? Am I creating causing conflicts?</p></li> <li><p>Why was this so easy with solr 3.5 and so difficult now? I ask this honestly - I don't want a list of excuses or explanations from solr developers - I want to know how my understanding can be so limited in the first instance (solr 3.5) and get it running in two hours and why I now need to have a comprehensively deeper understanding of jetty/solr architecture and cli/shell script hacking to get it to run?</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload