mel
mel

Reputation: 2790

How to install elasticsearch as a service using brew

I want to use brew to install elasticsearch but I don't succeed to install it as a service to be able to start it like:

sudo service elasticsearch start

and to be able to stop it like:

sudo service elasticsearch stop

Do you know how I can do it?

Upvotes: 2

Views: 11392

Answers (3)

Maccesch
Maccesch

Reputation: 2128

EDIT: elasticsearch is no longer open source and so has been disabled in homebrew. Try opensearch instead. Thanks to the comments for pointing this out!


In homebrew you don't need to install sth as a service in a special way. Install it as usual and start it as a service (if the formula supports it, which elasticsearch does).

So to install:

brew install elasticsearch

and then to run as a service (with autostart on startup):

brew services start elasticsearch

Or, if you don't want/need a background service you can just run:

elasticsearch

To stop/kill, just press Ctrl+C on the terminal where you executed above command

Upvotes: 7

Mohamed Elkashef
Mohamed Elkashef

Reputation: 168

I was searching and found this topic.

brew install elasticsearch deprecated.

if someone find this post please use the following instead

brew tap elastic/tap

then

brew install elastic/tap/elasticsearch-full

run elastic search service

brew services start elastic/tap/elasticsearch-full

make sure elastic search is running

curl http://localhost:9200

the output should be like this:

"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"

referral:

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

Upvotes: 2

emil dragan
emil dragan

Reputation: 9

to install elastic search: brew update and then brew install elasticsearch to start the service just type in: elasticsearch to stop the service: Ctrl + Z

more information: https://chartio.com/resources/tutorials/how-to-install-elasticsearch-on-mac-os-x

Upvotes: 0

Related Questions