import time
import os
#import subprocess(也可以实现调用shell命令功能)
os.system('/export/server/spark/sbin/stop-thriftserver.sh')
time.sleep(5)
print('>>>>>>>>>>>>>>>>>>>成功关闭spark<<<<<<<<<<<<<<<<<<<<')
output=os.popen('jps')
lines=output.read().split('\n')
for line in lines:
if 'RunJar' in line:
os.system('kill -9 {}'.format(line.split(' ')[0]))
print('>>>>>>>>>>>>>>>>>>>成功关闭hive<<<<<<<<<<<<<<<<<<<<<')
time.sleep(5)
os.system('/export/server/hadoop/sbin/stop-all.sh')
print('>>>>>>>>>>>>>>>>>>>成功关闭hadoop<<<<<<<<<<<<<<<<<<<')
print('>>>>>>>>>>>>>>>>>>>成功全部关闭<<<<<<<<<<<<<<<<<<<<<')
大数据自学一键关闭Spark集群脚本
最新推荐文章于 2024-08-19 15:15:31 发布