Brew services starts elasticsearch as root

Hello,

I've installed Elasticsearch with

brew tap elastic/tap
brew install elastic/tap/elasticsearch-full

And it seems the brew service for it wants to run as root and so Elasticsearch fails to start

╰─ brew services
Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the elastic/tap tap (not Homebrew/brew or Homebrew/core):
  /opt/homebrew/Library/Taps/elastic/homebrew-tap/Formula/elasticsearch-full.rb:9

Name               Status       User     File
caddy              none
dnsmasq            none         root
elasticsearch-full error  19968 root     ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch-full.plist
╰─ tail -n20 /opt/homebrew/var/log/elasticsearch.log
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.15.2.jar:7.15.2]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-7.15.2.jar:7.15.2]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-7.15.2.jar:7.15.2]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.15.2.jar:7.15.2]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167) ~[elasticsearch-7.15.2.jar:7.15.2]
        ... 6 more
uncaught exception in thread [main]
java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:158)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:114)
        at org.elasticsearch.cli.Command.main(Command.java:79)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:123)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at /opt/homebrew/var/log/elasticsearch/elasticsearch_brew.log

How do I make brew services not start it as root?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.