标签:
1、版本选择
solr-5.3.1.tgz apache-tomcat-8.0.29.tar.gz
2、解压tomcat和solr
[root@iZ23exixsjaZ solr]# tar -zxvf apache-tomcat-8.0.29.tar.gz [root@iZ23exixsjaZ solr]# tar -zxvf solr-5.3.1.tgz
3、复制solr项目到tomcat
1)将/solr-5.3.1/server/solr-webapp目录下的webapp复制到tomcat的webapps目录中
[root@iZ23exixsjaZ solr-webapp]# pwd /luxh/solr/solr-5.3.1/server/solr-webapp [root@iZ23exixsjaZ solr-webapp]# ls webapp [root@iZ23exixsjaZ solr-webapp]# cp -r webapp/ /luxh/solr/apache-tomcat-8.0.29/webapps/
2)将复制到tomcat中的webapp改名为solr
[root@iZ23exixsjaZ solr-webapp]# cd /luxh/solr/apache-tomcat-8.0.29/webapps [root@iZ23exixsjaZ webapps]# ls docs examples host-manager manager ROOT webapp [root@iZ23exixsjaZ webapps]# mv webapp/ solr [root@iZ23exixsjaZ webapps]# ls docs examples host-manager manager ROOT solr [root@iZ23exixsjaZ webapps]#
4、建立solr根目录
[root@iZ23exixsjaZ solr]# mkdir solr_home [root@iZ23exixsjaZ solr]# cd solr_home/ [root@iZ23exixsjaZ solr_home]# pwd /luxh/solr/solr_home
将solr-5.3.1/server/solr目录下的所有文件拷贝到solr根目录
[root@iZ23exixsjaZ solr]# pwd /luxh/solr/solr-5.3.1/server/solr [root@iZ23exixsjaZ solr]# ls configsets README.txt solr.xml zoo.cfg [root@iZ23exixsjaZ solr]# cp -r /luxh/solr/solr-5.3.1/server/solr/* /luxh/solr/solr_home/ [root@iZ23exixsjaZ solr]#
5、配置tomcat中的solr项目
1)修改solr项目的web.xml文件
[root@iZ23exixsjaZ WEB-INF]# pwd /luxh/solr/apache-tomcat-8.0.29/webapps/solr/WEB-INF [root@iZ23exixsjaZ WEB-INF]# vi web.xml
去掉<env-entry>的注释,并将<env-entry-value>的值设置为之前建立solr的根目录
<env-entry> <env-entry-name>solr/home</env-entry-name> <env-entry-value>/luxh/solr/solr_home</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry>
2)将solr-5.3.1/server/lib/ext目录下的所有jar包拷贝的solr项目中
[root@iZ23exixsjaZ ext]# cp -r /luxh/solr/solr-5.3.1/server/lib/ext/* /luxh/solr/apache-tomcat-8.0.29/webapps/solr/WEB-INF/lib/ [root@iZ23exixsjaZ ext]#
3)将solr-5.3.1/server/resources目录中的log4j.properties拷贝的solr项目中
先创建classes文件夹
[root@iZ23exixsjaZ WEB-INF]# pwd /luxh/solr/apache-tomcat-8.0.29/webapps/solr/WEB-INF [root@iZ23exixsjaZ WEB-INF]# ls lib weblogic.xml web.xml [root@iZ23exixsjaZ WEB-INF]# mkdir classes [root@iZ23exixsjaZ WEB-INF]# ls classes lib weblogic.xml web.xml [root@iZ23exixsjaZ WEB-INF]#
拷贝log4j.properties
[root@iZ23exixsjaZ resources]# pwd /luxh/solr/solr-5.3.1/server/resources [root@iZ23exixsjaZ resources]# ls jetty-logging.properties log4j.properties [root@iZ23exixsjaZ resources]# cp log4j.properties /luxh/solr/apache-tomcat-8.0.29/webapps/solr/WEB-INF/classes [root@iZ23exixsjaZ resources]#
6、启动tomcat
[root@iZ23exixsjaZ apache-tomcat-8.0.29]# pwd /luxh/solr/apache-tomcat-8.0.29 [root@iZ23exixsjaZ apache-tomcat-8.0.29]# bin/startup.sh
7、访问 http://你的ip:8080/solr/admin.html ,出现如下界面,说明部署成功。
标签:
原文地址:http://www.cnblogs.com/luxh/p/5016894.html