0

I have followed an example from the below post

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();
        }

i was able to deploy topology successfully. In the storm Ui i was able to see topology active,But spout and bolt details are missing. Any idea what am i missing missing. Thanks for the help.

Community
  • 1
  • 1
user3514641
  • 87
  • 2
  • 12

1 Answers1

0

You've created an empty Topology and then submitted it. Your spouts and bolts don't show up because you haven't added them yet to your 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);

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

Kit Menke
  • 7,046
  • 1
  • 32
  • 54
  • I have declared spouts and bolts and packaged in my jar. Probably i'm missing a way to specify main class in NimbusClient API. – user3514641 Mar 24 '16 at 20:08