群起包括:
-
第一步启动exec
此时这列的值为0,下一步激活后变成1
-
第二步激活exec
-
第三步打开web页面
脚本代码(注意修改自己的主机名和安装路径)
#!/bin/bash
start-web(){
for i in hadoop102;
do
ssh $i "cd /opt/module/azkaban/azkaban-web;bin/start-web.sh"
done
}
stop-web(){
for i in hadoop102;
do
ssh $i "cd /opt/module/azkaban/azkaban-web;bin/shutdown-web.sh"
done
}
start-exec(){
for i in hadoop102 hadoop103 hadoop104;
do
ssh $i "cd /opt/module/azkaban/azkaban-exec;bin/start-exec.sh"
done
}
activate-exec(){
for i in hadoop102 hadoop103 hadoop104;
do
ssh $i "curl -G "$i:12321/executor?action=activate" && echo"
done
}
stop-exec(){
for i in hadoop102 hadoop103 hadoop104;
do
ssh $i "/opt/module/azkaban/azkaban-exec/bin/shutdown-exec.sh"
done
}
case $1 in
start-exec)
start-exec;;
activate-exec)
activate-exec;;
stop-exec)
stop-exec;;
start-web)
start-web;;
stop-web)
stop-web;;
esac