Apple Silicon macOS通过Homebrew安装Elasticsearch失败求助
在Apple Silicon macOS Sonoma上通过Homebrew安装Elasticsearch的问题与解决方法
问题描述
在Apple Silicon架构的macOS Sonoma系统上,尝试通过Homebrew安装Elasticsearch时遇到多个问题,常规安装方法均无效。
已尝试操作
1. 直接通过Homebrew安装
执行命令:
brew install elasticsearch
得到提示:
Warning: No available formula with the name "elasticsearch". Did you mean elasticsearch-full?
2. 使用Elastic官方tap源安装
执行命令:
brew tap elastic/tap brew install elastic/tap/elasticsearch-full
安装失败,报错:
'conflicts_with "elasticsearch"' should be removed from elasticsearch-full.rb. Please report this issue to the elastic/homebrew-tap tap ... MethodDeprecatedError: Calling rmtree is disabled! Use FileUtils#rm_r instead.
需求目标
通过Homebrew安装并运行Elasticsearch 8.x版本,并使用brew services将其设为后台系统服务。
环境信息
- macOS:Sonoma(Apple Silicon)
- Homebrew:最新版本(已完成自动更新)
- 终端:zsh
解决步骤
方法1:安装指定8.x版本的Elasticsearch-full
- 移除旧的Elastic tap(如果已添加):
brew untap elastic/tap
- 重新添加官方tap:
brew tap elastic/tap
- 安装8.x系列的elasticsearch-full(以8.13.4为例,可替换为最新8.x版本号):
brew install elastic/tap/elasticsearch-full@8
- 启动后台服务:
brew services start elastic/tap/elasticsearch-full@8
- 验证安装:
执行以下命令,若返回Elasticsearch的版本信息则说明安装成功:
curl http://localhost:9200
方法2:临时修复Formula冲突问题(若方法1仍报错)
如果安装时仍出现conflicts_with相关报错,可手动修改Formula文件:
- 打开elasticsearch-full的Formula编辑界面:
brew edit elastic/tap/elasticsearch-full
- 在打开的文件中找到并删除
conflicts_with "elasticsearch"这一行,保存退出。 - 重新执行安装命令:
brew install elastic/tap/elasticsearch-full@8
- 后续启动服务和验证步骤同方法1。
内容的提问来源于stack exchange,提问作者seyedrezabazyar
相关产品推荐
相关产品推荐

