Start Solr Automatically at Boot

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Once you get Solr working in Drupal you may find it handy to have your Solr instance start whenever your server is rebooted. Doing this is simple and done form the Command Line Interface (CLI). For the beginners (such as myself) you will need to have ssh access to your server. If you do not, ask your hosting company what your options are.

SSH into your server.

  1. Create a directory called cscripts: # mkdir cscripts
  2. Get into the directory: # cd /cscripts
  3. Create a new file called start.sh: # vi start.sh
  4. Press "i"
  5. On the first line enter these lines: cd /home/path/solr_folder_name/example (press enter) java -jar start.jar
  6. Press :w press enter and the :q and press enter
  7. Give the script world permission: # chmod og+x start.sh
  8. Now, test the script and ensure that it works correctly from the command line. # ./start.sh
  9. You shoudl now see the start.jar working. Press ctrl-c and break the process

Add the script to your rc.local file:

  1. # cd /etc
  2. Edit the rc.local file: # vi rc.local
  3. Press "i"
  4. At the end of the file put this command: cd /cscripts (press enter) ./start.sh
  5. Press :w press enter and the :q and press enter

Now reboot and test to make sure your process runs. You can do this by going into the module in Drupal and making sure your module can connect with the Solr server.

A more complete guide can be found here and a higher level start guide can be found here

Lucene, Nutch and Solr

Group organizers

Group categories

Projects

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: