1. 安裝epel源java
2. 安裝supervisorbootstrap
yum -y install supervisor
3. 配置supervisordbash
[program:elasticsearch] command=su -c "/usr/local/data/elasticsearch/bin/elasticsearch" es directory=/usr/local/data/elasticsearch numprocs=1 autostart=true
4.啓動supervisord
less
/etc/init.d/supervisord restart Stopping supervisord: [ OK ] Starting supervisord: [ OK ] ps -ef | grep java es 30896 30895 93 02:43 ? 00:00:02 /usr/local/data/jdk1.8.0_91//bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/local/data/elasticsearch -cp /usr/local/data/elasticsearch/lib/elasticsearch-5.1.1.jar:/usr/local/data/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch root 30927 21121 0 02:43 pts/0 00:00:00 grep java