【发布时间】:2019-11-12 06:16:23
【问题描述】:
我试图在我的 Mac 机器上将 elasticsearch 从 6.8.4 降级到 5.6。但不知何故,我弄乱了 6.8.4 的现有安装,现在我既无法修复当前安装的版本,也无法安装 5.6
详情:
我的系统上正确安装了 6.8.4,我成功地访问了http://localhost:9200/ 端口并查看了版本信息和所有其他详细信息。但由于依赖,我不得不将版本降级到 5.6
我遵循本指南 https://gist.github.com/govindpatel/0660b33a343b807664972b53c3b12ca0 并通过删除 plist 条目和其他详细信息来搞乱 6.8.4 的安装。现在,当我尝试通过键入 $ elasticsearch 来启动弹性搜索服务时,我得到:-bash: elasticsearch: command not found 和 $ brew service restart elasticsearch 给了我 Error: Unknown command: service
但是,当我触发这个命令时,我仍然可以看到 6.8.4:
$ brew info elasticsearch
elasticsearch: stable 6.8.4, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb
==> Requirements
Required: java = 1.8 ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
Data: /usr/local/var/lib/elasticsearch/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
==> Analytics
install: 8,690 (30 days), 23,748 (90 days), 122,267 (365 days)
install_on_request: 8,233 (30 days), 22,565 (90 days), 114,157 (365 days)
build_error: 0 (30 days)
我什至尝试安装 5.6(通过 Homebrew) - brew install elasticsearch@5.6 并将 PATH 设置在 ~/.bash_profile 的首位,但没有运气! :(
请帮助和建议:
- 如何修复现有的 6.8.4 版本,以及
- 我怎样才能系统地降级(因为现有的conf,数据位于/usr/local文件夹下)
当前详细信息:查看 elasticsearch 是否正在运行:$ launchctl list | grep elasticsearch,我得到:- 1 homebrew.mxcl.elasticsearch@5.6,但我目前没有安装(附上 o/p)-$ brew uninstall elasticsearch@5.6 ~> Error: No such keg: /usr/local/Cellar/elasticsearch@5.6
[更新-1]
发完这个,我又试了运行ES安装命令:brew install elasticsearch
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
No changes to formulae.
==> Downloading
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.8.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/downloads/elasticsearch-oss-6.8.4.tar.gz
==> Caveats
Data: /usr/local/var/lib/elasticsearch/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
==> Summary
???? /usr/local/Cellar/elasticsearch/6.8.4: 133 files, 103.2MB, built in 6 seconds
然后启动服务$ brew services start elasticsearch ~> ==> Successfully startedelasticsearch(label: homebrew.mxcl.elasticsearch)。现在,当我尝试访问端口时:http://localhost:9200 - 它正在工作(从 0 安装虽然修复了这个问题!)
{
"name" : "DwQRyf7",
"cluster_name" : "elasticsearch_Puneet",
"cluster_uuid" : "hLAu9onQSiuQHOpm_e9IKw",
"version" : {
"number" : "6.8.4",
"build_flavor" : "oss",
"build_type" : "tar",
"build_hash" : "bca0c8d",
"build_date" : "2019-10-16T06:19:49.319352Z",
"build_snapshot" : false,
"lucene_version" : "7.7.2",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
现在唯一的问题是,如何系统地降级?
[更新-2]
现在我有 6.8.4,我检查了其他版本:brew search elasticsearch 并得到了 5.6。然后我用brew install elasticsearch@5.6安装了5.6
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.
==> Downloading https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz
Already downloaded: /Library/Caches/Homebrew/downloads/3d7cc028f605699065bd403b0a2383db8d7413c570df57e26fc87a735126c96c--elasticsearch-5.6.16.tar.gz
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_Puneet/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
Plugins: /usr/local/opt/elasticsearch@5.6/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
plugin script: /usr/local/opt/elasticsearch@5.6/libexec/bin/elasticsearch-plugin
elasticsearch@5.6 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have elasticsearch@5.6 first in your PATH run:
echo 'export PATH="/usr/local/opt/elasticsearch@5.6/bin:$PATH"' >> ~/.bash_profile
To have launchd start elasticsearch@5.6 now and restart at login:
brew services start elasticsearch@5.6
Or, if you don't want/need a background service you can just run:
/usr/local/opt/elasticsearch@5.6/bin/elasticsearch
==> Summary
???? /usr/local/Cellar/elasticsearch@5.6/5.6.16: 106 files, 36.0MB, built in 6 seconds
然后我将 5.6 添加到 $PATH。现在,当我尝试使用 brew switch elasticsearch 5.6 切换弹性搜索版本时,我得到:
Error: elasticsearch does not have a version "5.6" in the Cellar.
elasticsearch installed versions: 6.8.4
知道我在这里缺少什么吗?
【问题讨论】:
标签: elasticsearch elasticsearch-rails