Loading [MathJax]/jax/element/mml/optable/BasicLatin.js

随笔分类 -  常用shell脚本

摘要:#! /bin/bash # 开启zookeeper集群 function zookeeper_start(){ echo " zookeeper集群启动中... "; echo " pc001 zookeeper服务启动 "; ssh pc001 "zkServer.sh start"; echo 阅读全文
posted @ 2021-10-17 17:59 Norni 阅读(58) 评论(0) 推荐(0) 编辑
摘要:#! /bin/bash # 1.判断参数个数 if [ # -lt 1 ] then echo 'Not Enougth Arugement!' exit; fi # 2.遍历集群所有机器 for host in pc001 pc002 pc003 do if [HOSTNAME != $h 阅读全文
posted @ 2021-10-17 17:57 Norni 阅读(94) 评论(0) 推荐(0) 编辑
摘要:#! /bin/bash for host in pc001 pc002 pc003 do echo " host " ssh host "jps" done 阅读全文
posted @ 2021-10-17 17:56 Norni 阅读(60) 评论(0) 推荐(0) 编辑
摘要:#! /bin/bash function kafka_start(){ for host in pc001 pc002 pc003 do echo " 启动kafka服务 host " ssh host "kafka-server-start.sh -daemon $KAFKA_HOME/co 阅读全文
posted @ 2021-10-17 17:55 Norni 阅读(47) 评论(0) 推荐(0) 编辑
摘要:#! /bin/bash HIVE_LOG_DIR=HIVE_HOME/logs if [ ! -d HIVE_LOG_DIR ] then mkdir -p $HIVE_LOG_DIR fi # 检查进程是否正常运行,参数1为进程名,参数2为进程端口 function check_proces 阅读全文
posted @ 2021-10-17 17:51 Norni 阅读(216) 评论(0) 推荐(1) 编辑
摘要:#! /bin/bash if [ # -lt 1 ] then echo "Tips:请输入参数" exit fi case 1 in "start") echo " 启动集群 " echo " 启动历史服务器 " ssh pc001 "mapred --daemon start histor 阅读全文
posted @ 2021-10-17 17:50 Norni 阅读(32) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示