最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Mac本地查看已安装的Solr的版本

Mac crifan 1954浏览 0评论

折腾:

【记录】Mac本地Solr中新建qa的collection再运行脚本导入数据

期间,想要去查看Mac本地中之前已安装的Solr的版本,所以去试试–version:

<code>➜  solr git:(master) ✗ solr --version
ERROR: --version is not supported by this script

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 background
                  and sends stdout / stderr to solr-PORT-console.log

  -c or -cloud  Start Solr in SolrCloud mode; if -z not supplied, an embedded Zookeeper
                  instance is started on Solr port+1000, such as 9983 if Solr is bound to 8983

  -h &lt;host&gt;     Specify the hostname for this Solr instance

  -p &lt;port&gt;     Specify the port to start the Solr HTTP listener on; default is 8983
                  The specified port (SOLR_PORT) will also be used to determine the stop port
                  STOP_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 &lt;dir&gt;      Specify the Solr server directory; defaults to server

  -z &lt;zkHost&gt;   Zookeeper connection string; only used when running in SolrCloud mode using -c
                   To launch an embedded Zookeeper instance, don't pass this parameter.

  -m &lt;memory&gt;   Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g
                  results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m

  -s &lt;dir&gt;      Sets the solr.solr.home system property; Solr will create core directories under
                  this directory. This allows you to run multiple Solr instances on the same host
                  while reusing the same server directory set using the -d parameter. If set, the
                  specified 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 depends
                  on 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/&lt;dir&gt;

  -t &lt;dir&gt;      Sets the solr.data.home system property, where Solr will store data (index).
                  If not set, Solr uses solr.solr.home for config and data.

  -e &lt;example&gt;  Name of the example to run; available examples:
      cloud:         SolrCloud example
      techproducts:  Comprehensive example illustrating many of Solr's core capabilities
      dih:           Data Import Handler
      schemaless:    Schema-less example

  -a            Additional parameters to pass to the JVM when starting Solr, such as to setup
                  Java debug options. For example, to enable a Java debugger to attach to the Solr JVM
                  you 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 read
                  you 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 or -verbose Verbose messages from this script
</code>

不支持–version,换成-V,结果却开始以verbose模式去运行了:

<code>➜  solr git:(master) ✗ solr -V
Using Solr root directory: /usr/local/Cellar/solr/7.2.1
Using Java: java
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
Archiving 1 old GC log files to /usr/local/Cellar/solr/7.2.1/server/logs/archived
Archiving 1 console log files to /usr/local/Cellar/solr/7.2.1/server/logs/archived
Rotating solr logs, keeping a max of 9 generations

Starting Solr using the following settings:
    JAVA            = java
    SOLR_SERVER_DIR = /usr/local/Cellar/solr/7.2.1/server
    SOLR_HOME       = /usr/local/Cellar/solr/7.2.1/server/solr
    SOLR_HOST       =
    SOLR_PORT       = 8983
    STOP_PORT       = 7983
    JAVA_MEM_OPTS   = -Xms512m -Xmx512m
    GC_TUNE         = -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:-OmitStackTraceInFastThrow
    GC_LOG_OPTS     = -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/usr/local/Cellar/solr/7.2.1/server/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M
    SOLR_TIMEZONE   = UTC
    SOLR_OPTS       = -Xss256k -Dsolr.jetty.https.port=8983

Waiting up to 180 seconds to see Solr running on port 8983 [-]
Started Solr server on port 8983 (pid=41795). Happy searching!
</code>

不过是看到了solr版本是7.2.1

不过还是想要知道,Mac当前安装的Solr的版本是多少。

想到了之前好像是通过brew安装的,所以猜测和试试:

<code>➜  solr git:(master) ✗ brew list solr
/usr/local/Cellar/solr/7.2.1/bin/oom_solr.sh
/usr/local/Cellar/solr/7.2.1/bin/post
/usr/local/Cellar/solr/7.2.1/bin/solr
/usr/local/Cellar/solr/7.2.1/bin/solr-8983.pid
/usr/local/Cellar/solr/7.2.1/example/example-DIH/ (206 files)
...
/usr/local/Cellar/solr/7.2.1/server/ (2 files)
/usr/local/Cellar/solr/7.2.1/share/solr/solr.in.sh
➜  solr git:(master) ✗ brew info solr
solr: stable 7.2.1
Enterprise search platform from the Apache Lucene project
https://lucene.apache.org/solr/
/usr/local/Cellar/solr/7.2.1 (1,670 files, 254.6MB) *
  Built from source on 2018-08-16 at 14:22:46
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/solr.rb
==&gt; Requirements
Required: java ✔
==&gt; Caveats
To have launchd start solr now and restart at login:
  brew services start solr
Or, if you don't want/need a background service you can just run:
  solr start
➜  solr git:(master) ✗
</code>

虽然清楚了此处Mac中查看Solr的版本,

但是还是想要去搞清楚,solr命令行中如何查看其版本

solr version command line

How do I find out version of currently running Solr? – Stack Overflow

database – Check if Solr index is empty by command line – Stack Overflow

How run solr from command line? – Stack Overflow

<code>➜  solr git:(master) ✗ solr info

ERROR: info is not a valid command!

Usage: solr COMMAND OPTIONS
       where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk, auth, assert

  Standalone server example (start Solr running in the background on port 8984):

    ./solr start -p 8984

  SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options enabled):

    ./solr start -c -m 1g -z localhost:2181 -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"

Pass -help after any COMMAND to see command-specific usage information,
  such as:    ./solr start -help or ./solr stop -help

➜  solr git:(master) ✗ solr infos

ERROR: infos is not a valid command!


Usage: solr COMMAND OPTIONS
       where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk, auth, assert

  Standalone server example (start Solr running in the background on port 8984):

    ./solr start -p 8984

  SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options enabled):

    ./solr start -c -m 1g -z localhost:2181 -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"

Pass -help after any COMMAND to see command-specific usage information,
  such as:    ./solr start -help or ./solr stop -help
</code>

solr info或infos,都不支持。

Solr version command syntax and examples | Lucene and Solr Reference

<code>➜  solr git:(master) ✗ solr version
7.2.1
</code>

结果是version,才输出版本。

【总结】

此处Mac中之前通过brew安装的solr,想要查看solr的版本信息:

  • 方式1:solr命令行

    • solr version

  • 方式2:通过brew查看版本信息

    • brew list solr

    • brew info solr

都可以看到此处的版本是:7.2.1

转载请注明:在路上 » 【已解决】Mac本地查看已安装的Solr的版本

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.185 seconds, using 23.40MB memory