如题,Storm并行度与kafka分区数是否有关系呢?
BrokerHosts brokerHosts = new ZkHosts(zkConnString);
SpoutConfig spoutConfig = new SpoutConfig(brokerHosts, topicName, "/storm", "TestLog" );
spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
spoutConfig.forceFromStart = false;
spoutConfig.zkServers = Arrays.asList(new String[]{"server2","server3","server4"});
spoutConfig.zkPort = 2181;
TopologyBuilder topology = new TopologyBuilder();
topology.setSpout("KafkaReader", new KafkaSpout(spoutConfig) , 3);
这里并行度设的是3,topic的分区数是1的时候,消息不会露掉;当分区数是3的时候,接受消息就会露掉;分区数为5的时候,也会掉
咨询下,storm这里的并行度与kafka的分区数是否有对应关系?
并行度 分区数
3 2
3 10
|
|