Storm topology configuration

后端 未结 7 2153
南方客
南方客 2021-02-05 10:29

How do you provide a custom configuration to a storm topology? For example, if I have a topology that I built that connects to a MySQL cluster and I want to be able to change w

7条回答
  •  半阙折子戏
    2021-02-05 10:59

    I solved this problem by just providing the config in code:

    config.put(Config.TOPOLOGY_WORKER_CHILDOPTS, SOME_OPTS);
    

    I tried to provide a topology-specific storm.yaml but it doesn't work. Correct me if you make it work to use a storm.yaml.

    Update:
    For anyone who wants to know what SOME_OPTS is, this is from Satish Duggana on the Storm mailing list:

    Config.TOPOLOGY_WORKER_CHILDOPTS: Options which can override WORKER_CHILDOPTS for a topology. You can configure any java options like memory, gc etc

    In your case it can be

    config.put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-Xmx1g");
    

提交回复
热议问题