www.2527.com_澳门新葡8455手机版_新京葡娱乐场网址_
做最好的网站

单机版笔记,6上安装与安顿Solr

2019-08-23 02:38 来源:未知

四、运行Solr:

 启动执行:/down/apache-tomcat-8.5.12/bin/startup.sh

[[email protected] down]# /down/apache-tomcat-8.5.12/bin/startup.sh 
Using CATALINA_BASE:  /down/apache-tomcat-8.5.12 
Using CATALINA_HOME:  /down/apache-tomcat-8.5.12 
Using CATALINA_TMPDIR: /down/apache-tomcat-8.5.12/temp 
Using JRE_HOME:        /down/jdk1.8.0_121/jre 
Using CLASSPATH:      /usr/local/tomcat/bin/bootstrap.jar:/down/apache-tomcat-8.5.12/bin/tomcat-juli.jar 
Tomcat started. 
[[email protected] down]# 

[[email protected] down]# /down/apache-tomcat-8.5.12/bin/startup.sh
Using CATALINA_BASE:   /down/apache-tomcat-8.5.12
Using CATALINA_HOME:   /down/apache-tomcat-8.5.12
Using CATALINA_TMPDIR: /down/apache-tomcat-8.5.12/temp
Using JRE_HOME:        /down/jdk1.8.0_121/jre
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/down/apache-tomcat-8.5.12/bin/tomcat-juli.jar
Tomcat started.
[[email protected] down]#

在浏览器输入
图片 1

关闭solr只需要关闭tomcat即可:

[[email protected] down]# /down/apache-tomcat-8.5.12/bin/shutdown.sh 

[[email protected] down]# /down/apache-tomcat-8.5.12/bin/shutdown.sh

至此solr的安装完毕。

更多Solr相关教程见以下内容:

Solr3.6.1 在Tomcat6下的环境搭建

Apache Solr: 安装和运行

在 Ubuntu 12.04 LTS 上通过 Tomcat 部署 Solr 4

Solr实现Low Level查询解析(QParser)

Solr6.0.0 Tomcat8 配置问题

基于Solr 3.5搭建搜索服务器

Solr 3.5开发应用教程 PDF高清版

CentOS 6.7下单机部署Solr 7.1.0 

Solr 4.0 部署实例教程

Solr 的详细介绍:请点这里
Solr 的下载地址:请点这里

6.6上安装与配置Solr 6.5 这篇文章主要是介绍在CentOS 6.6上Solr 6.5的安装与配置。 一、安装准备及各软件使用版本说明: 1、JDK8,版本jdk...

Linux上搭建Solr7.2 单机版笔记

系统环境
solr-7.2.0.tgz
apache-tomcat-9.0.2.tar.gz
jdk-9.0.1_linux-x64_bin.tar.gz
CentOS-7-x86_64-DVD-1708

配置步骤

1、解压 tar.gz 源码包,得到 solr-7.2.0/ 文件夹;

2、创建目录 /usr/local/solr/,将 solr-7.2.0/server/ 下的文件夹 solr/ 复制到该目录下,更名为 solrhome/;再将 tomcat9 解压后的文件夹也复制到该目录下,更名为 tomcat/;

3、复制文件夹 solr-7.2.0/server/solr-webapp/webapp/ 到 /usr/local/solr/tomcat/webapps/ 目录下,更名为 solr/;

4、进入第 3 步新命名的 solr 文件夹,进入 solr/WEB-INF/lib/,向其中复制 solr-7.2.0/ 下的两处 jar 包:

4.1、solr-7.2.0/server/lib/ext/ 下的所有 jar 包,共五个:

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

4.2、solr-7.2.0/server/lib/ 下所有以“metrics”开头的 jar 包,总共也有五个:

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

5、修改 solr/WEB-INF/web.xml 文件:

