If you don't have homebrew installed - get homebrew here
Then run: brew install elasticsearch
Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml
.
Set the value below to false:
discovery.zen.ping.multicast.enabled: false #(it's true by default)
Other sources say to use a removed brew services
command. You get it via brew tap gapple/services
. Then you're supposed to run brew services start <package-to-start>
.
If brew services start elasticsearch
doesn't work for you, check the instructions when you run brew info elasticsearch
.
Mine says:
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 --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
Just in case this helps anyone, you should make sure to update the correct JVM logging line depending on what version you have locally.
Most of the examples mention the JVM8 line but I had to modify the JVM9 line.
I also noticed that the jvm.properties.default file actually has the correct locally correct directories listed, I wonder why...
Incorrect in jvm.options
jvm.options:8:-Xloggc:/tmp/logs_gc.log
jvm.options:9-:-Xlog:gc*,gc+age=trace,safepoint:file=/tmp/logs_gc.log:utctime,pid,tags:filecount=32,filesize=64m
Correct in jvm.properties.default!
jvm.options.default:8:-Xloggc:/usr/local/var/log/elasticsearch/gc.log
jvm.options.default:9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m