centOS7 配置Solr6.6.0
阿新 • • 發佈:2019-02-01
先保證系統安裝了jdk1.8
cd /usr/local/
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.16/bin/apache-tomcat-8.5.16.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/6.6.0/solr-6.6.0.tgz
mkdir solr
tar -zxvf apache-tomcat-8.5.16.tar.gz
tar -zxvf solr-6.6.0.tgz -C solr
cd /usr/local/solr/solr-6.6 .0/server/solr-webapp
cp -r webapp/ /usr/local/apache-tomcat-8.5.16/webapps/solr
cd ../lib/ext/
cp -r jcl-over-slf4j-1.7.7.jar jul-to-slf4j-1.7.7.jar log4j-1.2.17.jar slf4j-api-1.7.7.jar slf4j-log4j12-1.7.7.jar /usr/local/apache-tomcat-8.5.16/webapps/solr/WEB-INF/lib/
cd ..
cp -r metrics-core-3.2.2.jar metrics-ganglia- 3.2.2.jar metrics-graphite-3.2.2.jar metrics-jetty9-3.2.2.jar metrics-jvm-3.2.2.jar /usr/local/apache-tomcat-8.5.16/webapps/solr/WEB-INF/lib/
cd /usr/local/apache-tomcat-8.5.16/webapps/solr/WEB-INF/
mkdir classes
cd /usr/local/solr/solr-6.6.0/server/resources/
cp log4j.properties /usr/local/apache-tomcat-8.5.16/webapps/solr/WEB-INF /classes/
cd ..
cp -r solr /usr/local/solrhome
cd /usr/local/apache-tomcat-8.5.16/webapps/solr/WEB-INF
sed -i -e 's|/put/your/solr/home/here|/usr/local/solrhome|' web.xml
sed -i -e 's|<env-entry>|--><env-entry>|' web.xml
sed -i -e 's|</env-entry>|</env-entry><!--|' web.xml
sed -i -e 's|<security-constraint>|<!--<security-constraint>|' web.xml
sed -i -e 's|</security-constraint>|</security-constraint>-->|' web.xml
cd /usr/local/apache-tomcat-8.5.16/bin
./startup.sh
切換root許可權,關閉防火牆,新建一個solrConf.sh檔案,把上面這段貼進去,然後給與這個檔案許可權chmod 777 solrConf.sh
,最後./solrConf.sh
執行檔案,等待執行完就可以了。瀏覽器輸入http://localhost:8080/solr/index.html,如果是遠端,把localhost換成虛擬機器ip地址即可