如何使用brew将elasticsearch安装为服务

qcuzuvrc  于 2023-05-06  发布在  ElasticSearch
关注(0)|答案(3)|浏览(179)

我想使用brew来安装elasticsearch,但我没有成功地将其安装为一个服务,以便能够像这样启动它:

sudo service elasticsearch start

并且能够阻止它,就像:

sudo service elasticsearch stop

你知道我该怎么做吗?

hrirmatl

hrirmatl1#

编辑:elasticsearch不再是开源的,因此在自制软件中被禁用。试试opensearch。感谢评论指出这一点!

在自制软件中,你不需要以一种特殊的方式将某个东西安装为服务。像往常一样安装它,并将其作为服务启动(如果公式支持它,Elasticsearch就支持)。
所以要安装:

brew install elasticsearch

然后作为服务运行(启动时自动启动):

brew services start elasticsearch

或者,如果你不想/不需要后台服务,你可以运行:

elasticsearch

要停止/kill,只需在执行上述命令的终端上按Ctrl+C即可

iq0todco

iq0todco2#

我在搜索,找到了这个主题。
brew install elasticsearch已弃用。
如果有人发现这篇文章,请使用以下内容代替

brew tap elastic/tap

然后

brew install elastic/tap/elasticsearch-full

运行ElasticSearch服务

brew services start elastic/tap/elasticsearch-full

确保ElasticSearch正在运行

curl http://localhost:9200

输出应该是这样的:

"name": "Mohameds-MacBook-Pro.local",
"cluster_name": "elasticsearch_mohd",
"cluster_uuid": "KxxWtfPBS_WTJ43c8rql8Q",
"version": {
   "number": "7.17.4",
   "build_flavor": "default",
   "build_type": "tar",
   "build_hash": "79878662c54c886ae89206c685d9f1051a9d6411",
   "build_date": "2022-05-18T18:04:20.964345128Z",
   "build_snapshot": false,
   "lucene_version": "8.11.1",
   "minimum_wire_compatibility_version": "6.8.0",
   "minimum_index_compatibility_version": "6.0.0-beta1"
  },
     "tagline": "You Know, for Search"

转诊:
https://itc-4u.com/install-elastic-search-on-macos-with-homebrew/

vlju58qv

vlju58qv3#

安装ElasticSearch:brew更新,然后brew安装elasticsearch启动服务只需输入:elasticsearch停止服务:Ctrl + Z
更多信息:https://chartio.com/resources/tutorials/how-to-install-elasticsearch-on-mac-os-x

相关问题