1

在我的网络应用程序上设置搜索字段。为此,我需要使用一个名为 searchkick 的 gem 来安装 elasticsearch 和 java。

成功安装了 java 并在 Java 网站上验证了这一点(使用 firefox)->您已安装推荐的 Java(版本 7 更新 67)。

使用 brew 命令安装了 elasticsearch

见下面的代码

Neils-MacBook-Pro:yelpdemo neilpatel$ brew info elasticsearch
elasticsearch: stable 0.90.7, HEAD
http://www.elasticsearch.org
/usr/local/Cellar/elasticsearch/0.90.7 (31 files, 19M) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/elasticsearch.rb
==> Caveats
Data:    /usr/local/var/elasticsearch/elasticsearch_neilpatel/
Logs:    /usr/local/var/log/elasticsearch/elasticsearch_neilpatel.log
Plugins: /usr/local/var/lib/elasticsearch/plugins/

To have launchd start elasticsearch at login:
    ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load elasticsearch now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
    elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml

当我尝试使用此命令启动弹性搜索时

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist

它给了我错误

launchctl: Couldn't stat("/Users/neilpatel/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist"): No such file or directory
nothing found to load

当我尝试

elasticsearch -f -D es.config=/usr/local/opt/elasticsearch/config/elasticsearch.yml

我没有检测到 java

4

2 回答 2

1

brew安装后elasticsearch尝试

ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents

信息来自:mubix/WhiteChapel

于 2014-09-15T09:27:27.750 回答
0

Homebrew 使用 '/usr/local/' 而不是 '/Users/neilpatel/' 这样你就不必在 'brew install' 时使用'sudo' ... https://github.com/Homebrew/homebrew /wiki/安装

只需将 /Users/neilpatel/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist 替换为 /usr/local/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist。

Stephane 的回答向您展示了 plist 文件在您的计算机上的位置。

于 2014-09-20T16:21:54.543 回答