본문 바로가기
카테고리 없음

elasticsearch 시작쉘 종료쉘 자동재시작쉘 참고

by whathelllllllllllllllll 2022. 1. 20.
728x90
#elasticsearch 시작/종료/자동재시작 쉘

 

start_es.sh
ES_PATH_CONF=/engn/elasticsearch/config /engn/elasticsearch/bin/elasticsearch -d -p /engn/elasticsearch/bin/es.pid
echo "es start!!!"
 
stop_es.sh
kill `cat /engn/elasticsearch/bin/es.pid`
echo "es stop!!!"
 
 
##ES 자동 재시작 쉘
#!/bin/bash
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
pid=`ps -ef |grep "elasticsearch" | grep -v 'grep' | awk '{print $2}'`
if [ -z $pid ]; then
    echo $(date)
    cd /home/jeje/elastic/elasticsearch-7.7.1/bin
    nohup ./elasticsearch &
    echo ""
fi

댓글