You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Check and wait until the <code>Lag</code> is small for a majority of the controllers. If the leader's end offset is not increasing, you can wait until the lag is 0 for a majority; otherwise, you can pick the latest leader end offset and wait until all replicas have reached it. Check and wait until the <code>LastFetchTimestamp</code> and <code>LastCaughtUpTimestamp</code> are close to each other for the majority of the controllers. At this point it is safer to format the controller's metadata log directory. This can be done by running the kafka-storage.sh command.</p>
1345
1345
1346
-
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id uuid --config server_properties</code></pre>
1346
+
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id uuid --config config/server.properties</code></pre>
1347
1347
1348
1348
<p>It is possible for the <code>bin/kafka-storage.sh format</code> command above to fail with a message like <code>Log directory ... is already formatted</code>. This can happen when combined mode is used and only the metadata log directory was lost but not the others. In that case and only in that case, can you run the <code>bin/kafka-storage.sh format</code> command with the <code>--ignore-formatted</code> option.</p>
1349
1349
1350
1350
<p>Start the KRaft controller after formatting the log directories.</p>
<h5class="anchor-heading"><aid="kraft_storage_standalone"class="anchor-link"></a><ahref="#kraft_storage_standalone">Bootstrap a Standalone Controller</a></h5>
3828
3828
The recommended method for creating a new KRaft controller cluster is to bootstrap it with one voter and dynamically <ahref="#kraft_reconfig_add">add the rest of the controllers</a>. Bootstrapping the first controller can be done with the following CLI command:
3829
3829
3830
-
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id <cluster-id> --standalone --config controller.properties</code></pre>
3830
+
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id <CLUSTER_ID> --standalone --config config/controller.properties</code></pre>
3831
3831
3832
3832
This command will 1) create a meta.properties file in metadata.log.dir with a randomly generated directory.id, 2) create a snapshot at 00000000000000000000-0000000000.checkpoint with the necessary control records (KRaftVersionRecord and VotersRecord) to make this Kafka node the only voter for the quorum.
3833
3833
3834
3834
<h5class="anchor-heading"><aid="kraft_storage_voters"class="anchor-link"></a><ahref="#kraft_storage_voters">Bootstrap with Multiple Controllers</a></h5>
3835
3835
The KRaft cluster metadata partition can also be bootstrapped with more than one voter. This can be done by using the --initial-controllers flag:
This command is similar to the standalone version but the snapshot at 00000000000000000000-0000000000.checkpoint will instead contain a VotersRecord that includes information for all of the controllers specified in --initial-controllers. It is important that the value of this flag is the same in all of the controllers with the same cluster id.
<h5class="anchor-heading"><aid="kraft_storage_observers"class="anchor-link"></a><ahref="#kraft_storage_observers">Formatting Brokers and New Controllers</a></h5>
3852
3852
When provisioning new broker and controller nodes that we want to add to an existing Kafka cluster, use the <code>kafka-storage.sh format</code> command with the --no-initial-controllers flag.
3853
3853
3854
-
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id <cluster-id> --config server.properties --no-initial-controllers</code></pre>
3854
+
<pre><codeclass="language-bash">$ bin/kafka-storage.sh format --cluster-id <CLUSTER_ID> --config config/server.properties --no-initial-controllers</code></pre>
After starting the controller, the replication to the new controller can be monitored using the <code>bin/kafka-metadata-quorum.sh describe --replication</code> command. Once the new controller has caught up to the active controller, it can be added to the cluster using the <code>bin/kafka-metadata-quorum.sh add-controller</code> command.
3918
3918
3919
3919
When using broker endpoints use the --bootstrap-server flag:
If the dynamic controller cluster already exists, it can be shrunk using the <code>bin/kafka-metadata-quorum.sh remove-controller</code> command. Until KIP-996: Pre-vote has been implemented and released, it is recommended to shutdown the controller that will be removed before running the remove-controller command.
<p>The assignment strategy is also controlled by the server. The <code>group.consumer.assignors</code> configuration can be used to specify the list of available
4188
4188
assignors for <code>Consumer</code> groups. By default, the <code>uniform</code> assignor and the <code>range</code> assignor are configured. The first assignor
4189
4189
in the list is used by default unless the Consumer selects a different one. It is also possible to implement custom assignment strategies on the server side
4190
-
by implementing the <code>org.apache.kafka.coordinator.group.api.assignor.ConsumerGroupPartitionAssignor</code> interface and specifying the full class name in the configuration.</p>
4190
+
by implementing the <code>ConsumerGroupPartitionAssignor</code> interface and specifying the full class name in the configuration.</p>
0 commit comments