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.

扫描二维码关注公众号,回复: 3310174 查看本文章

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安装成功!!!

猜你喜欢

转载自blog.csdn.net/sjmz30071360/article/details/81603978