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
댓글