ES does not support direct restart. You can only end the process first and then run the script to restart. The following is the operation process:
1. First find the ES process of the server. You can use the following two commands to search:
ps -aux |grep elasticsearch
ps -ef |grep elasticsearch
The 15870 that follows the command jintaiyang+ is the ES service process pid we need to find.
2. End the ES process kill -9 pid (process number, here is 15870)
kill -9 15870
3. Restart ES ( Note: For security reasons, ES does not allow root startup. Switch to the ES account su jintaiyang first. An error will be reported when starting with the root account )
Switch to the bin directory where ES is located and execute (-d means running in the background)
./elasticsearch -d
4. Check ES startup status
curl 127.0.0.1:9200