Modifying the Configuration
- Modify the solrCores/solr.xml file.
- Open the file.
1vi solrCores/solr.xml - 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>
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Run the following command to create a directory:
1mkdir -p /usr/local/solrCloud/tomcat/conf/Catalina/localhost
- Create the solr.xml file in the /usr/local/solrCloud/tomcat/conf/Catalina/localhost/ directory.
- Create a solr.xml file.
1vi /usr/local/solrCloud/tomcat/conf/Catalina/localhost/solr.xml - 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>
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create a solr.xml file.
- Modify the /usr/local/solrCloud/tomcat/bin/catalina.sh file.
- Open the file.
1vi /usr/local/solrCloud/tomcat/bin/catalina.sh - Press i to enter the insert mode and add the following content to the file:
1JAVA_OPTS="-DzkHost=Datanode1:2181,Datanode2:2181,Datanode3:2181"
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
Parent topic: Deploying Solr