Using the chkconfig command, we can configure Elasticsearch to automatically start on each reboot:
sudo chkconfig --add elasticsearch
If we want to start Elasticsearch, we need to run the following command:
sudo -i service elasticsearch start
To stop Elasticsearch, we need to run the following command:
sudo -i service elasticsearch stop