选择性开启/关闭服务脚本

选择性开启/关闭服务脚本

#!/bin/bash
read -t 15 -p "请在15s内选择你需要的服务:
1.开启hadoop(all)服务 2.关闭hadoop服务
3.开启zk服务          4.关闭zk服务      5.查看zk状态
6.启动hbase服务       7.关闭hbase服务 
8.启动hiveServer2服务(后台启动回车一次)  9.启动beeline
10.启动nifi服务       11.查看你nifi状态 12.关闭nifi服务
13.开启spark服务      14.关闭spark服务
15.开启zeppelin服务   16.关闭zeppelin服务
17.开启mongodb服务   18.查看mongodb状态 19.关闭mongodb服务
20.开启kafka服务     21.关闭kafka服务
22.开启oozie服务     23.关闭oozie服务
24.开启flink服务     25.关闭flink服务
0.退出选择---------" a
choice=`echo $a`
if [ $choice == 0 ];then
echo '退出成功'
elif [ $choice == 1 ];then
start-all.sh
echo '查看五个进程是否存在'
jps
elif [ $choice == 2 ];then
stop-all.sh
jps
elif [ $choice == 3 ];then
zkServer.sh start
echo '查看QuorumPeerMain进程是否存在'
jps
elif [ $choice == 4 ];then
zkServer.sh stop
jps
elif [ $choice == 5 ];then
zkServer.sh status
elif [ $choice == 6 ];then
start-hbase.sh
echo '查看HMaster/HRegionServe进程是否存在'
jps
elif [ $choice == 7 ];then
stop-hbase.sh
jps
elif [ $choice == 8 ];then
nohup hiveserver2 start &
elif [ $choice == 9 ];then
beeline -u jdbc:hive2://localhost:10000/default
elif [ $choice == 10 ];then
nifi.sh start
echo '查看RunNiFi/NiFi进程是否存在'
jps
elif [ $choice == 11 ];then
nifi.sh status
elif [ $choice == 12 ];then
nifi.sh stop
jps
elif [ $choice == 13 ];then
/wz/bigdata/spark243/sbin/start-all.sh
echo '查看Master/Worker进程是否存在'
sleep 2
jps
elif [ $choice == 14 ];then
/wz/bigdata/spark243/sbin/stop-all.sh
sleep 2
jps
elif [ $choice == 15 ];then
zeppelin-daemon.sh start
echo '查看ZeppelinServer进程是否存在'
jps
elif [ $choice == 16 ];then
zeppelin-daemon.sh stop
jps
elif [ $choice == 17 ];then
mongod -f /wz/bigdata/mongodb/bin/mongodb.conf
elif [ $choice == 18 ];then
netstat -nltp|grep mongod
elif [ $choice == 19 ];then
pkill mongod
elif [ $choice == 20 ];then
nohup kafka-server-start.sh /wz/bigdata/kafka211/config/server.properties &
echo '查看Kafka进程是否存在'
jps
elif [ $choice == 21 ];then
kafka-server-stop.sh
jps
elif [ $choice == 22 ];then
oozied.sh start
echo '查看Bootstrap进程是否存在'
jps
elif [ $choice == 23 ];then
oozied.sh stop
jps
elif [ $choice == 24 ];then
start-cluster.sh
echo '查看StandaloneSessionClusterEntrypoint/TaskManagerRunner进程是否存在'
jps
elif [ $choice == 25 ];then
stop-cluster.sh
jps
else 
echo '对不起,您的输入有误' 
fi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值