选择性开启/关闭服务脚本
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