代码拉取完成,页面将自动刷新
#!/bin/bash
# the default node number is 3
N=${1:-1}
num=3
current=`date "+%Y-%m-%d %H:%M:%S"`
timeStamp=`date -d "$current" +%s`
currentTimeStamp=$((10#$timeStamp*1000+10#`date "+%N"`/1000000))
beforeStartTime=`echo "scale=3;$currentTimeStamp/1000"|bc`
echo "开始时间戳:"$beforeStartTime
reduce_num=$N
current_num=`docker ps | grep hadoop-master | wc -l`
echo 'current num : '${current_num}
j=$(($current_num-1))
while [ $j -ge ${reduce_num} ]
do
#remove hadoop master container
sudo docker rm -f hadoop-master-${j} &> /dev/null
echo "remove hadoop-master-${j} container..."
#remove hadoop slave container
i=1
text=""
while [ $i -lt $num ]
do
sudo docker rm -f hadoop-slave-$j-$i &> /dev/null
echo "remove hadoop-slave-$j-$i container..."
i=$(( $i + 1 ))
done
#remove docker network
docker network rm hadoop-${j}
echo "hadoop-${j} network remove"
sleep 0.1
echo "hadoop-${j} remove complete"
j=$(( $j - 1 ))
echo -e "\n***********************************\n"
done
current=`date "+%Y-%m-%d %H:%M:%S"`
timeStamp=`date -d "$current" +%s`
currentTimeStamp=$((10#$timeStamp*1000+10#`date "+%N"`/1000000))
endStartTime=`echo "scale=3;$currentTimeStamp/1000"|bc`
echo "结束时间戳:"$endStartTime
echo "end" > symbol
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。