Rate This Document
Findability
Accuracy
Completeness
Readability

Modifying the Configuration

  1. Modify the solrCores/solr.xml file.
    1. Open the file.
      1
      vi solrCores/solr.xml
      
    2. Press i to enter the insert mode and change the value of hostPort to be the same as the Tomcat port. In this document, the default Tomcat port is 8080.
      1
      <int name="hostPort">8080</int>
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. Run the following command to create a directory:
    1
    mkdir -p /usr/local/solrCloud/tomcat/conf/Catalina/localhost
    
  3. Create the solr.xml file in the /usr/local/solrCloud/tomcat/conf/Catalina/localhost/ directory.
    1. Create a solr.xml file.
      1
      vi /usr/local/solrCloud/tomcat/conf/Catalina/localhost/solr.xml
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      3
      4
      <?xml version="1.0" encoding="UTF-8"?>
      <Context docBase="/usr/local/solrCloud/tomcat/webapps/solr" debug="0" crossContext="true">
          <Environment name="solr/home" type="java.lang.String" value="/usr/local/solrCloud/solrCores" override="true"/>
      </Context>
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Modify the /usr/local/solrCloud/tomcat/bin/catalina.sh file.
    1. Open the file.
      1
      vi /usr/local/solrCloud/tomcat/bin/catalina.sh
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      JAVA_OPTS="-DzkHost=Datanode1:2181,Datanode2:2181,Datanode3:2181"
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.