Set up SOLR cloud

Source: Internet
Author: User
Tags solr

1: Set up Tomcat

  1. Configure connector:
    1. Server. XM file:
    2. <Connection Port = "8080"
      Maxthreads = "200" connectiontimeout = "20000" acceptcount = "400"
      Redirectport = "8443" minsparethreads = "10"
      Protocol = "org. Apache. Coyote. http11.http11nioprotocol"/>

  2. Description of connector attributes:
    1. Maxthreads: Maximum number of threads.
    2. Acceptcount: the size of the Request queue. When all the threads are busy and the queue is full, new requests will be discarded.
    3. Minsparethreads: Number of threads initially started.
    4. Maxsparethreads: when the number of threads is between maxsparethreads and minsparethreads, the idle is also maintained, and the idle exceeding minsparethreads is recycled. Tomcat7 does not have this attribute. Delete it.
  3. Remove servlet auto-Reloading:
    1. Server. xml file

    2. <Host name = "localhost" appbase = "webapps" unpackwars = "true" autodeploy = "false">

    3. Configure autodeploy = "false ".

  4. Disabling DNS lookups
    1. Server. xml file
    2. <Connection Port = "8080"
      Maxthreads = "200" connectiontimeout = "20000" acceptcount = "400"
      Redirectport = "8443" enablelookups = "false" minsparethreads = "10" maxsparethreads = "150"
      Protocol = "org. Apache. Coyote. http11.http11nioprotocol"/>

    3. Configure autodeploy = "false"
  5. Modify JVM parameters:
    1. Create setenv. Sh in the $ tomcat_home/bin directory
    2. Java_opts = "-XX: + printgcdatestamps-XX: + prepare-XX: + printgcdetails-xms4g-xmx4g-xmn256m-XX: Export vorratio = 6-XX: + useconcmarksweepgc-XX: + response-XX: Response = 68-XX: + explicitgcinvokesconcurrent-XX: + cmsparallelremarkenabled-XX: + usecmscompactatfullcollection-XX: Response = 10-XX: + usefastaccessormethods-xloggc: /export/GRID/01/hadoop/gclog/rs-gc.log"
  6. Modify the output path of Tomcat logs
    1. Modify CONF/logging. Properties
    2. Change $ {Catalina. Base}/logs to the log storage path.

2: Set up zookeeper

3: Set up SOLR to Tomcat

  1. Add java_opts
    1. In $ tomcat_home/bin/setenv. Sh, add
    2. Java_opts = $ java_opts "-dcollection. configname = collection1"
      Java_opts = $ java_opts "-dnumshards = 1"
      Java_opts = $ java_opts "-dzkhost = metadata-jrdata-03.pekdc1.jdfin.local: 2182, metadata-jrdata-03.pekdc1.jdfin.local: 2183, metadata-jrdata-03.pekdc1.jdfin.local: 2184/solrcloud"
      Java_opts = $ java_opts "-dbootstrap_confdir =/soft/Server/solr-4.10.0/example/SOLR/collection1/conf"
      Java_opts = $ java_opts "-dsolr. SOLR. Home =/soft/Server/solr-4.10.0/example/SOLR"
      Java_opts = $ java_opts "-dsolr. HDFS. Home =/solrcloud/collection1"
      Java_opts = $ java_opts "-dsolr. directoryfactory = hdfsdirectoryfactory"
      Java_opts = $ java_opts "-dsolr. Lock. type = HDFS"
      Java_opts = $ java_opts "-dsolr. HDFS. confdir =/soft/CONF /"
      Java_opts = $ java_opts "-dzkclienttimeout = 30000"
    3. Other machines do not need to be configured:-dcollection. configname,-dnumshards,-dbootstrap_confdir.
  2. Modify the SOLR configuration file, SOLR. SOLR. Home/SOLR. xml
    1. <STR name = "host" >$ {Host: hbase-jrdata-01.pekdc1.jdfin.local} </STR>
      <Int name = "hostport" >$ {Jetty. Port: 60030} </int>

  3. Modify the properties of hdfsdirectoryfactory. In the solrconfig. xml file:
    1. <STR name = "SOLR. HDFS. blockcache. Global" >$ {SOLR. HDFS. blockcache. Global: true} </STR>
    2. Blockcache. Write is prone to bugs. It is shown in the warn information in the SOLR log.
  4. Modify the cache attribute of SOLR. In the solrconfig. xml file:
    1. <Filtercache class = "SOLR. fastlrucache"
      Size = "512"
      Initialsize = "512"
      Autowarmcount = "256"/>

    2. <Queryresultcache class = "SOLR. fastlrucache"
      Size = "512"
      Initialsize = "512"
      Autowarmcount = "256"/>

    3. <Documentcache class = "SOLR. fastlrucache"
      Size = "512"
      Initialsize = "512"
      Autowarmcount = "0"/>

  5. Modify the Tomcat log:
    1. Copy all jar packages under SOLR/example/lib/EXT to Tomcat Lib.
  6. Configure the/SOLR access directory:
    1. In the tomcat/CONF/Catalina/localhost/path, create the SOLR. xml file as follows:
    2. <Context Path = "/SOLR" docbase = "/soft/Server/solr-4.10.0/Dist/SOLR. War" DEBUG = "0" crosscontext = "true">
      </Context>

  7. Configure the log output of SOLR:
    1. After SOLR. War is loaded, the SOLR folder is generated under webapps/and log4j. properties is placed in the WEB-INF/classes. No classes is created.
      Log4j. properties is in the example/resources/path.
    2. Note: ModifySOLR. log = logs/Specifies the output address of the log. Note thatConsoleRemove,ConsoleTomcat's Catalina. out will also output a SOLR log, so that the log will be output again.

Set up SOLR cloud

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.