ElasticSearch close restart command
From: http://www.cnblogs.com/ae6623/p/5110927.html
Many people learn elasticSearch by self-study. There is no answer to Baidu's question of how to restart es. I'm trying to figure it out. I hope I can help you.
1. How to close ES and elasticsearch
1. Use the head plug-in
Find the node you want to shut down and shut down
2. Use the command kill to kill the ES process of the server
1. Find ES process
ps -ef | grep elastic
2. Kill ES process
kill -9 2382 (process number)
3. Restart ES
sh elasticsearch -d
2. How to restart ES
There is no way to restart. Only refer to close - > open above.
The following is the detailed operation process
1. First, check whether there is an ES process on the server. If the ES process is not turned on, you don't need to turn it off. If it is turned on, kill the process
1. Find the process command ps -ef | grep elastic
[root@bjdhj-125-203 _site]# ps -ef | grep elastic
//Then you can see the following process number,2382,2583 After thatkillJust drop it.
root 2382 1 0 Jan05 ? 00:10:57 /opt/soft/jdk/jdk1.7.0_80/bin/java -Xms2g -Xmx2g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.path.home=/opt/soft/elasticsearch-1.5.2-2 -cp :/opt/soft/elasticsearch-1.5.2-2/lib/elasticsearch-1.5.2.jar:/opt/soft/elasticsearch-1.5.2-2/lib/*:/opt/soft/elasticsearch-1.5.2-2/lib/sigar/* org.elasticsearch.bootstrap.Elasticsearch
root 2583 1 0 Jan05 ? 00:10:24 /opt/soft/jdk/jdk1.7.0_80/bin/java -Xms2g -Xmx2g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.path.home=/opt/soft/elasticsearch-1.5.2 -cp :/opt/soft/elasticsearch-1.5.2/lib/elasticsearch-1.5.2.jar:/opt/soft/elasticsearch-1.5.2/lib/*:/opt/soft/elasticsearch-1.5.2/lib/sigar/* org.elasticsearch.bootstrap.Elasticsearch
root 8682 8564 0 18:04 pts/0 00:00:00 grep elastic
2. Kill the process kill-9 2382 (process number)
//Kill kill kill kill all. If you are not sure about the process number, you can check the process path address in the above information to prevent the error
[root@bjdhj-125-203 _site]# kill -9 2382
[root@bjdhj-125-203 _site]# ps -ef | grep elastic
root 2583 1 0 Jan05 ? 00:10:24 /opt/soft/jdk/jdk1.7.0_80/bin/java -Xms2g -Xmx2g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.path.home=/opt/soft/elasticsearch-1.5.2 -cp :/opt/soft/elasticsearch-1.5.2/lib/elasticsearch-1.5.2.jar:/opt/soft/elasticsearch-1.5.2/lib/*:/opt/soft/elasticsearch-1.5.2/lib/sigar/* org.elasticsearch.bootstrap.Elasticsearch
root 8684 8564 0 18:05 pts/0 00:00:00 grep elastic
3. Restart the command sh elasticsearch -d
[root@bjdhj-125-203 elasticsearch-1.5.2]# ls
bin config data lib LICENSE.txt logs NOTICE.txt plugins README.textile
[root@bjdhj-125-203 elasticsearch-1.5.2]# cd bin
[root@bjdhj-125-203 bin]# ./elasticsearch -d
-bash: ./elasticsearch: Permission denied
[root@bjdhj-125-203 bin]# sh elasticsearch -d
link /opt/soft/jdk/jdk1.7.0_80 to /opt/soft/java
User=root
SourceJDKFileBase=10.126.103.198
JDKBasePath=/opt/soft/jdk
Timeout=2
DefaultVer=jdk1.6.0_45
CurrentVer=jdk1.7.0_80
Initialize jdk(jdk1.7.0_80) done
Current jdk version = 1.7.0_80
[root@bjdhj-125-203 bin]# ps -ef | grep elastic