Search code examples
apache-stormtrident

When I use storm trident, if I set the parallelism not less than 2, how can I make all the executors run on different servers not just on one server?


i.e., if the parallelism is 2, the bolt run on 2 different servers, and if the parallelism is 3, the bolt run on 3 different servers. It's important for me, for I don't want all the tasks running on just one server, that'll be too slow.


Solution

  • Try to increase configuration parameter "number of workers" (default value is 1) via

    Config cfg = new Config();
    cfg.setNumWorkers(...);
    

    You can also limit the number of workers per host via storm.yaml config parameter supersior.slots.ports -- for each port, one worker JVM can be started, thus if you only provide one port for this config, only one worker JVM will get started. Just be aware, that this might limit the number of topologies you can run. A single worker JVM will only execute code from a single topology (to isolate topologies from each other).