打包运行storm代码
两个节点的storm集群:
host01 |
host02 |
zk |
|
nimbus |
supervisor |
启动集群:
在host01上:
/usr/local/storm/bin/storm nimbus
在host02上:
/usr/local/storm/bin/storm supervisor
报错:
2015-09-21T21:08:17.294+0800 o.a.s.z.ClientCnxn[WARN]Session0x0for server null, unexpected error, closing socket connection and attempting reconnect
java.net.NoRouteToHostException:No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(NativeMethod)~[na:1.7.0_51]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)~[na:1.7.0_51]
at org.apache.storm.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)~[storm-core-0.9.5.jar:0.9.5]
at org.apache.storm.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)~[storm-core-0.9.5.jar:0.9.5]
2015-09-21T21:08:18.412+0800 o.a.s.z.ClientCnxn[INFO]Opening socket connection to server host01.zh/192.168.1.104:2181.Will not attempt to authenticate using SASL (unknown error)
发现
关掉zookeeper节点的防火墙解决:
- [root@host01 logs]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK
UI进程启动,在浏览器打不开storm UI: http://192.168.1.104:8080/index.html
[root@host01 logs]#/usr/local/storm/bin/storm list
Running:/usr/local/jdk/bin/java -client -Dstorm.options=-Dstorm.home=/usr/local/storm -Dstorm.log.dir=/usr/local/storm/logs -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.conf.file=-cp /usr/local/storm/lib/reflectasm-1.07-shaded.jar:/usr/local/storm/lib/storm-core-0.9.5.jar:/usr/local/storm/lib/jline-2.11.jar:/usr/local/storm/lib/log4j-over-slf4j-1.6.6.jar:/usr/local/storm/lib/snakeyaml-1.11.jar:/usr/local/storm/lib/logback-classic-1.0.13.jar:/usr/local/storm/lib/clj-stacktrace-0.2.2.jar:/usr/local/storm/lib/clojure-1.5.1.jar:/usr/local/storm/lib/logback-core-1.0.13.jar:/usr/local/storm/lib/tools.macro-0.1.0.jar:/usr/local/storm/lib/jetty-6.1.26.jar:/usr/local/storm/lib/commons-logging-1.1.3.jar:/usr/local/storm/lib/jgrapht-core-0.9.0.jar:/usr/local/storm/lib/joda-time-2.0.jar:/usr/local/storm/lib/minlog-1.2.jar:/usr/local/storm/lib/ring-jetty-adapter-0.3.11.jar:/usr/local/storm/lib/clj-time-0.4.1.jar:/usr/local/storm/lib/ring-core-1.1.5.jar:/usr/local/storm/lib/tools.logging-0.2.3.jar:/usr/local/storm/lib/slf4j-api-1.7.5.jar:/usr/local/storm/lib/chill-java-0.3.5.jar:/usr/local/storm/lib/commons-codec-1.6.jar:/usr/local/storm/lib/ring-devel-0.3.11.jar:/usr/local/storm/lib/tools.cli-0.2.4.jar:/usr/local/storm/lib/ring-servlet-0.3.11.jar:/usr/local/storm/lib/math.numeric-tower-0.0.1.jar:/usr/local/storm/lib/kryo-2.21.jar:/usr/local/storm/lib/jetty-util-6.1.26.jar:/usr/local/storm/lib/hiccup-0.3.6.jar:/usr/local/storm/lib/commons-io-2.4.jar:/usr/local/storm/lib/servlet-api-2.5.jar:/usr/local/storm/lib/carbonite-1.4.0.jar:/usr/local/storm/lib/clout-1.0.1.jar:/usr/local/storm/lib/json-simple-1.1.jar:/usr/local/storm/lib/asm-4.0.jar:/usr/local/storm/lib/objenesis-1.2.jar:/usr/local/storm/lib/compojure-1.1.3.jar:/usr/local/storm/lib/commons-lang-2.5.jar:/usr/local/storm/lib/commons-exec-1.1.jar:/usr/local/storm/lib/disruptor-2.10.1.jar:/usr/local/storm/lib/core.incubator-0.1.0.jar:/usr/local/storm/lib/commons-fileupload-1.2.1.jar:/usr/local/storm/conf:/usr/local/storm/bin backtype.storm.command.list
2535[main] INFO backtype.storm.thrift -Connecting to Nimbus at host01.zh:6627
Topology_nameStatusNum_tasksNum_workersUptime_secs
-------------------------------------------------------------------
log-topology ACTIVE 00656
打包提交代码
在eclipse项目目录下:
命令行中执行maven打包命令:
cd E:\git_local_repo\bigdata\StormXB
mvn package
上传到storm集群中:
运行:
/usr/local/storm/bin/storm jar StormXB-0.0.1-SNAPSHOT.jar ali.storm.action.WebLogStatToplgy
提交任务后,在supervisor上会多出:work进程
启动UI:
[root@host01 logs]#/usr/local/storm/bin/storm ui >/dev/null 2>&1&
[1]2729
[root@host01 logs]# jps
2729 core
2769Jps
1376QuorumPeerMain
2376 nimbus
Storm UI
http://192.168.1.104:8080/index.html
对任务进行操作:杀死 激活等