1、首先将原来的代码备份,即将src的main里面的代码备份起来
2、上传自己的代码到src/main/java路径下
3、切换到root
4、用maven编译:mvn package
5、转到target目录下,运行:storm jar word-count-1.0.jar FMRadio(或storm jar word-count-1.0.jar FMRadio TopologyName)
6、有时候nimbus什么的可能会挂了,需要重新启动:
storm nimbus >/dev/null 2>&1 &
storm supervisor >/dev/null 2>&1 &
storm ui >/dev/null 2>&1 &
7、杀死拓扑
storm kill TopologyName
8、storm.yaml配置文件(在~/storm-yarn-master/lib/storm-0.9.0-wip21/conf目录下)
########### These MUST be filled in for a storm configuration
storm.zookeeper.servers:
- "master"
- "slave01"
- "slave02"
- "slave03"
- "slave04"
storm.local.dir: "~/workdir"
storm.zookeeper.port: 2181
nimbus.host: "slave04"
supervisor.slots.ports:
- 6700
- 6701
# - 6702
# - 6703
#
# nimbus.host: "nimbus"
#
#
# ##### These may optionally be filled in:
#
## List of custom serializations
# topology.kryo.register:
# - org.mycompany.MyType
# - org.mycompany.MyType2: org.mycompany.MyType2Serializer
#
## List of custom kryo decorators
# topology.kryo.decorators:
# - org.mycompany.MyDecorator
#
## Locations of the drpc servers
# drpc.servers:
# - "server1"
# - "server2"
## Metrics Consumers
# topology.metrics.consumer.register:
# - class: "backtype.storm.metrics.LoggingMetricsConsumer"
# parallelism.hint: 1
# - class: "org.mycompany.MyMetricsConsumer"
# parallelism.hint: 1
# argument:
# - endpoint: "metrics-collector.mycompany.org"
9、查看/etc/hosts文件来确定节点ip地址