hadoopCDHStart

#!/bin/bash
for i in hadoop101 hadoop102
do
    if [ $i = "hadoop101" ]
    then
        echo ------------$i is starting hdfs-------------
        ssh $i "source /etc/profile && /opt/module/CDH/hadoop-2.5.0-cdh5.3.6/sbin/start-dfs.sh && /opt/module/CDH/hadoop-2.5.0-cdh5.3.6/sbin/mr-jobhistory-daemon.sh start historyserver"
    elif [ $i = "hadoop102" ]
    then
        echo ------------$i is starting yarn-------------
        ssh $i "source /etc/profile && /opt/module/CDH/hadoop-2.5.0-cdh5.3.6/sbin/start-yarn.sh"
    fi
done

你可能感兴趣的:(hadoopCDHStart)