forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
35 lines
7.3 KiB
HTML
35 lines
7.3 KiB
HTML
<a name="kafka-ug-0012"></a><a name="kafka-ug-0012"></a>
|
|
|
|
<h1 class="topictitle1">Deleting a Consumer Group</h1>
|
|
<div id="body0000001285861801"><p id="kafka-ug-0012__p198691551016">You can delete a consumer group using either of the following methods:</p>
|
|
<ul id="kafka-ug-0012__ul136678571796"><li id="kafka-ug-0012__li1489914391011">Method 1: Delete a consumer group on the console.</li><li id="kafka-ug-0012__li96670571191">Method 2: Use <a href="https://cwiki.apache.org/confluence/display/KAFKA/Clients" target="_blank" rel="noopener noreferrer">Kafka CLI</a> to delete a consumer group. (Ensure that the Kafka instance version is the same as the CLI version.)</li></ul>
|
|
<div class="section" id="kafka-ug-0012__section78321825104815"><h4 class="sectiontitle">Prerequisites</h4><p id="kafka-ug-0012__p0333193016482">The status of the consumer group to be deleted is <strong id="kafka-ug-0012__b16318504410">EMPTY</strong>.</p>
|
|
</div>
|
|
<div class="section" id="kafka-ug-0012__section147341279161"><h4 class="sectiontitle">Method 1: Deleting a Consumer Group on the Console</h4><ol id="kafka-ug-0012__ol3215151213171"><li id="kafka-ug-0012__li10427115412419"><span>Log in to the management console.</span></li><li id="kafka-ug-0012__li14905725134512"><span>Click <span><img id="kafka-ug-0012__image187691835191911" src="en-us_image_0143929918.png"></span> in the upper left corner to select a region.</span><p><div class="note" id="kafka-ug-0012__note596412409275"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kafka-ug-0012__p11964174020277">Select the region where your Kafka instance is located.</p>
|
|
</div></div>
|
|
</p></li><li id="kafka-ug-0012__li189561034172215"><span>Click <strong id="kafka-ug-0012__b194429960395716">Service List</strong> and choose <strong id="kafka-ug-0012__b63056350295716">Application</strong> > <strong id="kafka-ug-0012__b186573218495716">Distributed Message Service</strong>. The Kafka instance list is displayed.</span></li><li id="kafka-ug-0012__li13248719142014"><span>Click the desired Kafka instance to view the instance details.</span></li><li id="kafka-ug-0012__li1063043712019"><span>In the navigation pane, choose the <strong id="kafka-ug-0012__b8238267010">Consumer Groups</strong> tab.</span></li><li id="kafka-ug-0012__li432114271306"><span>Delete consumer groups using either of the following methods:</span><p><ul id="kafka-ug-0012__ul54985481419"><li id="kafka-ug-0012__li104997486113">Select one or more consumer groups and click <strong id="kafka-ug-0012__b174279394017">Delete Consumer Group</strong> above the consumer group list.</li><li id="kafka-ug-0012__li53063508319">In the row containing the consumer group you want to delete, click <strong id="kafka-ug-0012__b169415571006">Delete</strong>.</li></ul>
|
|
<div class="notice" id="kafka-ug-0012__note153045585233"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="kafka-ug-0012__p830585892319">A consumer group can be deleted only when its status is <strong id="kafka-ug-0012__b4726261813">EMPTY</strong>.</p>
|
|
</div></div>
|
|
<p id="kafka-ug-0012__p19895133492515">Consumer group statuses include:</p>
|
|
<ul id="kafka-ug-0012__ul19168155184418"><li id="kafka-ug-0012__li20168185114419"><strong id="kafka-ug-0012__b12132164663">DEAD</strong>: The consumer group has no member or metadata.</li><li id="kafka-ug-0012__li10168353441"><strong id="kafka-ug-0012__b7539151519615">EMPTY</strong>: The consumer group has metadata but has no member.</li><li id="kafka-ug-0012__li161684517449"><strong id="kafka-ug-0012__b163414221162">PREPARING_REBALANCE</strong>: The consumer group is to be rebalanced.</li><li id="kafka-ug-0012__li2168354449"><strong id="kafka-ug-0012__b58421361669">COMPLETING_REBALANCE</strong>: All members have joined the consumer group.</li><li id="kafka-ug-0012__li188421774418"><strong id="kafka-ug-0012__b13984115212818">STABLE</strong>: Members in the consumer group can consume messages normally.</li></ul>
|
|
</p></li><li id="kafka-ug-0012__li3295105062310"><span>In the displayed <strong id="kafka-ug-0012__b41051219196">Delete Consumer Group</strong> dialog box, click <strong id="kafka-ug-0012__b61841201099">Yes</strong>.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="kafka-ug-0012__section119712262169"><h4 class="sectiontitle">Method 2: Using the CLI to Delete a Consumer Group</h4><p id="kafka-ug-0012__p1289365114509">The following uses Linux as an example.</p>
|
|
<ol id="kafka-ug-0012__ol151131034144715"><li id="kafka-ug-0012__li3113834184715"><span>Download Kafka CLI <a href="https://archive.apache.org/dist/kafka/1.1.0/kafka_2.11-1.1.0.tgz" target="_blank" rel="noopener noreferrer">v1.1.0</a>, <a href="https://archive.apache.org/dist/kafka/2.7.2/kafka_2.12-2.7.2.tgz" target="_blank" rel="noopener noreferrer">v2.7.2</a>, or <a href="https://archive.apache.org/dist/kafka/2.3.0/kafka_2.11-2.3.0.tgz" target="_blank" rel="noopener noreferrer">v2.3.0</a>. Ensure that the Kafka instance and the CLI are of the same version.</span></li><li id="kafka-ug-0012__li717413501994"><span>Use the CLI to connect to the Kafka instance. For details, see <a href="kafka-ug-180604020.html">Accessing a Kafka Instance Without SASL</a> or <a href="kafka-ug-180801001.html">Accessing a Kafka Instance with SASL</a>.</span></li><li id="kafka-ug-0012__li17703181513151"><span>In the <strong id="kafka-ug-0012__b194492912476">/</strong><em id="kafka-ug-0012__i191421925144713">{directory where the CLI is located}</em><strong id="kafka-ug-0012__b194411292477">/kafka_</strong><em id="kafka-ug-0012__i10104181464710">{version}</em><strong id="kafka-ug-0012__b510471416475">/bin/</strong> directory, run the following command to delete a consumer group:</span><p><p id="kafka-ug-0012__p62972151913"><strong id="kafka-ug-0012__b326014691118">kafka-consumer-groups.sh --bootstrap-server </strong><em id="kafka-ug-0012__i9557196171119">{Kafka instance connection address}</em><strong id="kafka-ug-0012__b14369181051114"> --delete --group </strong><em id="kafka-ug-0012__i17511611181112">{consumer group name}</em></p>
|
|
<pre class="screen" id="kafka-ug-0012__screen12971814192">[root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 192.168.1.245:9091,192.168.1.86:9091,192.168.1.128:9091 --delete --group bbbb
|
|
Note: This will not show information about old Zookeeper-based consumers.
|
|
Deletion of requested consumer groups ('bbbb') was successful.</pre>
|
|
<div class="note" id="kafka-ug-0012__note3326106122015"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kafka-ug-0012__p193261612013">If SASL authentication is enabled for the Kafka instance, the <strong id="kafka-ug-0012__b1465913314122">--command-config <em id="kafka-ug-0012__i7988145613202">{consumer.properties file with SASL authentication}</em></strong> parameter must be added to the preceding commands. For details about the <strong id="kafka-ug-0012__b5517172117212">consumer.properties</strong> file, see <a href="kafka-ug-180801001.html">Accessing a Kafka Instance with SASL</a>.</p>
|
|
</div></div>
|
|
</p></li></ol>
|
|
<p id="kafka-ug-0012__p14187175991615"></p>
|
|
</div>
|
|
<p id="kafka-ug-0012__p7279182810183"></p>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="kafka-ug-0011.html">Managing Consumer Groups</a></div>
|
|
</div>
|
|
</div>
|
|
|