以下是启动命令以及控制台输出
[hadoop@node3 jstorm-logs]$ jstorm jar /home/hadoop/work/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.chinamobile.jstrom.topology.BusinessBillTopology /data/MM_CDR /home/hadoop/sftp/60805/result 192.168.11.218 6379 10
Running: java -client -Xms256m -Xmx256m -Djstorm.home=/home/hadoop/jstorm-0.9.6.1 -Dstorm.options= -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.jar=/home/hadoop/work/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar -Dstorm.root.logger=INFO,stdout -Dlog4j.configuration=File:/home/hadoop/jstorm-0.9.6.1/conf/aloha_log4j.properties -cp /home/hadoop/jstorm-0.9.6.1/jstorm-client-extension-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/jstorm-client-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/jstorm-server-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/asm-4.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-log4j12-1.7.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-api-1.7.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/snakeyaml-1.11.jar:/home/hadoop/jstorm-0.9.6.1/lib/jzmq-2.1.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/json-simple-1.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/curator-framework-1.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/disruptor-2.10.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-io-2.4.jar:/home/hadoop/jstorm-0.9.6.1/lib/kryo-2.17.jar:/home/hadoop/jstorm-0.9.6.1/lib/guava-13.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-exec-1.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/carbonite-1.5.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/zookeeper-3.4.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/objenesis-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/httpclient-4.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/metrics-core-3.0.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/netty-3.9.0.Final.jar:/home/hadoop/jstorm-0.9.6.1/lib/jgrapht-0.8.3.jar:/home/hadoop/jstorm-0.9.6.1/lib/netty-3.2.2.Final.jar:/home/hadoop/jstorm-0.9.6.1/lib/jline-0.9.94.jar:/home/hadoop/jstorm-0.9.6.1/lib/clojure-1.5.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/reflectasm-1.07-shaded.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-logging-1.1.3.jar:/home/hadoop/jstorm-0.9.6.1/lib/metrics-jvm-3.0.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/fastjson-1.1.41.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-cli-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/servlet-api-2.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/joda-time-2.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/curator-client-1.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-codec-1.6.jar:/home/hadoop/jstorm-0.9.6.1/lib/httpcore-4.3.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/libthrift7-0.7.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/clj-time-0.4.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-lang-2.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/minlog-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/http-20070405.jar:/home/hadoop/jstorm-0.9.6.1/lib/log4j-1.2.16.jar:/home/hadoop/work/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar:/home/hadoop/.jstorm:/home/hadoop/jstorm-0.9.6.1/bin:/home/hadoop/jstorm-0.9.6.1/conf/jstorm.log4j.properties com.chinamobile.jstrom.topology.BusinessBillTopology "/data/MM_CDR" "/home/hadoop/sftp/60805/result" "192.168.11.218" "6379" "10"SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/work/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: Storm conf is not valid. Must be json-serializable
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:92)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:59)
at com.chinamobile.jstrom.topology.BusinessBillTopology.SetRemoteTopology(BusinessBillTopology.java:124)
at com.chinamobile.jstrom.topology.BusinessBillTopology.main(BusinessBillTopology.java:167)
直接原因,
StormSubmitter.submitTopology的时候,conf是否json-serializable判断为false。
normalizeConf(stormConf).equals(normalizeConf((Map) JSON.parse(JSON.toJSONString(stormConf))));
解决方法,
step1 删除nimbus,supervisor所有data,重启zookeeper,nimbus,supervisor,启动topology依然不行
[hadoop@node3 nimbus]$ pwd
/home/hadoop/jstorm-data/nimbus
[hadoop@node3 nimbus]$ ll
total 16
drwxrwxr-x 2 hadoop hadoop 4096 Jan 7 11:55 inbox
drwxrwxr-x 2 hadoop hadoop 4096 Jan 7 11:55 ininumbus
drwxrwxr-x 2 hadoop hadoop 4096 Jan 7 11:55 pids
drwxrwxr-x 2 hadoop hadoop 4096 Jan 7 11:55 stormdist
[hadoop@node3 nimbus]$
step2 改掉topolpgy里String topologyName的值,启动topolpgy OK
以下是启动命令以及控制台输出
[hadoop@node3 version-2]$ jstorm jar /home/hadoop/work/cgl/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.chinamobile.jstrom.topology.BusinessBillTopology /data/MM_CDR /home/hadoop/sftp/60805/result 192.168.11.218 6379 10 2
Running: java -client -Xms256m -Xmx256m -Djstorm.home=/home/hadoop/jstorm-0.9.6.1 -Dstorm.options= -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.jar=/home/hadoop/work/cgl/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar -Dstorm.root.logger=INFO,stdout -Dlog4j.configuration=File:/home/hadoop/jstorm-0.9.6.1/conf/aloha_log4j.properties -cp /home/hadoop/jstorm-0.9.6.1/jstorm-client-extension-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/jstorm-client-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/jstorm-server-0.9.6.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/asm-4.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-log4j12-1.7.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-api-1.7.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/snakeyaml-1.11.jar:/home/hadoop/jstorm-0.9.6.1/lib/jzmq-2.1.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/json-simple-1.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/curator-framework-1.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/disruptor-2.10.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-io-2.4.jar:/home/hadoop/jstorm-0.9.6.1/lib/kryo-2.17.jar:/home/hadoop/jstorm-0.9.6.1/lib/guava-13.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-exec-1.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/carbonite-1.5.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/zookeeper-3.4.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/objenesis-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/httpclient-4.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/metrics-core-3.0.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/netty-3.9.0.Final.jar:/home/hadoop/jstorm-0.9.6.1/lib/jgrapht-0.8.3.jar:/home/hadoop/jstorm-0.9.6.1/lib/netty-3.2.2.Final.jar:/home/hadoop/jstorm-0.9.6.1/lib/jline-0.9.94.jar:/home/hadoop/jstorm-0.9.6.1/lib/clojure-1.5.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/reflectasm-1.07-shaded.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-logging-1.1.3.jar:/home/hadoop/jstorm-0.9.6.1/lib/metrics-jvm-3.0.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/fastjson-1.1.41.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-cli-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/servlet-api-2.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/joda-time-2.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/curator-client-1.3.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-codec-1.6.jar:/home/hadoop/jstorm-0.9.6.1/lib/httpcore-4.3.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/libthrift7-0.7.0.jar:/home/hadoop/jstorm-0.9.6.1/lib/clj-time-0.4.1.jar:/home/hadoop/jstorm-0.9.6.1/lib/commons-lang-2.5.jar:/home/hadoop/jstorm-0.9.6.1/lib/minlog-1.2.jar:/home/hadoop/jstorm-0.9.6.1/lib/http-20070405.jar:/home/hadoop/jstorm-0.9.6.1/lib/log4j-1.2.16.jar:/home/hadoop/work/cgl/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar:/home/hadoop/.jstorm:/home/hadoop/jstorm-0.9.6.1/bin:/home/hadoop/jstorm-0.9.6.1/conf/jstorm.log4j.properties com.chinamobile.jstrom.topology.BusinessBillTopology "/data/MM_CDR" "/home/hadoop/sftp/60805/result" "192.168.11.218" "6379" "10" "2"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/jstorm-0.9.6.1/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/work/cgl/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[INFO 2015-01-07 14:58:53 ThriftClient:44 main] zkServer:[192.168.11.220, 192.168.11.221, 192.168.11.222], zkPort:2181
[WARN 2015-01-07 14:58:54 ConnectionStateManager:174 ConnectionStateManager-0] There are no ConnectionStateListeners registered.
[INFO 2015-01-07 14:58:55 ThriftClient:72 main] Begin to connect node3.ssjs:7627
[INFO 2015-01-07 14:58:55 ThriftClient:44 main] zkServer:[192.168.11.220, 192.168.11.221, 192.168.11.222], zkPort:2181
[WARN 2015-01-07 14:58:55 ConnectionStateManager:174 ConnectionStateManager-0] There are no ConnectionStateListeners registered.
[INFO 2015-01-07 14:58:55 ThriftClient:72 main] Begin to connect node3.ssjs:7627
[INFO 2015-01-07 14:58:55 ThriftClient:44 main] zkServer:[192.168.11.220, 192.168.11.221, 192.168.11.222], zkPort:2181
[WARN 2015-01-07 14:58:55 ConnectionStateManager:174 ConnectionStateManager-0] There are no ConnectionStateListeners registered.
[INFO 2015-01-07 14:58:55 ThriftClient:72 main] Begin to connect node3.ssjs:7627
[INFO 2015-01-07 14:58:55 StormSubmitter:222 main] Jar not uploaded to master yet. Submitting jar...
[INFO 2015-01-07 14:58:55 StormSubmitter:259 main] Uploading topology jar /home/hadoop/work/cgl/topology-0.0.1-SNAPSHOT-jar-with-dependencies.jar to assigned location: /home/hadoop/jstorm-data/nimbus/inbox/69c25031-cb92-443e-8ec2-5b9f72e1de85/stormjar-69c25031-cb92-443e-8ec2-5b9f72e1de85.jar
[INFO 2015-01-07 14:58:55 StormSubmitter:278 main] Successfully uploaded topology jar to assigned location: /home/hadoop/jstorm-data/nimbus/inbox/69c25031-cb92-443e-8ec2-5b9f72e1de85/stormjar-69c25031-cb92-443e-8ec2-5b9f72e1de85.jar
[INFO 2015-01-07 14:58:55 StormSubmitter:113 main] Submitting topology BusinessBillTopologynetty1 in distributed mode with conf {"Calculator_parallelism_hint":10,"Output_parallelism_hint":2,"redisIp":"192.168.11.218","redisPort":6379,"storm.cluster.mode":"distributed","storm.messaging.netty.sync.mode":true,"storm.messaging.transport":"com.alibaba.jstorm.message.netty.NettyContext","topology.acker.executors":4,"topology.debug":false,"topology.max.spout.pending":100,"topology.message.timeout.secs":420,"topology.workers":10,"topology_directory":"/data/MM_CDR","topology_result_directory":"/home/hadoop/sftp/60805/result","use.userdefine.assignment":["[\"null\",\"node7.ssjs\",\"0\",\"null\",\"0\",\"0\",{\"BusinessBillFileSpout\":\"1\",}]","[\"null\",\"node4.ssjs\",\"0\",\"null\",\"0\",\"0\",{\"BusinessBillOutputBout\":\"2\",}]"]}
[INFO 2015-01-07 14:58:56 StormSubmitter:127 main] Finished submitting topology: BusinessBillTopologynetty1
[hadoop@node3 version-2]$
根本原因,todo
http://storm.apache.org/documentation/Serialization.html