centos tomcat下安装多个solr应用
来源:互联网 发布:时代网络投诉电话 编辑:程序博客网 时间:2024/05/18 02:44
tomcat安装路径:/usr/local/tomcat/
solr安装路径:/usr/local/solr/
solr.war路径:/usr/local/solr/solr.war(已把IK分词和其他jar包都加入进去)
solr2.war路径:/usr/local/solr/solr2.war(已把IK分词和其他jar包都加入进去)
如果solr.war,solr2.war没有加入IK分词等信息,则手动加入进去。
用7-zip等解压缩软件打开/usr/local/solr/solr.war,找到WEB-INF\lib\目录。
一、把/usr/local/solr/dist/目录下的11个jar包(本文所用的solr4.6版本的下面有11个jar包),拖进打开的war包的WEB-INF\lib\目录(提示覆盖则覆盖)。
二、把IK分词的jar包IKAnalyzer2012FF_u1.jar拖进此目录。
三、任意地方新建一个classes目录,把IK分词的IKAnalyzer.cfg.xml,stopword.dic,ext.dic文件复制到此目录。把classes目录拖到war包的WEB-INF\目录下。
此时solr.war的WEB-INF\目录下的文件结构如下:
classes
ext.dic
IKAnalyzer.cfg.xml
stopword.dic
lib
xxx.jar
......
web.xml
weblogic.xml
1. /usr/local/tomcat/conf/Catalina/localhost/下增加solr.xml,solr2.xml文件。
solr.xml内容如下:
<?xml version="1.0" encoding="UTF-8" ?><Context docBase="/usr/local/solr/solr.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/usr/local/solr/example/solr" override="true" /></Context>solr2.xml内容如下:
<?xml version="1.0" encoding="UTF-8" ?><Context docBase="/usr/local/solr/solr2.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/usr/local/solr/example/solr2" override="true" /></Context>2. /usr/local/solr/example/目录下有个solr目录(官方下载包里本就存在的目录),修改此目录下的solr.xml文件,配置为多core,内容如下:
<?xml version="1.0" encoding="UTF-8" ?><!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--><!-- This is an example of a simple "solr.xml" file for configuring one or more Solr Cores, as well as allowing Cores to be added, removed, and reloaded via HTTP requests. More information about options available in this configuration file, and Solr Core administration can be found online: http://wiki.apache.org/solr/CoreAdmin--><solr persistent="true"> <cores adminPath="/admin/cores"> <core name="collection1" instanceDir="/usr/local/solr/example/solr/collection1/"/> <core name="core0" instanceDir="/usr/local/solr/example/solr/core0"/> <core name="core1" instanceDir="/usr/local/solr/example/solr/core1"/> <core config="/usr/local/solr/example/solr/core2/conf/solrconfig.xml" name="core2" instanceDir="/usr/local/solr/example/solr/core2/" schema="/usr/local/solr/example/solr/core2/conf/schema.xml" dataDir="/usr/local/solr/example/solr/core2/data/"/> <core config="/usr/local/solr/example/solr/core3/conf/solrconfig.xml" name="core3" instanceDir="/usr/local/solr/example/solr/core3/" schema="/usr/local/solr/example/solr/core3/conf/schema.xml" dataDir="/usr/local/solr/example/solr/core3/data/"/></cores></solr>其中collection1是官方示例自带的,保留空的放在那不管,以后配置错了或者忘了什么,到collection1的配置中查看。core0,core1,core2,core3是新建的4个core。
复制一份collection1重命名为core0,使用curl执行下面格式的命令可创建一个core(复制下面的命令是不能直接执行的,因为有回车换行,把他们变为一行就可以了)。
创建corecurl http://localhost:8080/solr/admin/cores?action=CREATE\&name=core0\&instanceDir=/usr/local/solr/example/solr/core0/\&dataDir=/usr/local/solr/example/solr/core0/data/\&config=/usr/local/solr/example/solr/core0/conf/solrconfig.xml\&schema=/usr/local/solr/example/solr/core0/conf/schema.xml3. /usr/local/solr/example/solr2/solr.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8" ?><solr persistent="true"> <cores adminPath="/admin/cores"> <core name="collection1" instanceDir="/usr/local/solr/example/solr2/collection1/"/> <core name="core0" instanceDir="/usr/local/solr/example/solr2/core0"/> <core name="core1" instanceDir="/usr/local/solr/example/solr2/core1"/> <core name="core2" instanceDir="/usr/local/solr/example/solr2/core2/"/> <core name="core3" instanceDir="/usr/local/solr/example/solr2/core3/"/></cores></solr>solr2应用也创建了4个core(就是solr应用复制一份,改名为solr2,修改下solr.xml配置文件中的路径而已。)
- centos tomcat下安装多个solr应用
- centos 下安装多个独立 tomcat
- Linux(CentOS 7)下安装配置nginx代理多个tomcat实例和应用
- solr在Tomcat下安装
- Tomcat下Solr安装配置
- jdk tomcat solr mmseg4j linux centos 安装
- centos中安装多个tomcat
- centos下安装tomcat
- centos下安装tomcat
- centos下安装tomcat
- CentOS下安装Tomcat
- centos下安装tomcat
- Centos下安装Tomcat
- centos下安装tomcat
- CentOS 下安装 Tomcat
- Centos下安装tomcat
- centos下安装tomcat
- CentOS下安装tomcat
- Tapestry3 学习笔记(一) 配置文件介绍
- Java设计模式泛型化之工厂模式
- 项目中一些js小的技巧总结
- Oracle11g在Windows操作系统下的安装
- William Nelson Joy
- centos tomcat下安装多个solr应用
- maven核心思想“约定大于配置”
- 设计模式(4) 原型模式(Prototype)
- Astronomers Discover Secrets About Ancient Supernovae
- 面试常见问题及解答,部分来源于网络
- Matlab中train与adapt的区别
- 配置yum源
- 设计二维数组,给出一个坐标,输出周围8个数,并将数组输出到文件
- mysql 表明不区分大小写