Storm命令详解

在Linux终端直接输入storm,不带任何参数信息,或者输入storm help,可以查看storm命令行客户端(Command line client)提供的帮助信息。Storm 0.9.0.1版本在Linux终端直接输入storm后的输出内容如下:

[html]  view plain  copy
  1. Commands:  
  2. activate  
  3. classpath  
  4. deactivate  
  5. dev-zookeeper  
  6. drpc  
  7. help  
  8. jar  
  9. kill  
  10. list  
  11. localconfvalue  
  12. logviewer  
  13. nimbus  
  14. rebalance  
  15. remoteconfvalue  
  16. repl  
  17. shell  
  18. supervisor  
  19. ui  
  20. version  
  21.    
  22. Help:   
  23. help   
  24. help <command>  
  25.    
  26. Documentation for the storm client can be found at https://github.com/nathanmarz/storm/wiki/Command-line-client  
  27.    
  28. Configs can be overridden using one or more -c flags, e.g. "storm list -c nimbus.host=nimbus.mycompany.com"  
注:由此可知,新版Storm的命令行客户端提供了19个命令。


1.activate

激活指定的拓扑。语法如下:

[html]  view plain  copy
  1. storm activate topology-name  

2.classpath

打印出Storm客户端运行命令时使用的类路径(classpath)。语法如下:

[html]  view plain  copy
  1. storm classpath  

3.deactivate

禁用指定的拓扑Spout。语法如下:

[html]  view plain  copy
  1. storm deactivate topology-name  

4.dev-zookeeper

以dev.zookeeper.path配置的值作为本地目录,以storm.zookeeper.port配置的值作为端口,启动一个新的Zookeeper服务,仅用来开发/测试。语法如下:

[html]  view plain  copy
  1. storm dev-zookeeper  

5.drpc (常用!)

启动一个DRPC守护进程。语法如下:

[html]  view plain  copy
  1. storm drpc  
注:该命令应该使用daemontools或者monit工具监控运行。


6.help (常用!)

打印一条帮助消息或者可用命令的列表。语法如下:

[html]  view plain  copy
  1. storm help  
  2. storm help <command>  
注:直接输入不带参数的storm,也可以启动storm help命令。


7.jar (很常用!)

运行类的指定参数的main方法。语法如下:

[html]  view plain  copy
  1. storm jar topology-jar-path class ...  
注:把Storm的jar文件和"~/.storm"的配置放到类路径(classpath)中,以便当拓扑提交时,StormSUbmitter会上传topology-jar-path的jar文件。


8.kill (常用!)

杀死名为topology-name的拓扑。语法如下:

[html]  view plain  copy
  1. storm kill topology-name [-w wait-time-secs]  
注:storm首先会在拓扑的消息超时时间期间禁用spout,以允许所有正在处理的消息完成。然后,Storm将会关闭Worker并清理他们的状态。可以使用-w标记覆盖Storm在禁用与关闭期间等待的时间长度。


9.list (常用!)

列出正在运行的拓扑及其状态。语法如下:

[html]  view plain  copy
  1. storm list  


10.localconfvalue

打印出本地Storm配置的conf-name的值。语法如下:

[html]  view plain  copy
  1. storm localconfvalue conf-name  
注:本地Storm配置是~/.storm/storm.yaml与defaults.yaml合并的结果。


11.logviewer (常用!)

启动Logviewer守护进程。语法如下:

[html]  view plain  copy
  1. storm logviewer  
注:Logviewer提供一个Web接口查看Storm日志文件。该命令应该使用daemontools或者monit工具监控运行。


12.nimbus (常用!)

启动Nimbus守护进程。语法如下:

[html]  view plain  copy
  1. storm nimbus  
注:该命令应该使用daemontools或者monit工具监控运行。


13.rebalance (常用!)

再平衡即动态设置拓扑的进程数量和线程数量等。详细内容见:这里


14.remoteconfvalue

打印出远程集群Storm配置的conf-name的值。语法如下:

[html]  view plain  copy
  1. storm remoteconfvalue conf-name  
注:集群Storm配置是$STORM-PATH/conf/storm.yaml与defaults.yaml合并的结果。该命令必须在集群节点上运行。


15.repl

打开一个包含路径(classpath)中的jar文件和配置的Clojure REPL,以便调试时使用。语法如下:

[html]  view plain  copy
  1. storm repl  
注:Clojure可以作为一种脚本语言内嵌到java中,但是Clojure的首选编程方式是使用REPL,REPL是一个简单的命令行接口。使用REPL,可以输入命令并执行,然后查看结果。


16.shell

执行Shell脚本。语法如下:

[html]  view plain  copy
  1. storm shell resourcesdir command args  

17.supervisor (常用!)

启动Supervisor守护进程。语法如下:

[html]  view plain  copy
  1. storm supervisor  
注:该命令应该使用daemontools或者monit工具监控运行。


18.ui (常用!)

启动UI守护进程。语法如下:

[html]  view plain  copy
  1. storm ui  
注:UI为Storm集群提供了一个Web界面并显示运行拓扑的详细统计信息。该命令应该使用daemontools或者monit工具监控运行。


19.version

打印Storm发布的版本号。语法如下:

[html]  view plain  copy
  1. storm version  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值