1. Storm 启动
#启动Zookeeper
nohup sh storm dev-zookeeper &
#启动主节点
nohup sh storm nimbus &
#启动从节点
nohup sh storm supervisor &
#启动UI界面
nohup sh storm ui &
#启动日志查看服务
nohup sh storm logviewer &
2.程序修改
public static void main(String[] args){
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("DataSourceSpout", new DataSourceSpout());
builder.setBolt("SumBolt", new SumBolt()).shuffleGrouping("DataSourceSpout");
String topoName = ClusterSumStormAckerTopology.class.getSimpleName();
try {
StormSubmitter.submitTopology(topoName,new Config(),
builder.createTopology());
} catch (Exception e) {
e.printStackTrace();
}
}
3. 提交jar运行
#格式
storm jar topology-jar-path class args0 args1 args2
#具体
storm jar ./target/bigdata-1.0.jar com.waiting.ClusterSumStormAckerTopology
4420
原文
http://www.waitingfy.com/archives/4420