Friday, February 27, 2015

Solr Start - Stop script

Solr

Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.

Introduction


You can download the solr from here.  Setting up solr is easy as they have perfect document to do that.  Starting the solr is also easy. Go to the path, start the solr by the command what they have provided for the version you have downloaded.  By pressing Ctrl + c or by killing the port you can easily start and restart the solr.

Consider the production environment. You don't have to manually follow this process each and every time. To simplify this tedious process, follow the below steps.

Implementation



  • copy the above code and paste in /etc/init.d/solr file
  • mention your solr path, and start command in the start daemon place
  • following needs to be done in the server ( just copy paste in your terminal )
sudo update-rc.d solr defaults
sudo apt-get install chkconfig
update-rc.d solr defaults
sudo chmod og+x /etc/init.d/solr
sudo apt-get install daemon
Then you can start and stop the solr by the following command
/etc/init.d/solr start
/etc/init.d/solr stop
Thats it, now you can start and stop solr by the above command.

1 comment: