legacy-knowledge-base
公開されました Jun. 30, 2025

Elasticsearch as Service

written-by

Santhosh Kumar

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.

Issue

  • How to deploy Elasticsearch as a service in Linux.

Environment

  • Elasticsearch 7.*

Prerequisites

  • Need Root user level.

Resolution

  1. Create elasticsearch.service file as root user in /usr/lib/systemd/system/
  2. Paste the below content in elasticsearch.service file

[Unit]

Description = Elasticsearch 7.17.9 Community Edition


[Service]

User=liferay

Environment=ES_JAVA_HOME=/home/liferay/zulu11.62.17-ca-jdk11.0.18-linux_x64

Environment='ES_JAVA_OPTS=-Xmx4g -Xms4g'

ExecStart=/home/liferay/elasticsearch-7.17.9/bin/elasticsearch

Type=simple


[Install]

WantedBy=multi-user.target

 

3. Run the below commands one by one to enable Elasticsearch as a service

systemctl daemon-reload
systemctl enable elasticsearch 
systemctl start elasticsearch

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base