linux – Elasticsearch on CentOS 7 not starting because of Unit elasticsearch.service has failed

I’m trying to setup Elasticsearch 7.8.0-x86_64 on centOS 7, I installed the Java, then install ES with rpm and configure the elasticsearch.yml to add cluster and node names.

Then I adjust the heap memory in jvm.options to 1g as i have 4GB of RAM for my VM.
Now when i start the elasticsearch.service as sudo systemctl start elasticsearch it’s not starting, upon running the sudo journalctl -xe it says that : Unit elasticsearch.service has failed, below is the complete output of this command:

Jul 10 03:26:50 client1.example.com systemd[1]: elasticsearch.service: main process 

exited, code=exited, status=1/FAILURE
Jul 10 03:26:50 client1.example.com systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit elasticsearch.service has failed.
-- 
-- The result is failed.
Jul 10 03:26:50 client1.example.com systemd[1]: Unit elasticsearch.service entered failed state.
Jul 10 03:26:50 client1.example.com systemd[1]: elasticsearch.service failed.
Jul 10 03:26:50 client1.example.com polkitd[748]: Unregistered Authentication Agent for unix-process:12688:387721 (system bus name :1.312, object path /org/freedesktop/Pol
Jul 10 03:26:50 client1.example.com sudo[12679]: pam_unix(sudo:session): session closed for user root
Jul 10 03:27:02 client1.example.com sudo[12929]:  elastic : TTY=pts/0 ; PWD=/home/elastic ; USER=root ; COMMAND=/bin/journalctl -xe
Jul 10 03:27:02 client1.example.com sudo[12929]: pam_limits(sudo:session): wrong limit value 'unlimitted' for limit type 'soft'
Jul 10 03:27:02 client1.example.com sudo[12929]: pam_limits(sudo:session): wrong limit value 'unlimitted' for limit type 'hard'
Jul 10 03:27:02 client1.example.com sudo[12929]: pam_limits(sudo:session): wrong limit value 'unlimitted' for limit type 'soft'
Jul 10 03:27:02 client1.example.com sudo[12929]: pam_unix(sudo:session): session opened for user root by elastic(uid=0)

Read more here: Source link