Restarting solr without restarting whole tomcat service

10,174

Solution 1

You can restart a Solr application (or any other Java application) deployed in Tomcat from the Tomcat Manager GUI (http://<hostname>:<port>/manager/html). Just click "Stop" and then "Start" to restart the solr application. Of course this requires enabling the use of the manager-GUI in the tomcat-users.xml

Another option could be to rename the context file. If you have deployed your Solr application with a context file in conf\Catalina\localhost you can rename this file (which will undeploy the application) and then rename the file back to the original name. This isn't so convenient, but is a workaround if you are in unable to access the Tomcat Manager GUI for security reasons.

Solution 2

Solr has the feature of reloading core. This means that you can reload the new configurations and schema files with ZERO down time. Solr will start loading the new core, and continue to serve requests from the old core until the new core is completely loaded.

You can reload the core using this URL:

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

look here: https://wiki.apache.org/solr/CoreAdmin#RELOAD

Share:
10,174
carefree
Author by

carefree

Updated on June 05, 2022

Comments

  • carefree
    carefree almost 2 years

    Can we restart solr instance without restarting tomcat. I'm new to solr and I'm using tomcat7 on ubuntu 12.04LTS and solr 4.7

  • carefree
    carefree about 10 years
    Thanks Eric, i've my manager gui enabled. Curious if there is any such command to fire from terminal to access tomcat manager to start and stop desired application?
  • Eric Wilson
    Eric Wilson about 10 years
    Offhand, I don't know of any. If you were willing to restart, you could do bin/shutdown.sh followed by bin/startup.sh, but I don't think there is a CLI way to restart an app. Would be nice ...