If you want to increase the number of replicas of a Kafka topic, here’s what you need to do.
First, specify the replicas in a reassignment JSON file. For instance, you can create a JSON file called increase-replicas.json and add the following content to it:
{“version”:1,
“partitions”:[
{“topic”: “signals”, “partition”: 0, “replicas”: [0,1,2]},
{“topic”: “signals”, “partition” :1, “replicas”: [0,1,2]},
]}
Next, use the file with the kafka-reassign-partitions (or kafka-reassign-partitions.sh depending on the package) tool, specifically with the –execute option. Here’s how that command will look:
kafka-reassign-partitions –zookeeper localhost:2181 –reassignment-json-file increase-replicas.json –execute
Finally, use the kafka-topics (or kafka-topics.sh) tool to verify the replication factor. For that, do:
kafka-topics –zookeeper localhost:2181 –topic signals –describe
At the moment, Memphis does not support multiple partitions. Partitions will be available in the coming versions.