【问题标题】:Spouts and bolts information missing in storm UI when storm jar is deployed using nimbus client使用 nimbus 客户端部署 Storm jar 时,Storm UI 中缺少 Spout 和 Bolts 信息
【发布时间】:2016-03-10 06:54:32
【问题描述】:

我遵循了下面帖子中的示例

How to submit a topology in storm production cluster using IDE

Below is my implementation

TopologyBuilder builder = new TopologyBuilder();

        Map storm_conf = Utils.readStormConfig();
        storm_conf.put("nimbus.host", "localhost");
        Nimbus.Client client = NimbusClient.getConfiguredClient(storm_conf)
                .getClient();
        String inputJar = "/home/user/TestType-1.0.jar";
        NimbusClient nimbus = null;
        try {
            nimbus = new NimbusClient(storm_conf, "localhost", 6627);
        } catch (TTransportException e) {
            System.out.println("unable to connect to client");
            e.printStackTrace();
        }

        System.setProperty("storm.jar", "/home/user/TestType-1.0.jar");

        String jsonConf = JSONValue.toJSONString(storm_conf);
        try {
            nimbus.getClient().submitTopology("SellerPageTypeTopology",
                    "/home/user/TestType-1.0.jar", jsonConf, builder.createTopology());
        } catch (AlreadyAliveException e) {
            e.printStackTrace();
        } catch (InvalidTopologyException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

我能够成功部署拓扑。在暴风雨 Ui 中,我能够看到拓扑处于活动状态,但缺少 spout 和 bolt 细节。知道我错过了什么。感谢您的帮助。

【问题讨论】:

    标签: apache-storm


    【解决方案1】:

    您创建了一个空拓扑,然后将其提交。您的 spouts 和 bolts 没有显示,因为您尚未将它们添加到 TopologyBuilder:

    Config config = new Config();
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout(MY_SPOUT_ID, mySpout);
    builder.setBolt(MY_BOLT1_ID, myBolt1, 2).shuffleGrouping(MY_SPOUT_ID);
    builder.setBolt(MY_BOLT2_ID, myBolt2).shuffleGrouping(MY_SPOUT_ID);
    

    参考:https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_storm-user-guide/content/storm-parallelism.html

    【讨论】:

    • 我已经声明了喷口和螺栓并打包在我的罐子里。可能我错过了在 NimbusClient API 中指定主类的方法。
    猜你喜欢
    • 2015-04-22
    • 2013-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-01
    • 2019-09-03
    • 1970-01-01
    • 2019-02-19
    相关资源
    最近更新 更多