Restart on failure option is missing in the default service of elasticsearch.
So, We can add Restart=always option in the service.
### Steps to add - Restart=always
1. Edit elasticsearch service unit file using the command `sudo systemctl edit elasticsearch.service`. This command will create a file `/etc/systemd/system/elasticsearch.service.d/override.conf`.
2. Now, add the following lines in the unit file.
`
[Service]
Restart=always
`
3. Save the file and refresh the unit file using command `sudo systemctl daemon-reload`
4. Can check the changes using command `sudo systemctl cat elasticsearch.service`
#### NOTE
We can use `Restart= always, on-abnormal, on-success, on-failure, etc` based on the requirement