Previous Next JavaScript must be enabled to correctly display this content

## 4 Increase Replication Factor for an Existing Topic

This topic provides the systematic instruction to increase Replication Factor for an existing topic.

In case, a topic is already created, and the user want to increase the replication factor.

Then, follow the below steps. Explanation is given below with an example and desired output for easier understanding.

Increase the replicas for the topic structure-closed in partition 0 from only on broker id 0 to broker id 0, 1. i.e. increase replication factor of 1 to 2.

1. Dowload a Increasing Replication Factor file and save to the local.
2. Command to increase the replication factor.
   `./kafka-reassign-partitions.sh --zookeeper zookeeper-server1, zookeeper-server2, zookeeper-server3 --reassignment-json-file jsonFilePath --execute`
   Example:

   `./kafka-reassign-partitions.sh --zookeeper localhost:2181, localhost:2182, localhost:2183 --reassignment-json-file D:\kafka\kafka_2.13-3.8.0\config\increase-replication-factor.json –execute`

   Save this to use as the --reassignment-json-file option during rollbackSuccessfully started reassignment of partitions.

3. Command to increase the replication factor.
   `./kafka-reassign-partitions.sh --zookeeper zookeeper-server1, zookeeper-server2, zookeeper-server3 --reassignment-json-file jsonFilePath --execute`
   Example:

   `./kafka-reassign-partitions.sh --zookeeper localhost:2181, localhost:2182, localhost:2183 --reassignment-json-file D:\kafka\kafka_2.13-3.8.0\config\increase-replication-factor.json –execute`

   Save this to use as the --reassignment-json-file option during rollbackSuccessfully started reassignment of partitions.

4. Command to check the status of the partition reassignment.
   `./kafka-reassign-partitions.sh --zookeeper zookeeper-server1, zookeeper-server2, zookeeper-server3 --reassignment-json-file jsonFilePath --verify`
   Example:

   `./kafka-reassign-partitions.sh --zookeeper localhost:2181, localhost:2182, localhost:2183 --reassignment-json-file D:\kafka\kafka_2.13-3.8.0\config\increase-replication-factor.json –verify`

5. Describe and check the topic.
   `./kafka-topics.sh --describe --zookeeper zookeeper-server1, zookeeper-server2, zookeeper-server3 --topic topic-name`
   Example:

   `./kafka-topics.sh --describe --zookeeper localhost:2181, localhost:2182, localhost:2183 --topic structure-closed`