solr is an enterprise search application server to lucence basis. This article will explain how to install solr in centos7 in.
1, constrained version
- CentOS7 workstation
- solr-4.10.3
links: https://pan.baidu.com/s/1094ttIAo-e6zhAfB1DndCg
extraction code: zhhg - putty
- apache-tomcat-8.5.38
2, the premise of restraint
- Already installed CentOS7 https://www.jianshu.com/p/2b6340bf43e5 a copy of the virtual machine ip is 192.168.100.192]
- CentOS7 may be connected to external networks https://www.jianshu.com/p/b850e695a490
- solr-4.10.3.tgz been uploaded to CentOS7 [The author is uploaded to the / root of]
- apache-tomcat-8.5.38.zip been uploaded to CentOS7 [The author is uploaded to the / root of]
3, software download
Baidu network disk:
Link: https://pan.baidu.com/s/1CwJ1a9rnXXL4t0JTFBkpFw
extraction code: 91ml
4, steps
4.1 by putty connection CentOS7, decompression solr and tomcat
# 确保solr-4.10.3.tgz、apache-tomcat-8.5.38.zip是在当前目录下
ls
# 解压solr-4.10.3.tgz
tar -xvf solr-4.10.3.tgz
# 解压apache-tomcat-8.5.38.zip
unzip apache-tomcat-8.5.38.zip
# 赋予tomcat中bin目录下文件的可执行权限
chmod 777 /rootapache-tomcat-8.5.38/bin/*
启动tomcat。注意:启动tomcat之前要先配置好jdk环境变量。
/root/rootapache-tomcat-8.5.38/bin/startup.sh
4.2 solr.war to copy the webapps tomcat
cp /root/solr-4.10.3/example/webapps/solr.war /root/apache-tomcat-8.5.38/webapps/
Wait a moment, war package will be unpacked.
4.3 Copy jar package
cp /root/solr-4.10.3/example/lib/ext/* /root/apache-tomcat-8.5.38/webapps/solr/WEB-INF/lib/
4.4 modify the package solr war web.xml
Edit /root/apache-tomcat-8.5.38/webapps/solr/WEB-INF/web.xml
found
<!--
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/put/your/solr/home/here</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
-->
To change it
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/root/solr-4.10.3/example/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
Restart tomcat, and turn off the firewall [Note that the actual production environment will not turn off the firewall, here is a test, so simple and crude].
4.5 Test
In the browser input http://192.168.100.192:8080/solr, we can see the solr management interface.
So far, we have completed the installation and start-solr in CentOS7 in.