We are now going to install schema & solrconfig files on the first remote Ubuntu Server.

On the first remote Ubuntu server navigate to the following folder.

apache-solr-1.4.0/example/solr/conf/

Rename schema.xml file.
File name before

schema.xml

File name after

schema.bak

In the same folder. Rename solrconfig.xml file.
File name before

solrconfig.xml

File name after

solrconfig.bak

Copy the two files (schema.xml & solrconfig.xml) that come with the Drupal Apache Solr Search Integration module to the following directory on your first remote Ubuntu server.

apache-solr-1.4.0/example/solr/conf/

We are now going to start the Solr engine on your first remote Ubuntu server.
Type in the following commands in TERMINAL. Press RETURN key after each line.

cd /
cd apache-solr-1.4.0/example
java -jar start.jar

Wait. If successful TERMINAL will returns a long list of lines.

We are now going to test if the Solr engine is now available.
Using your internet browser go to http://10.1.2.3:8983/solr/admin/

  • Note: You must replace above 10.1.2.3 by your second Ubuntu remote server IP address.

If successful you should see a page with a grey background titled “Solr Admin (drupal-0.9.2)”.

You have successfully installed schema & solrconfig files on the first remote Ubuntu Server.

  • Note 1: This is optional but if you want to make your life easier you can automatically start Apache Server on server restarts. Read more at http://drupal.org/node/507292
  • Note 2: To properly manually start the Solr engine on your first remote Ubuntu server (i.e. so you can log out and not kill solr), you need to run Solr in the background. You can achieve that with this command:
    nohup java -jar start.jar >logfile 2>&1 &;
    

    This outputs a process number to the terminal; you should store it for future reference so you can later kill that process.

    As an alternative, install tomcat5.5 as the servlet container.

Comments

kbell’s picture

So everything went fine for me until:
cd /
cd apache-solr-1.4.0/example
java -jar start.jar

this printed out a list of stuff, but never went back to the command line prompt. Also, the Solr admin test was unsuccessful. What do I do now? I tried it multiple times after waiting over an hour each time to see if maybe it would un-hang itself, but no luck.

It hung for awhile on this:
INFO: [] Registered new searcher Searcher@342f356f main
2010-11-10 22:07:36.180::INFO: Started SocketConnector @ 0.0.0.0:8983

but eventually went on.

The last line that printed out was:
10-Nov-2010 12:10:23 org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/admin/luke params={numTerms=0&wt=json} status=0 QTime=1

It never proceeded past this point, and I never got the prompt - it just eventually timed me out and broke the connection.

Any help appreciated. Thank you.

-Kelly Bell
twitter: @kelly, @gothamdrupal
http://gothamcitydrupal.com

kbell’s picture

I was banging my head against this for hours yesterday, went to IRC, and AndyThornton came to the rescue. Together we were looking for ports blocked, permissions issues, missing xml - all of which were fine, The answer came when he asked me "do you have a separate ssh session open that is running the java start?".
java -jar start.jar

And the answer was "no" - as you see in my original post, I was noting that when I ran this command, I never went back to the command prompt. So after a while I would ^C and give up.

I'm not a java programmer (but AndyThornton is!) and he told me that I shouldn't expect there to be an end - it just runs from then on. Any future work I want to do has to then be done in a new session (somehow I was thinking that it would be running in the background and "release" me back to the prompt - dumb, I know). As a Java noob, I did not know this. It would be awesome if you mentioned this above, because I have 3 years of experience working with Drupal 24/7, and as obvious and bone-headed a mistake as it is, it seems likely that if it tripped me up might trip others up as well. To the degree this tutorial is supposed to be for Absolute Beginners, it might be a worthy edit.

Thanks to AndyThornton for the help (a big "++" on ya!).

-Kelly Bell
twitter: @kelly, @gothamdrupal
http://gothamcitydrupal.com