How to start and Stop SOLR from A user created windows service

前端 未结 2 521
小鲜肉
小鲜肉 2021-01-26 18:15

I had a two bat files start.bat and stop.bat for starting and stopping SOLR server manually, Is it possible for me to create a windows serive which will call start.bat on starti

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-26 18:49

    Solr runs on top of a Servlet container like Tomcat. So for starting Solr you have to configure Solr with your Servlet container and then start.

    Yes you can of course create a Windows Service. However you have not mentioned which Servlet container are you using for running Solr?

    If it is Apache Tomcat here you go:

    1. Just go to tomcat/bin folder from command prompt
    2. Say service.bat install
    3. You can see the service being listed in the Microsoft Services
    Application
    4. Right click on the service and add solr home (in Start
    parameters). For an example if your Solr home is in D drive then:
    -Dsolr.solr.home="D:\solr"
    5.You are done. Just right click on the service, start it or even you can set 
    it to start automatically when your system starts.
    

提交回复
热议问题