Use external Zookeeper in Local mode

By default Storm uses the in-process ZooKeeper when the local mode
is chosen.

The in-process ZooKeeper doesn't handle the trim of ZooKeeper
Transactional logs & snapshots.

There is a constructor which enables the possibility to use an
external ZooKeeper when the local mode is used. [1][2]

[1] https://issues.apache.org/jira/browse/STORM-213
[2] https://github.com/apache/storm/pull/137/files

Change-Id: I4c6e6f1dbacf093f94b566abc7251f4e33eff93f
This commit is contained in:
Martin Chacon Piza 2021-03-27 19:30:29 +01:00
parent d8420f5ec0
commit d156980a52
1 changed files with 4 additions and 1 deletions

View File

@ -102,7 +102,10 @@ public class ThresholdingEngine {
if (local) {
logger.info("submitting topology {} to local storm cluster", topologyName);
new LocalCluster().submitTopology(topologyName, config, topology);
new LocalCluster(
System.getenv("ZOOKEEPER_SERVERS"),
new Long(System.getenv("ZOOKEEPER_PORT"))
).submitTopology(topologyName, config, topology);
} else {
logger.info("submitting topology {} to non-local storm cluster", topologyName);
StormSubmitter.submitTopology(topologyName, config, topology);