storm启动步骤:
1- 启动zookeeper(storm需要依赖zookeeper)
zkServer.sh start
2- 启动nimbus(只需启动一台主控节点的守护线程,负责在集群中分发代码,对节点分配任务,并监视主机故障)
storm nimbus
3- 启动supervisor(每个工作节点运行supervisor守护进程,负责监听工作节点已经分配的主机作业,启动和停止nimbus已经分配的工作进程)
storm supervisor
4- 启动UI(监控页面,只需启动一台服务器,进程名为core)
storm ui
5- 删除拓扑
storm kill topname
6- 激活拓扑
storm active topname
7- 不激活拓扑
storm deactive topname
8- 列出拓扑
storm list
启动命令zookeeper(多台):
#!/bin/shell echo "start zookeeper server..." #hosts里是安装zookeeper的主机名 hosts="master node1 node2 node3" #用循环来分别执行zkServer.sh start的脚本 for host in $hosts do echo "--------$host--------" ssh $host "source /etc/profile; /home/hadoop/zookeeper-3.4.10/bin/zkServer.sh start" done
启动storm
#!/bin/bash echo "start storm server..." source /etc/profile storm nimbus >${STORM_HOME}/nimbus.log 2>&1 & storm ui >${STORM_HOME}/ui.log 2>&1 & hosts="node1 node2 node3" for host in $hosts do echo "--------$host--------" ssh $host "source /etc/profile; ${STORM_HOME}/bin/storm supervisor >${STORM_HOME}/supervisor.log 2>&1 &" echo "OK!" done
关闭storm
#!/bin/bash source /etc/profile echo "stop storm server..." kill -9 `ps -ef|grep daemon.nimbus | awk '{print $2}'|head -1` >${STORM_HOME}/nimbus.log 2>&1 kill -9 `ps -ef|grep core | awk '{print $2}'|head -1` >${STORM_HOME}/ui.log 2>&1 hosts="node1 node2 node3" for host in $hosts do echo "--------$host--------" ssh $host "source /etc/profile; /home/hadoop/shelltools/stop-supervisor.sh >${STORM_HOME}/supervisor.log 2>&1 &" echo "OK!" done