Solr 8.3.1:找不到或加载org.apache.solr.util.SolrCLI

时间:2019-12-19 15:59:14

标签: java apache solr java-8 solr8

因此,我是Solr的新手,并且大部分时间都在学习使用Solr 8.3.1(发布时的最新版本)的教程。

我在Windows 10计算机上安装了Java版本1.8.0_181,并且已将solr / bin添加到PATH变量中。

运行solr start会得到:

/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1525: ulimit: -m: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
*** [WARN] *** Your open file limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1542: [: !=: unary operator expected
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=). Happy searching!

哪个告诉我它开始运行,但是当我运行solr status时,我得到:

Found 1 Solr nodes:

Solr process 56136 from /d/Program Files and Documents/solr-8.3.1/bin/solr-8983.pid not found.

似乎不正确。无论如何,我还是继续学习本教程并运行solr start -e cloud并得到:

$ solr start -e cloud
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1525: ulimit: -m: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
*** [WARN] *** Your open file limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 256.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
/d/Program Files and Documents/solr-8.3.1/bin/solr: line 1542: [: !=: unary operator expected
Error: Could not find or load main class org.apache.solr.util.SolrCLI

我尝试了solr start -e techproducts,但结果相同。

我已经在Solr的早期版本中看到了有关此问题的答案,通常这些答案都涉及到更新Solr的版本...我已经是最新的了吗?我敢肯定我缺少一些愚蠢的东西,但是任何朝着正确方向指点的指针将不胜感激!非常感谢!

编辑1:解决了!使用基于Cygwin的Git Bash。在Windows Command Prompt和Windows Powershell中可以像超级按钮一样工作。

solr start的输出:

Java HotSpot(TM) 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.
Waiting up to 30 to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!

solr status的输出:

Found Solr process 50764 running on port 8983
{
  "solr_home":"D:\\Program Files and Documents\\solr-8.3.1\\server\\solr",
  "version":"8.3.1 a3d456fba2cd1b9892defbcf46a0eb4d4bb4d01f - ishan - 2019-11-29 11:51:37",
  "startTime":"2019-12-19T22:20:25.127Z",
  "uptime":"0 days, 0 hours, 0 minutes, 14 seconds",
  "memory":"176.3 MB (%34.4) of 512 MB"}

solr start -e cloud的输出:


Welcome 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]:

1 个答案:

答案 0 :(得分:2)

似乎您正在bin/solr路径下在cygwin下运行/d/...的* nix版本。在Windows下,您应该将bin/solr.cmd命令与标准命令行控制台(´cmd.exe`)一起使用。

似乎solr.in脚本包含cygwin中bash版本无法识别的选项。我猜想这也可能会影响类路径的设置,这意味着无法在期望的位置找到类。