Hadoop群起脚本
Hadoop群起脚本
#!/bin/bash if [ $# -lt 1 ] then echo "No args input" fi case $1 in "start") echo "================启动hadoop集群============" echo "---------------启动hdfs---------------" ssh hadoop102 "/opt/module/hadoop-3.1.3/sbin/start-dfs.sh" echo "---------------启动yarn---------------" ssh hadoop103 "/opt/module/hadoop-3.1.3/sbin/start-yarn.sh" echo "---------------启动historyserver---------------" ssh hadoop102 "/opt/module/hadoop-3.1.3/bin/mapred --daemon start historyserver" ;; "stop") echo "================关闭hadoop集群============" echo "---------------关闭historyserver---------------" ssh hadoop102 "/opt/module/hadoop-3.1.3/bin/mapred --daemon stop historyserver" echo "---------------关闭yarn---------------" ssh hadoop103 "/opt/module/hadoop-3.1.3/sbin/stop-yarn.sh" echo "---------------启动hdfs---------------" ssh hadoop102 "/opt/module/hadoop-3.1.3/sbin/stop-dfs.sh" ;; *) echo "no such method!" esac
有疑问可以加wx:18179641802,进行探讨