위조 분포식elasticsearch 집단 시작 스크립트

2422 단어 ElasticSearch
위조 분포식elasticsearch 그룹 시작 스크립트start-elasticsearch.sh
#!/bin/bash
cd /opt/apps/elasticsearch-7.3.0-node1/
./bin/elasticsearch -d

cd /opt/apps/elasticsearch-7.3.0-node2/
./bin/elasticsearch -d

cd /opt/apps/elasticsearch-7.3.0-node3/
./bin/elasticsearch -d
stop-elaticsearch.sh
#!/bin/bash
processname=Elasticsearch

PID=$(jps | grep $processname | awk '{print $1}')

if [ $? -eq 0 ]; then
    echo "process id: $PID"
else
    echo "process $PID not exist"
    exit
fi

kill -9 ${PID}

if [ $? -eq 0 ]; then
    echo "kill $processname success"
else
    echo "kill $processname fail"
fi

좋은 웹페이지 즐겨찾기