热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Solr学习笔记(1):Solr8.1.0安装(启动cloud)

安装文档说明http:lucene.apache.orgsolrguide7_7installing-solr.html下载安装包http:www.apache.orgdync
安装文档说明

http://lucene.apache.org/solr/guide/7_7/installing-solr.html

 

下载安装包

http://www.apache.org/dyn/closer.lua/lucene/solr/8.1.0/solr-8.1.0.tgz

wget http://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/8.1.0/solr-8.1.0.tgz

 

解压安装包

tar -zxvf  solr-8.1.0.tgz

目录 说明

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.cmdThis 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.postThe PostTool, which provides a simple command line interface for POSTing content to Solr.solr.in.sh and solr.in.cmdThese 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.shThis 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 Loggingfor more details on how to customize Solr’s default logging.
Sample configsets (server/solr/configsets)

 

启动

./solr status 

[root@SERVERNJ221 bin]# ./solr start -hERROR: Hostname is required when using the -h option!Usage: solr start [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-t solr.data.home] [-a "additional-options"] [-V]-f Start Solr in foreground; default starts Solr in the backgroundand sends stdout / stderr to solr-PORT-console.log-c or -cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined insolr.in.sh, an embedded ZooKeeper instance is started on Solr port+1000,such as 9983 if Solr is bound to 8983-h Specify the hostname for this Solr instance-p Specify the port to start the Solr HTTP listener on; default is 8983The specified port (SOLR_PORT) will also be used to determine the stop portSTOP_PORT=($SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=($SOLR_PORT+10000). For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985-d

Specify the Solr server directory; defaults to server-z Zookeeper connection string; only used when running in SolrCloud mode using -cIf neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified,an embedded ZooKeeper instance will be launched.-m Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4gresults in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m-s Sets the solr.solr.home system property; Solr will create core directories underthis directory. This allows you to run multiple Solr instances on the same hostwhile reusing the same server directory set using the -d parameter. If set, thespecified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper.This parameter is ignored when running examples (-e), as the solr.solr.home dependson which example is run. The default value is server/solr. If passed relative dir,validation with current dir will be done, before trying default server/-t Sets the solr.data.home system property, where Solr will store index data in /data subdirectories.If not set, Solr uses solr.solr.home for config and data.-e Name of the example to run; available examples:cloud: SolrCloud exampletechproducts: Comprehensive example illustrating many of Solr's core capabilitiesdih: Data Import Handlerschemaless: Schema-less example-a Additional parameters to pass to the JVM when starting Solr, such as to setupJava debug options. For example, to enable a Java debugger to attach to the Solr JVMyou could pass: -a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"In most cases, you should wrap the additional parameters in double quotes.-j Additional parameters to pass to Jetty when starting Solr.For example, to add configuration folder that jetty should readyou could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/"In most cases, you should wrap the additional parameters in double quotes.-noprompt Don't prompt for input; accept all defaults when running examples that accept user input-v and -q Verbose (-v) or quiet (-q) logging. Sets default log level to DEBUG or WARN instead of INFO-V/-verbose Verbose messages from this script

./solr start -e cloud -force

[root@SERVERNJ221 bin]# ./solr stop -all
[root@SERVERNJ221 bin]# ./solr start -e cloud -forceWelcome to the SolrCloud example!This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]:
2
Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]: Please enter the port for node2 [7574]: Solr home directory /wostore/project/solr/solr-8.1.0/example/cloud/node1/solr already exists.
/wostore/project/solr/solr-8.1.0/example/cloud/node2 already exists.Starting up Solr on port 8983 using command:
"/wostore/project/solr/solr-8.1.0/bin/solr" start -cloud -p 8983 -s "/wostore/project/solr/solr-8.1.0/example/cloud/node1/solr" -forceWarning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require
RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'.NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.Started Solr server on port 8983 (pid=20407). Happy searching!Starting up Solr on port 7574 using command:
"/wostore/project/solr/solr-8.1.0/bin/solr" start -cloud -p 7574 -s "/wostore/project/solr/solr-8.1.0/example/cloud/node2/solr" -z localhost:9983 -forceWarning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require
RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'.NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 7574.Started Solr server on port 7574 (pid=20565). Happy searching!

./solr status


推荐阅读
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有