How to run Solr 4 in Tomcat locally?

后端 未结 6 1216
[愿得一人]
[愿得一人] 2021-02-07 09:58

I\'ve been trying to set up Solr 4.3 on my home PC (in Tomcat 7) but it doesn\'t run. I have set up Tomcat and deployed the solr.war file which both unpacks and sho

6条回答
  •  佛祖请我去吃肉
    2021-02-07 10:37

    The easiest way to get started with Solr on Tomcat is to use HDS (Heliosearch Distribution for Solr), a Tomcat/Solr distribution

    It's a super-set of Apache Solr, containing an additional "server" directory that is a pre-configured (threads, logging, connection settings, message sizes, etc) Tomcat based Solr server.

    Some other implementation notes:

    • start scripts can be run from anywhere, and allow passing JVM args on command line (just like jetty, so it makes it easier to use)
    • start scripts work around known JVM bugs
    • start scripts allow setting port from command line, and default stop port based off of http port to make it easy to run multiple servers on a single box)
    • zkcli, the start script for the solr zookeeper tool, will auto-explode the WAR if necessary
    • the "server" directory has been kept clean but stuffing all of tomcat under the "server/tc" directory

    To start:

    $ cd server
    $ bin/startup.sh
    

    To start on a different port (e.g. 7574):

    $ cd server
    $ bin/startup.sh -Dhttp.port=7574
    

    To shut down:

    $ cd server
    $ bin/shutdown.sh -Dhttp.port=7574
    

    The scripts even accept -Djetty.port=7574 to make it easier to cut-n-paste from start examples using jetty. The "example" directory is still there too, so you can still run the jetty based server if you want.

提交回复
热议问题