在JStorm的bin目录下有个可执行文件 jstorm,通过该文件可以实现任务提交,删除,禁用,激活等一系列功能,命令列表:
Commands:
activate
blacklist
blobstore
classpath
deactivate
drpc
help
jar
kill
list
localconfvalue
metricsMonitor
nimbus
rebalance
remoteconfvalue
restart
supervisor
update_topology
zktool
[--config client_storm.yaml] optional, setting client's storm.yaml
[--exclude-jars exclude1.jar,exclude2.jar] optional, exclude jars, avoid jar conflict
[-c key1=value1,key2=value2] optional, add key=value pair to configuration
Help:
help
help <command>
部分常用的命令整理如下:
# nimbus命令, 将当前节点以nimbus daemon模式启动
jstorm nimbus &
# supervisor命令, 将当前节点以supervisor daemon模式启动
jstorm supervisor &
# jar命令,将topology提交至jstorm集群,可以指定topology的jar包目录,main方法入口,启动参数等
jstorm jar topology-jar-path classPath param
# update_topology,动态修改topology的配置文件
jstorm update_topology topology-name -jar [jarpath] -conf [confpath]
# kill命令,kill 指定的 topology, jstorm集群会先禁用相关的spouts,并待所有处理中的进程执行完毕后关闭works
# 并清理他们的状态,可以指定等待的超时时间
jstorm kill topology-name [wait-time-secs]
# activate,激活指定topology的spouts
jstorm activate topology-name
# deactivate,禁用指定topology的spouts
jstorm deactivate topology-name
# blacklist, 将某个hostname加入或移除黑名单,黑名单中的hostname将不会被Nimbus调度
jstorm blacklist add|remove hostname
# list, 列出JStorm集群的信息
jstorm list
# rebalance, 对集群任务重新进行负载均衡,一般在新增服务器后执行
# 该命令会先禁用所有正在执行的topology,等再分配完成后恢复,可以指定超时时间
jstorm rebalance topology-name [-w wait-time-secs]
# metricsMonitor, 开启或关闭topology的指标监控
jstorm metricsMonitor topologyname bool