必赢手机app下载 / Blog / 必赢手机app下载 / 必赢手机app下载5在Centos7上的安装与配置,04安装部署solr7
必赢手机app下载 21

必赢手机app下载5在Centos7上的安装与配置,04安装部署solr7

VMware12.0+Ubuntu16.04+jdk1.8.0_171+Tomcat8.0.53+solr7.4.0

Solr6.5在Centos7上的安装与配置 (意气风发卡塔尔(قطر‎那篇作品首即便介绍在Centos6上Solr6.5的装置与布局。
生机勃勃、安装计划及各软件应用版本表明:
1、JDK8,版本jdk1.8.0_121下载地址:jdk-8u121-linux-x64.tar.gz
2、Apache 汤姆cat,版本8.5.13 下载地址:apache-tomcat-8.5.13.tar.gz
3、Solr,版本solr-6.5.0,下载地址:solr-6.5.0.tgz
此文使用的是centos6.6的系列。在系统根目录下创设down目录。然后依次下载上边的多个软件。下载达成后如下:
/down
├── apache-tomcat-8.5.12.tar.gz
├── jdk-8u121-linux-x64.tar.gz
└── solr-6.5.0.tgz
二、jdk安装与配置:
1、安装

率先走访安装成功的分界面,回忆一下,哈哈哈……

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

必赢手机app下载 1

2、配置:

在装置配备solr此前,先安装好jdk1.8和汤姆cat8.0的情状,然后对下载好的solr实行解压:

纠正系统情况变量文件:

必赢手机app下载 2

vi /etc/profile

解压后的公文夹有以下内容:

向文件之中追加以下内容:

必赢手机app下载 3

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

然后大家进去到/server/solr-webapp目录,里面有四个webapp,将这一个webapp复制到/usr/local/solr/tomcat/apache-tomcat-8.0.53/webapps下并从命名称叫solr(名字随意起卡塔尔(英语:State of Qatar),这里命名称叫solr。

使改善生效:

必赢手机app下载 4

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

必赢手机app下载 5

查阅系统环情:

将~/Downloads/solr-7.4.0/server/lib/ext下的具备jar都复制到/usr/local/solr/tomcat/apache-tomcat-8.0.53/webapps/solr/WEB-INF/lib下边。(那些solr正是地点一步的solr)

[root@localhost 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
[root@localhost down]# 

必赢手机app下载 6

查看JAVA版本:

 将~/Downloads/solr-7.4.0/server/lib目录下metrics相关的jar都复制到/usr/local/solr/tomcat/apache-tomcat-8.0.53/webapps/solr/WEB-INF/lib下边。

[root@localhost 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)
[root@localhost down]# 

必赢手机app下载 7

于今结束jdk安装收尾。

将~/Downloads/solr-7.4.0/server/resources下的jetty-logging.properties和log4j2.xml七个文件复制到/usr/local/solr/tomcat/apache-tomcat-8.0.53/webapps/solr/WEB-INF/classes下边。(classes文件夹若无索要自个儿创立,那是日记文件)

二、Solr安装与安顿:

 必赢手机app下载 8

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

创建solrhome:复制~/Downloads/solr-7.4.0/server下的solr文件夹,到任意目录处(能够重新命名,小编尚未重新命名,作者的solrhome路线为:/usr/local/solr/solrhome),自定义solrhome

[root@localhost down]# tar -zxvf apache-tomcat-8.5.12.tar.gz 
[root@localhost down]# tar -zxvf solr-6.5.0.tgz 




解压后的目录结构:
[root@localhost 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

 必赢手机app下载 9

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

配置solrhome路径,修改/usr/local/solr/tomcat/apache-tomcat-8.0.53/webapps/solr/WEB-INF下面的web.xml文件。

必赢手机app下载 10

 那风流洒脱部分原本是注释的,把注释去掉就好了。

 必赢手机app下载 11

撤销权限调整,注释web.xml中的最终几行代码,不然项目会包403。

必赢手机app下载 12

其余,也需改良/usr/local/tomcat/apache-tomcat-8.0.53/bin里面包车型大巴catalina.sh*文件,不改正运维会报以下错误:

必赢手机app下载 13

 改正内容为下图框框内的文字:

必赢手机app下载 14

修正后,汤姆cat运行成功。

 必赢手机app下载 15

做客localhost:8080,现身转手页面说成功。

必赢手机app下载 16

开始化solr-home的数据,在solr-home文件下建一个core1(名字随便取),复制solr-home/configsets/_default/下的conf文件夹,到新建的core1下,在core1下开创文件夹data(空文件加就能够)和core.properties(内容只布置name=core1就能够,这里的name的值也正是在页面要突显的solrhome名称卡塔尔(英语:State of Qatar)

 必赢手机app下载 17

必赢手机app下载 18

必赢手机app下载 19

访问#/

 必赢手机app下载 20

  选用自定义的core1,能够看来core1的连锁消息,完结陈设! 

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

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

3)将solr压缩包中solr/server/lib/metrics* 以前的jar全体复制到 汤姆cat
webappssolrWEB-INFlib 目录中; 

4)将solr压缩包中solr/server/lib/solr-dataimporthandler-* 最初的jar全体复制到
汤姆cat webappssolrWEB-INFlib 目录中; 

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

6)在tomcat目录下成立solrhome目录(也足以放在其余目录中)

7)复制solr/server/solr/*
全数文件到tomcat/solrhome目录,用到成立solr的core时利用。

操作shell如下:

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

3、配置Solr:

编辑web.xml文件:

[root@localhost 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>

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>
-->

整套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

     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的配置职业落成.

三、运行Solr:

 运转实行:/down/apache-tomcat-8.5.12/bin/startup.sh

[root@localhost 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.
[root@localhost down]# 

在浏览器输入 

必赢手机app下载 21

关闭solr只供给关闭tomcat就能够:

[root@localhost down]# /down/apache-tomcat-8.5.12/bin/shutdown.sh

至此solr的安装实现。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

相关文章

网站地图xml地图