-bash: solr: 在 Mac 中找不到命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35580847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:17:28  来源:igfitidea点击:

-bash: solr: command not found in Mac

javamacosbashsolrlucene

提问by Sun

I am trying to setup Apache Solr in my Mac. I am using Soler-5.5.0 version and Java 1.8. I am trying as per instructions.

我正在尝试在我的 Mac 中设置 Apache Solr。我使用的是 Soler-5.5.0 版本和 Java 1.8。我正在按照说明尝试。

I tried:

我试过:

cd /users/ravi/dev/solr-5.5.0/bin
solr start

But I got error:

但我得到了错误:

-bash: solr: command not found

-bash: solr: 命令未找到

After, I tried:

之后,我试过:

cd /users/ravi/dev/solr-5.5.0/server
java -jar start.jar

I got error:

我有错误:

WARNING: Nothing to start, exiting ...

Usage: java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # for more information

警告:没有开始,退出......

用法:java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # 了解更多信息

How can I setup Solr in Mac?

如何在 Mac 中设置 Solr?

回答by Sonu

I believe the best way to tun Solr as service. Just below steps required:

我相信将 Solr 作为服务的最佳方式。只需以下步骤:

1) download and extract Solr

1)下载并解压Solr

2) Once run sudo bash ./solr-6.5.0/bin/install_solr_service.sh solr-6.5.0.tgz

2)一旦运行 sudo bash ./solr-6.5.0/bin/install_solr_service.sh solr-6.5.0.tgz

3) The above command will setup the environment to run the Solr and start the Solr service.

3)上面的命令将设置运行Solr并启动Solr服务的环境。

4) Then play around the service with below commands:sudo service solr status, sudo service solr restart, sudo service solr stop, sudo service solr start

4) 然后使用以下命令运行该服务:sudo service solr status, sudo service solr restart, sudo service solr stop,sudo service solr start

No further setup required and It's the recommended way for production.

无需进一步设置,这是推荐的生产方式。

回答by Sun

Yes, I did a mistake that I have to do:

是的,我犯了一个我必须做的错误:

cd /users/ravi/dev/solr-5.5.0
./bin solr start

But I did

但我做到了

cd /users/ravi/dev/solr-5.5.0/bin
solr start

Anyway, it is working now.

无论如何,它现在正在工作。

回答by K.Boyette

If you installed via Homebrew you should just be able to run

如果您通过 Homebrew 安装,您应该能够运行

solr start

and then to stop

然后停止

solr stop

another thing you could try if you didn't install using homebrew is using cd to get into your solr directory and running

如果您没有使用自制软件进行安装,您可以尝试的另一件事是使用 cd 进入您的 solr 目录并运行

bin/solr start

The easiest way to troubleshoot this issue is by checking your bin directory to see if you even have solr mapped there. It looks as though solr isn't found in your bin directory (I could be wrong. I'm just going off your error message).

解决此问题的最简单方法是检查您的 bin 目录,看看您是否甚至在那里映射了 solr。看起来好像在您的 bin 目录中找不到 solr(我可能是错的。我只是要关闭您的错误消息)。

EDIT:

编辑:

If solr was installed as a service, you might have to use

如果 solr 作为服务安装,您可能必须使用

sudo service solr start

sudo service solr start