#!/bin/bash user=`whoami` elasticsearch_home=/opt/module/elasticsearch-7.10.2 echo -e "================ 正在 ElasticSearch ===========" case in start) for((host=102; host<=104; host++)); do echo -e "n--- $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++)); do echo -e "n--- $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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)