5.1、配置 JNDI ,指定 Solr 项目关联的 solrhome 的具体路径:

    <env-entry>
      <env-entry-name>solr/home</env-entry-name>
      <env-entry-value>/usr/local/solr/solr_home</env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

5.2、注释文件末尾的所有 <security-constraint> 元素节点:

  <!-- Get rid of error message -->
  <!--
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Disable TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method>TRACE</http-method>
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Enable everything but TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method-omission>TRACE</http-method-omission>
    </web-resource-collection>
  </security-constraint>
  -->

6、复制日志配置文件 solr-7.2.0/server/resources/log4j.properties,放入新创建的文件夹 WEB-INF/classes/ 内;

7、进入  usr/local/solr/tomcat/bin/,启动 tomcat9;在本地浏览器输入: /index.html,否则报 404 错误。

Solr 正常打开后的页面效果:

图片 2

下图为按步骤梳理的 Solr7.2.0 与 Solr4.10.3 在配置上的异同,仅供参考。

图片 3

其他注意事项:

1、当前 JDK9 需要运行在 64 位 Linux 操作系统上;

2、如果本地访问成功但远程失败,需要关闭 Linux 防火墙或新增许可端口;

参考文章:

Solr安装与配置:

更多Solr相关教程见以下内容:

Solr3.6.1 在Tomcat6下的环境搭建

Apache Solr: 安装和运行

Solr6.0.0 Tomcat8 配置问题

CentOS 6.7下单机部署Solr 7.1.0 

Linux下Solr 7.2安装配置 

Solr 的详细介绍:请点这里
Solr 的下载地址:请点这里

单机版笔记 系统环境 solr-7.2.0.tgz apache-tomcat-9.0.2.tar.gz jdk-9.0.1_linux-x64_bin.tar.gz CentOS-7-x86_64-DVD-1708 配置步骤 1、解压 tar.gz 源...

三、Solr安装与配置:

 1、解压apache-tomcat-8.5.12.tar.gz和solr-6.5.0.tgz

[[email protected] down]# tar -zxvf apache-tomcat-8.5.12.tar.gz 
[[email protected] down]# tar -zxvf solr-6.5.0.tgz 

[[email protected] down]# tar -zxvf apache-tomcat-8.5.12.tar.gz 
[[email protected] down]# tar -zxvf solr-6.5.0.tgz 

  解压后的目录结构: 
[[email protected] down]# ls 
apache-tomcat-8.5.12        jdk1.8.0_121                solr-6.5.0 
apache-tomcat-8.5.12.tar.gz  jdk-8u121-linux-x64.tar.gz  solr-6.5.0.tgz 

解压后的目录结构:
[[email protected] down]# ls
apache-tomcat-8.5.12         jdk1.8.0_121                solr-6.5.0
apache-tomcat-8.5.12.tar.gz  jdk-8u121-linux-x64.tar.gz  solr-6.5.0.tgz

2、复制Solr文件夹中的一些文件到apache-tomcat下:

1)将 solr 压缩包中 solrserversolr-webapp文件夹下有个webapp文件夹,将之复制到tomcatwebapps目录下,文件夹名改成solr(任意) ;

2)将 solr 压缩包中 solrserverlibext 中的 jar 全部复制到 Tomcat webappssolrWEB-INFlib 目录中; 

3)将solr压缩包中solr/server/lib/metrics* 开头的jar全部复制到 Tomcat webappssolrWEB-INFlib 目录中; 

4)将solr压缩包中solr/server/lib/solr-dataimporthandler-* 开头的jar全部复制到 Tomcat webappssolrWEB-INFlib 目录中; 

5)在Tomcat webappssolrWEB-INF下建立classes目录,并将solr/server/resources/log4j.properties文件复制其中;

6)在tomcat目录下建立solrhome目录(也可以放在其它目录中)

