#!/bin/bashuser=`whoami`
elasticsearch_home=/opt/module/elasticsearch-7.10.2echo -e "================ 正在 $1 ElasticSearch ==========="
case $1 instart)for((host=102; host<=104; host++)); doecho -e "\n--- $1 $user@hadoop$host---"ssh $user@hadoop$host "$elasticsearch_home/bin/elasticsearch -d -p $elasticsearch_home/es.pid"done;;stop)for((host=102; host<=104; host++)); doecho -e "\n--- $1 $user@hadoop$host---"ssh $user@hadoop$host 'kill `cat /opt/module/elasticsearch-7.10.2/es.pid`'done;;*)echo "你启动的姿势不对"echo " start 启动elasticsearch集群"echo " stop 停止elasticsearch集群";;
esac
详细解决方案
黑猴子的家:es.sh
热度:109 发布时间:2023-09-14 21:25:15.0
相关解决方案