Solr学习笔记(1):Solr 8.1.0 安装(启动cloud)

举报
隔壁老汪 发表于 2022/06/23 23:05:32 2022/06/23
【摘要】 安装文档说明 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://m...

安装文档说明

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

目录 说明


  
  1. Directory Layout
  2. After installing Solr, you’ll see the following directories and files within them:
  3. bin/
  4. This directory includes several important scripts that will make using Solr easier.
  5. solr and solr.cmd
  6. 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.
  7. post
  8. The PostTool, which provides a simple command line interface for POSTing content to Solr.
  9. solr.in.sh and solr.in.cmd
  10. 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.
  11. install_solr_services.sh
  12. 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.
  13. contrib/
  14. Solr’s contrib directory includes add-on plugins for specialized features of Solr.
  15. dist/
  16. The dist directory contains the main Solr .jar files.
  17. docs/
  18. The docs directory includes a link to online Javadocs for Solr.
  19. example/
  20. 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.
  21. licenses/
  22. The licenses directory includes all of the licenses for 3rd party libraries used by Solr.
  23. server/
  24. 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:
  25. Solr’s Admin UI (server/solr-webapp)
  26. Jetty libraries (server/lib)
  27. Log files (server/logs) and log configurations (server/resources). See the section Configuring Loggingfor more details on how to customize Solr’s default logging.
  28. Sample configsets (server/solr/configsets)

 

启动

./solr status 


  
  1. [root@SERVERNJ221 bin]# ./solr start -h
  2. ERROR: Hostname is required when using the -h option!
  3. 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]
  4. -f Start Solr in foreground; default starts Solr in the background
  5. and sends stdout / stderr to solr-PORT-console.log
  6. -c or -cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
  7. solr.in.sh, an embedded ZooKeeper instance is started on Solr port+1000,
  8. such as 9983 if Solr is bound to 8983
  9. -h <host> Specify the hostname for this Solr instance
  10. -p <port> Specify the port to start the Solr HTTP listener on; default is 8983
  11. The specified port (SOLR_PORT) will also be used to determine the stop port
  12. STOP_PORT=($SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=($SOLR_PORT+10000).
  13. For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985
  14. -d <dir> Specify the Solr server directory; defaults to server
  15. -z <zkHost> Zookeeper connection string; only used when running in SolrCloud mode using -c
  16. If neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified,
  17. an embedded ZooKeeper instance will be launched.
  18. -m <memory> Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
  19. results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m
  20. -s <dir> Sets the solr.solr.home system property; Solr will create core directories under
  21. this directory. This allows you to run multiple Solr instances on the same host
  22. while reusing the same server directory set using the -d parameter. If set, the
  23. specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper.
  24. This parameter is ignored when running examples (-e), as the solr.solr.home depends
  25. on which example is run. The default value is server/solr. If passed relative dir,
  26. validation with current dir will be done, before trying default server/<dir>
  27. -t <dir> Sets the solr.data.home system property, where Solr will store index data in <instance_dir>/data subdirectories.
  28. If not set, Solr uses solr.solr.home for config and data.
  29. -e <example> Name of the example to run; available examples:
  30. cloud: SolrCloud example
  31. techproducts: Comprehensive example illustrating many of Solr's core capabilities
  32. dih: Data Import Handler
  33. schemaless: Schema-less example
  34. -a Additional parameters to pass to the JVM when starting Solr, such as to setup
  35. Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
  36. you could pass: -a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983"
  37. In most cases, you should wrap the additional parameters in double quotes.
  38. -j Additional parameters to pass to Jetty when starting Solr.
  39. For example, to add configuration folder that jetty should read
  40. you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/"
  41. In most cases, you should wrap the additional parameters in double quotes.
  42. -noprompt Don't prompt for input; accept all defaults when running examples that accept user input
  43. -v and -q Verbose (-v) or quiet (-q) logging. Sets default log level to DEBUG or WARN instead of INFO
  44. -V/-verbose Verbose messages from this script

./solr start -e cloud -force


  
  1. [root@SERVERNJ221 bin]# ./solr stop -all
  2. [root@SERVERNJ221 bin]# ./solr start -e cloud -force
  3. Welcome to the SolrCloud example!
  4. This interactive session will help you launch a SolrCloud cluster on your local workstation.
  5. To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]:
  6. 2
  7. Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
  8. Please enter the port for node1 [8983]:
  9. Please enter the port for node2 [7574]:
  10. Solr home directory /wostore/project/solr/solr-8.1.0/example/cloud/node1/solr already exists.
  11. /wostore/project/solr/solr-8.1.0/example/cloud/node2 already exists.
  12. Starting up Solr on port 8983 using command:
  13. "/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" -force
  14. Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require
  15. RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'.
  16. NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.
  17. Started Solr server on port 8983 (pid=20407). Happy searching!
  18. Starting up Solr on port 7574 using command:
  19. "/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 -force
  20. Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require
  21. RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'.
  22. NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 7574.
  23. Started Solr server on port 7574 (pid=20565). Happy searching!

./solr status

文章来源: blog.csdn.net,作者:隔壁老瓦,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/wxb880114/article/details/90407203

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。