When using the root user, Elasticsearch cannot be started due to "don't run elasticsearch as root"
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
Elasticsearch cannot be started, therefore Bitbucket Server cannot connect to it.
The following appears in the console output when running the
start-search.sh or the
start-bitbucket.sh script or the :
root@myserver:/home/stash/shared/search# cd /opt/atlassian/bitbucket/4.9.1/bin/ root@myserver:/opt/atlassian/bitbucket/4.9.1/bin# sh start-search.sh Starting Elasticsearch bundled with Atlassian Bitbucket BITBUCKET_HOME set to /var/atlassian/application-data/bitbucket -e Starting Elasticsearch bundled with Atlassian Bitbucket as current user -e Elasticsearch bundled with Atlassian Bitbucket started successfully root@myserver:/opt/atlassian/bitbucket/4.9.1/bin# Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root. at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35) Refer to the log for complete error details.
- Operating system: Unix based
Elasticsearch cannot be run as root.
- Login as the
- Run the start script