Which is the correct way to restart Solr

At Websolr, we use a combination of a custom init.d script plus Monit to start Solr and ensure that it stays running.

That said, for a simpler self-hosted setup, I would recommend using Upstart to start and stop Solr, if your system has Upstart available. Upstart scripts have the benefit of being fairly simple, and Upstart does a good job restarting processes in the event they crash. Plus the start and stop commands (start and stop, respectively) are pretty easy to remember for the next time you need to make Solr aware of new configs.

Here is a good blog post covering starting Solr with Upstart. I've copied their upstart script below; be sure to update the relevant paths to match your system:

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 -Xms128m -Xmx256m -Dsolr.solr.home=/path/to/solr/home -Djetty.home=/path/to/jetty -jar /path/to/jetty/start.jar >> /var/log/solr.log 2>&1

You can try this approach http://wiki.apache.org/solr/CoreAdmin#RELOAD.

Using a command like this

http://localhost:8983/solr/admin/cores?action=RELOAD&core=core0

will just reload all your configuration files and you will not have problems in doing SOLR queries querying while the core is restarted.


For SolrCloud, from the solr folder run:

bin/solr restart -e cloud -noprompt