7)复制solr/server/solr/* 所有文件到tomcat/solrhome目录,用到创建solr的core时使用。

操作shell如下:

[[email protected] down]# cd /down 
[[email protected] down]# cp -R /down/solr-6.5.0/server/solr-webapp/webapp /down/apache-tomcat-8.5.12/webapps/solr 
[[email protected] down]# cp -R /down/solr-6.5.0/server/lib/ext/*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/ 
[[email protected] down]# cp -R /down/solr-6.5.0/server/lib/metrics*.*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/ 
[[email protected] down]# cp /down/solr-6.5.0/dist/solr-dataimporthandler-*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/ 
[[email protected] down]# mkdir /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/classes 
[[email protected] down]# cp /down/solr-6.5.0/server/resources/log4j.properties  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/classes/ 
[[email protected] down]# mkdir /down/apache-tomcat-8.5.12/solrhome 
[[email protected] down]# cp -R /down/solr-6.5.0/server/solr/*  /down/apache-tomcat-8.5.12/solrhome/ 

[[email protected] down]# cd /down
[[email protected] down]# cp -R /down/solr-6.5.0/server/solr-webapp/webapp /down/apache-tomcat-8.5.12/webapps/solr
[[email protected] down]# cp -R /down/solr-6.5.0/server/lib/ext/*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/
[[email protected] down]# cp -R /down/solr-6.5.0/server/lib/metrics*.*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/
[[email protected] down]# cp /down/solr-6.5.0/dist/solr-dataimporthandler-*  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/lib/
[[email protected] down]# mkdir /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/classes
[[email protected] down]# cp /down/solr-6.5.0/server/resources/log4j.properties  /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/classes/
[[email protected] down]# mkdir /down/apache-tomcat-8.5.12/solrhome
[[email protected] down]# cp -R /down/solr-6.5.0/server/solr/*  /down/apache-tomcat-8.5.12/solrhome/

3、配置Solr:

编辑web.xml文件:

[[email protected] down]# vi /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/web.xml   

[[email protected] down]# vi /down/apache-tomcat-8.5.12/webapps/solr/WEB-INF/web.xml 

1)配置solr下core路径,找如下配置内容(初始状态下该内容是被注释掉的):

<env-entry> 
  <env-entry-name>solr/home</env-entry-name> 
  <env-entry-value>/down/apache-tomcat-8.5.12/solrhome</env-entry-value> //将路径指向我们创建的solrhome目录。 
  <env-entry-type>java.lang.String</env-entry-type> 
</env-entry> 

<env-entry>
   <env-entry-name>solr/home</env-entry-name>
   <env-entry-value>/down/apache-tomcat-8.5.12/solrhome</env-entry-value> //将路径指向我们创建的solrhome目录。
   <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

2)配置访问权限:找到如下内容,并注释掉:

<!-- 
  <security-constraint> 
    <web-resource-collection> 
      <web-resource-name>Disable TRACE</web-resource-name> 
      <url-pattern>/</url-pattern> 
      <http-method>TRACE</http-method> 
    </web-resource-collection> 
    <auth-constraint/> 
  </security-constraint> 
  <security-constraint> 
    <web-resource-collection> 
      <web-resource-name>Enable everything but TRACE</web-resource-name> 
      <url-pattern>/</url-pattern> 
      <http-method-omission>TRACE</http-method-omission> 
    </web-resource-collection> 
  </security-constraint> 
--> 

<!--
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Disable TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method>TRACE</http-method>
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Enable everything but TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method-omission>TRACE</http-method-omission>
    </web-resource-collection>
  </security-constraint>
-->

整个web.xml的配置文件内容如下:

<?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 
 
     
 
 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. 
--> 
<web-app xmlns="" 
        xmlns:xsi="" 
        xsi:schemaLocation=" " 
        version="2.5" 
        metadata-complete="true" 

 
 
  <!-- Uncomment if you are trying to use a Resin version before 3.0.19. 
    Their XML implementation isn't entirely compatible with Xerces. 
    Below are the implementations to use with Sun's JVM. 
  <system-property javax.xml.xpath.XPathFactory= 
            "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/> 
  <system-property javax.xml.parsers.DocumentBuilderFactory= 
            "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/> 
  <system-property javax.xml.parsers.SAXParserFactory= 
            "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/> 
  --> 
 
  <!-- People who want to hardcode their "Solr Home" directly into the 
      WAR File can set the JNDI property here... 
  --> 
    <env-entry> 
      <env-entry-name>solr/home</env-entry-name> 
      <env-entry-value>/down/apache-tomcat-8.5.12/solrhome</env-entry-value> 
      <env-entry-type>java.lang.String</env-entry-type> 
    </env-entry> 
   
  <!-- Any path (name) registered in solrconfig.xml will be sent to that filter --> 
  <filter> 
    <filter-name>SolrRequestFilter</filter-name> 
    <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class> 
    <!-- 
    Exclude patterns is a list of directories that would be short circuited by the 
    SolrDispatchFilter. It includes all Admin UI related static content. 
    NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath. 
    --> 
    <init-param> 
      <param-name>excludePatterns</param-name> 
      <param-value>/libs/. ,/css/. ,/js/. ,/img/. ,/tpl/. </param-value> 
    </init-param> 
  </filter> 
 
  <filter-mapping> 
    <!-- 
      NOTE: When using multicore, /admin JSP URLs with a core specified 
      such as /solr/coreName/admin/stats.jsp get forwarded by a 
      RequestDispatcher to /solr/admin/stats.jsp with the specified core 
      put into request scope keyed as "org.apache.solr.SolrCore". 
 
      It is unnecessary, and potentially problematic, to have the SolrDispatchFilter 
      configured to also filter on forwards.  Do not configure 
      this dispatcher as <dispatcher>FORWARD</dispatcher>. 
    --> 
    <filter-name>SolrRequestFilter</filter-name> 
    <url-pattern>/*</url-pattern> 
  </filter-mapping> 
 
  <servlet> 
    <servlet-name>LoadAdminUI</servlet-name> 
    <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class> 
  </servlet> 
   
  <!-- Remove in Solr 5.0 --> 
  <!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 --> 
  <servlet> 
    <servlet-name>RedirectOldAdminUI</servlet-name> 
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> 
    <init-param> 
      <param-name>destination</param-name> 
      <param-value>${context}/#/</param-value> 
    </init-param> 
  </servlet> 
   
  <servlet> 
    <servlet-name>RedirectOldZookeeper</servlet-name> 
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> 
    <init-param> 
      <param-name>destination</param-name> 
      <param-value>${context}/admin/zookeeper</param-value> 
    </init-param> 
  </servlet> 
 
  <servlet> 
    <servlet-name>RedirectLogging</servlet-name> 
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> 
    <init-param> 
      <param-name>destination</param-name> 
      <param-value>${context}/#/~logging</param-value> 
    </init-param> 
  </servlet> 
 
  <servlet> 
    <servlet-name>SolrRestApi</servlet-name> 
    <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> 
    <init-param> 
      <param-name>org.restlet.application</param-name> 
      <param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value> 
    </init-param> 
  </servlet> 
 
  <servlet-mapping> 
    <servlet-name>RedirectOldAdminUI</servlet-name> 
    <url-pattern>/admin/</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>RedirectOldAdminUI</servlet-name> 
    <url-pattern>/admin</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>RedirectOldZookeeper</servlet-name> 
    <url-pattern>/zookeeper.jsp</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>RedirectOldZookeeper</servlet-name> 
    <url-pattern>/zookeeper</url-pattern> 
  </servlet-mapping> 
  <servlet-mapping> 
    <servlet-name>RedirectLogging</servlet-name> 
    <url-pattern>/logging</url-pattern> 
  </servlet-mapping> 
 
  <servlet-mapping> 
    <servlet-name>LoadAdminUI</servlet-name> 
    <url-pattern>/old.html</url-pattern> 
  </servlet-mapping> 
 
  <servlet-mapping> 
    <servlet-name>LoadAdminUI</servlet-name> 
    <url-pattern>/index.html</url-pattern> 
  </servlet-mapping> 
 
  <servlet-mapping> 
    <servlet-name>SolrRestApi</servlet-name> 
    <url-pattern>/schema/*</url-pattern> 
  </servlet-mapping> 
   
  <mime-mapping> 
    <extension>.xsl</extension> 
    <!-- per --> 
    <mime-type>application/xslt xml</mime-type> 
  </mime-mapping> 
 
  <welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
  </welcome-file-list> 
 
  <!-- Get rid of error message --> 
  <!-- 
  <security-constraint> 
    <web-resource-collection> 
      <web-resource-name>Disable TRACE</web-resource-name> 
      <url-pattern>/</url-pattern> 
      <http-method>TRACE</http-method> 
    </web-resource-collection> 
    <auth-constraint/> 
  </security-constraint> 
  <security-constraint> 
    <web-resource-collection> 
      <web-resource-name>Enable everything but TRACE</web-resource-name> 
      <url-pattern>/</url-pattern> 
      <http-method-omission>TRACE</http-method-omission> 
    </web-resource-collection> 
  </security-constraint> 
  --> 
</web-app> 

<?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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         metadata-complete="true"
>


  <!-- Uncomment if you are trying to use a Resin version before 3.0.19.
    Their XML implementation isn't entirely compatible with Xerces.
    Below are the implementations to use with Sun's JVM.
  <system-property javax.xml.xpath.XPathFactory=
             "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/>
  <system-property javax.xml.parsers.DocumentBuilderFactory=
             "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/>
  <system-property javax.xml.parsers.SAXParserFactory=
             "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/>
   -->

  <!-- People who want to hardcode their "Solr Home" directly into the
       WAR File can set the JNDI property here...
   -->
    <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>/down/apache-tomcat-8.5.12/solrhome</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

  <!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
  <filter>
    <filter-name>SolrRequestFilter</filter-name>
    <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
    <!--
    Exclude patterns is a list of directories that would be short circuited by the 
    SolrDispatchFilter. It includes all Admin UI related static content.
    NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath.
    -->
    <init-param>
      <param-name>excludePatterns</param-name>
      <param-value>/libs/. ,/css/. ,/js/. ,/img/. ,/tpl/. </param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <!--
      NOTE: When using multicore, /admin JSP URLs with a core specified
      such as /solr/coreName/admin/stats.jsp get forwarded by a
      RequestDispatcher to /solr/admin/stats.jsp with the specified core
      put into request scope keyed as "org.apache.solr.SolrCore".

      It is unnecessary, and potentially problematic, to have the SolrDispatchFilter
      configured to also filter on forwards.  Do not configure
      this dispatcher as <dispatcher>FORWARD</dispatcher>.
    -->
    <filter-name>SolrRequestFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <servlet>
    <servlet-name>LoadAdminUI</servlet-name>
    <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>
  </servlet>

  <!-- Remove in Solr 5.0 -->
  <!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 -->
  <servlet>
    <servlet-name>RedirectOldAdminUI</servlet-name>
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
    <init-param>
      <param-name>destination</param-name>
      <param-value>${context}/#/</param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>RedirectOldZookeeper</servlet-name>
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
    <init-param>
      <param-name>destination</param-name>
      <param-value>${context}/admin/zookeeper</param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>RedirectLogging</servlet-name>
    <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
    <init-param>
      <param-name>destination</param-name>
      <param-value>${context}/#/~logging</param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>SolrRestApi</servlet-name>
    <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
    <init-param>
      <param-name>org.restlet.application</param-name>
      <param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>RedirectOldAdminUI</servlet-name>
    <url-pattern>/admin/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>RedirectOldAdminUI</servlet-name>
    <url-pattern>/admin</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>RedirectOldZookeeper</servlet-name>
    <url-pattern>/zookeeper.jsp</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>RedirectOldZookeeper</servlet-name>
    <url-pattern>/zookeeper</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>RedirectLogging</servlet-name>
    <url-pattern>/logging</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>LoadAdminUI</servlet-name>
    <url-pattern>/old.html</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>LoadAdminUI</servlet-name>
    <url-pattern>/index.html</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>SolrRestApi</servlet-name>
    <url-pattern>/schema/*</url-pattern>
  </servlet-mapping>

  <mime-mapping>
    <extension>.xsl</extension>
    <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
    <mime-type>application/xslt xml</mime-type>
  </mime-mapping>

  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>

  <!-- Get rid of error message -->
  <!--
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Disable TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method>TRACE</http-method>
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Enable everything but TRACE</web-resource-name>
      <url-pattern>/</url-pattern>
      <http-method-omission>TRACE</http-method-omission>
    </web-resource-collection>
  </security-constraint>
  -->
</web-app>

至此solr的配置工作完成

二、jdk安装与配置:

1、安装

cd /down 
tar -zxvf jdk-8u121-linux-x64.tar.gz //解压缩jdk包 
解压后jdk的路径应该为 
/down/jdk1.8.0_121/ 

cd /down
tar -zxvf jdk-8u121-linux-x64.tar.gz //解压缩jdk包
解压后jdk的路径应该为
/down/jdk1.8.0_121/

2、配置:

修改系统环境变量文件:

vi /etc/profile 

vi /etc/profile

向文件里面追加以下内容:

JAVA_HOME=/down/jdk1.8.0_121 
JRE_HOME=/down/jdk1.8.0_121/jre 
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib 
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin 
export JAVA_HOME JRE_HOME CLASS_PATH PATH 

JAVA_HOME=/down/jdk1.8.0_121
JRE_HOME=/down/jdk1.8.0_121/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

是修改生效:

[[email protected] local]# source /etc/profile  //使修改立即生效 
[[email protected] local]# echo $PATH  //查看PATH值 

[[email protected] local]# source /etc/profile   //使修改立即生效 
[[email protected] local]# echo $PATH   //查看PATH值

查看系统环境状态:

[[email protected] down]# echo $PATH 
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/down/jdk1.8.0_121/bin:/down/jdk1.8.0_121/jre/bin:/root/bin 
[[email protected] down]# 

[[email protected] down]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/down/jdk1.8.0_121/bin:/down/jdk1.8.0_121/jre/bin:/root/bin
[[email protected] down]# 

查看JAVA版本:

[[email protected] down]# java -version 
java version "1.8.0_121" 
Java(TM) SE Runtime Environment (build 1.8.0_121-b13) 
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) 
[[email protected] down]# 

[[email protected] down]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
[[email protected] down]# 

至此jdk安装完毕。

一、安装准备及各软件使用版本说明:

1、JDK8,版本jdk1.8.0_121下载地址:jdk-8u121-linux-x64.tar.gz

2、Apache Tomcat,版本8.5.13 下载地址:apache-tomcat-8.5.13.tar.gz

3、Solr,版本solr-6.5.0,下载地址:solr-6.5.0.tgz

此文使用的是CentOS 6.6的系统。在系统根目录下建立down目录。然后依次下载上面的三个软件。下载完成后如下:

/down
├── apache-tomcat-8.5.12.tar.gz
├── jdk-8u121-linux-x64.tar.gz
└── solr-6.5.0.tgz

CentOS 6.6上安装与配置Solr 6.5

这篇文章主要是介绍在CentOS 6.6上Solr 6.5的安装与配置。

TAG标签:
版权声明:本文由澳门新葡8455手机版发布于新京葡娱乐场网址,转载请注明出处:单机版笔记,6上安装与安顿Solr