windows环境 solr-7.4.0安装【一篇就够】

1,前提:java环境已配置好

System Requirements

Apache Solr runs on Java 8 or greater.

It is also recommended to always use the latest update version of your Java VM, because bugs may affect Solr. An overview of known JVM bugs can be found on http://wiki.apache.org/lucene-java/JavaBugs

With all Java versions it is strongly recommended to not use experimental -XX JVM options.

CPU, disk and memory requirements are based on the many choices made in implementing Solr (document size, number of documents, and number of hits retrieved to name a few). The benchmarks page has some information related to performance on particular platforms.

2,solr-7.4.0下载地址:http://mirrors.shu.edu.cn/apache/lucene/solr/7.4.0/solr-7.4.0.zip

3,解压zip文件

Directory Layout

After installing Solr, you’ll see the following directories and files within them:

bin/

This directory includes several important scripts that will make using Solr easier.

solr and solr.cmd

This is Solr’s Control Script, also known as bin/solr (*nix) / bin/solr.cmd (Windows). This script is the preferred tool to start and stop Solr. You can also create collections or cores, configure authentication, and work with configuration files when running in SolrCloud mode.

post

The PostTool, which provides a simple command line interface for POSTing content to Solr.

solr.in.sh and solr.in.cmd

These are property files for *nix and Windows systems, respectively. System-level properties for Java, Jetty, and Solr are configured here. Many of these settings can be overridden when using bin/solr / bin/solr.cmd, but this allows you to set all the properties in one place.

install_solr_services.sh

This script is used on *nix systems to install Solr as a service. It is described in more detail in the section Taking Solr to Production.

contrib/

Solr’s contrib directory includes add-on plugins for specialized features of Solr.

dist/

The dist directory contains the main Solr .jar files.

docs/

The docs directory includes a link to online Javadocs for Solr.

example/

The example directory includes several types of examples that demonstrate various Solr capabilities. See the section Solr Examples below for more details on what is in this directory.

licenses/

The licenses directory includes all of the licenses for 3rd party libraries used by Solr.

server/

This directory is where the heart of the Solr application resides. A README in this directory provides a detailed overview, but here are some highlights:

  • Solr’s Admin UI (server/solr-webapp)

  • Jetty libraries (server/lib)

  • Log files (server/logs) and log configurations (server/resources). See the section Configuring Logging for more details on how to customize Solr’s default logging.

  • Sample configsets (server/solr/configsets)

4,配置solr环境变量至path:C:\20170801\software\solr-7.4.0\bin

5,启动solr

win cmd中,执行solr start即可

C:\Users\Administrator>solr start
ERROR StatusLogger Unable to access file:/C:/20170801/software/solr-7.4.0/server
/file:C:/20170801/software/solr-7.4.0/server/scripts/cloud-scripts/log4j2.xml
 java.io.FileNotFoundException: C:\20170801\software\solr-7.4.0\server\file:C:\2
0170801\software\solr-7.4.0\server\scripts\cloud-scripts\log4j2.xml (文件名、目
录名或卷标语法不正确。)

        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:90)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:188)
        at java.net.URL.openStream(URL.java:1038)
        at org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(Conf
igurationSource.java:247)
        at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get
Configuration(ConfigurationFactory.java:404)
        at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get
Configuration(ConfigurationFactory.java:346)
        at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfigur
ation(ConfigurationFactory.java:260)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
.java:615)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
.java:636)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
231)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:153)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:45)
        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(Abstrac
tLoggerAdapter.java:121)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFac
tory.java:43)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(Abstract
LoggerAdapter.java:46)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFact
ory.java:29)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
        at org.apache.solr.util.SolrCLI.<clinit>(SolrCLI.java:228)
INFO  - 2018-08-12 10:18:45.420; org.apache.solr.util.configuration.SSLCredentia
lProviderFactory; Processing SSL Credential Provider chain: env;sysprop
Waiting up to 30 to see Solr running on port 8983
ERROR StatusLogger Unable to access file:/C:/20170801/software/solr-7.4.0/server
/file:C:/20170801/software/solr-7.4.0/server/resources/log4j2.xml
 java.io.FileNotFoundException: C:\20170801\software\solr-7.4.0\server\file:C:\2
0170801\software\solr-7.4.0\server\resources\log4j2.xml (文件名、目录名或卷标语
法不正确。)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:90)
        at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:188)
        at java.net.URL.openStream(URL.java:1038)
        at org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(Conf
igurationSource.java:247)
        at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get
Configuration(ConfigurationFactory.java:404)
        at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.get
Configuration(ConfigurationFactory.java:346)
        at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfigur
ation(ConfigurationFactory.java:260)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
.java:615)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
.java:636)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
231)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:153)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
4jContextFactory.java:45)
        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(Abstrac
tLoggerAdapter.java:121)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFac
tory.java:43)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(Abstract
LoggerAdapter.java:46)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFact
ory.java:29)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
        at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:38)
        at org.eclipse.jetty.util.log.Slf4jLog.<init>(Slf4jLog.java:32)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at org.eclipse.jetty.util.log.Log.initialized(Log.java:178)
        at org.eclipse.jetty.util.log.Log.getLogger(Log.java:311)
        at org.eclipse.jetty.util.log.Log.getLogger(Log.java:301)
        at org.eclipse.jetty.xml.XmlConfiguration.<clinit>(XmlConfiguration.java
:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.eclipse.jetty.start.Main.invokeMain(Main.java:220)
        at org.eclipse.jetty.start.Main.start(Main.java:486)
        at org.eclipse.jetty.start.Main.main(Main.java:77)
Started Solr server on port 8983. Happy searching!

C:\Users\Administrator>

ERROR部分暂时未找原因,可以暂时先不管

6,浏览器输入 http://localhost:8983/solr/#/ 即可访问

 

                                             !!!恭喜solr安装成功!!!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sjmz30071360

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值