Storm 本机运行 提交StormSubmitter

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 &

storm ui 默认地址 http://127.0.0.1:8080/index.html

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

4. storm list 查看作业

storm list

storm kill topology-name 来杀死进程

http://www.waitingfy.com/archives/4420

4420

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.