forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
59 lines
25 KiB
HTML
59 lines
25 KiB
HTML
<a name="mrs_01_0376"></a><a name="mrs_01_0376"></a>
|
|
|
|
<h1 class="topictitle1">Managing Kafka Topics</h1>
|
|
<div id="body1589421630446"><div class="section" id="mrs_01_0376__se26ecb53194e405f958c4ce3378383a7"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_0376__aa3144edd1295421b83ed08a78c1bd310">You can manage Kafka topics on a cluster client based on service requirements. Management permission is required for clusters with Kerberos authentication enabled.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_0376__sd37d6d7758764152ac4d177b37f3127c"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_0376__a1179bbe9a620407fb0d1dcc5676fde5b">You have installed the Kafka client.</p>
|
|
|
|
</div>
|
|
<div class="section" id="mrs_01_0376__sf23385a46fce4ee3baaacbabc3ae5219"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_0376__o05c947a6157c429488f1a6bcdc1d66bd"><li id="mrs_01_0376__li13806122116487"><span>Access the ZooKeeper instance page.</span><p><ul id="mrs_01_0376__en-us_topic_0264266588_ul1692910323486"><li id="mrs_01_0376__en-us_topic_0264266588_li792916322486">For versions earlier than MRS 1.9.2, log in to MRS Manager and choose <strong id="mrs_01_0376__en-us_topic_0264266588_b1584916171418">Services</strong> > <strong id="mrs_01_0376__en-us_topic_0264266588_b2090181614141">ZooKeeper</strong> > <strong id="mrs_01_0376__en-us_topic_0264266588_b179071612143">Instance</strong>.</li><li id="mrs_01_0376__en-us_topic_0264266588_li979413816488">For MRS 1.9.2 or later to versions earlier than 3.x, click the cluster name on the MRS console and choose <strong id="mrs_01_0376__en-us_topic_0264266588_b56141727181418">Components</strong> > <strong id="mrs_01_0376__en-us_topic_0264266588_b562032781420">ZooKeeper</strong> > <strong id="mrs_01_0376__en-us_topic_0264266588_b2620122751416">Instances</strong>.<div class="note" id="mrs_01_0376__en-us_topic_0264266588_note1664505711110"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_0376__en-us_topic_0264266588_p158007468574">If the <strong id="mrs_01_0376__en-us_topic_0264266588_b33924111304">Components</strong> tab is unavailable, complete IAM user synchronization first. (On the <strong id="mrs_01_0376__en-us_topic_0264266588_b1239291112016">Dashboard</strong> page, click <strong id="mrs_01_0376__en-us_topic_0264266588_b939315111101">Synchronize</strong> on the right side of <span class="parmname" id="mrs_01_0376__en-us_topic_0264266588_parmname73938113016"><b>IAM User Sync</b></span> to synchronize IAM users.)</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</p></li><li id="mrs_01_0376__l2f4a4c4b2bbb427a890864b6ae357ea8"><span>View the IP addresses of the ZooKeeper role instance.</span><p><p id="mrs_01_0376__a2c7ffa9191bf467cb17b66c27ef78e5a">Record any IP address of the ZooKeeper instance.</p>
|
|
</p></li><li id="mrs_01_0376__l9b2a798722044c01975eaaee4bebd7dd"><span>Prepare the client based on service requirements. Log in to the node where the client is installed.</span></li><li id="mrs_01_0376__l14680ebec7694c71a1e3056f9ae0f72b"><span>Run the following command to switch to the client directory, for example, /<strong id="mrs_01_0376__b49244712513">opt</strong><strong id="mrs_01_0376__b15924974258"></strong><strong id="mrs_01_0376__b169246782516">/client/Kafka/kafka/bin</strong>.</span><p><p id="mrs_01_0376__af3976b170fc4424ba173ec0c73381a13"><strong id="mrs_01_0376__en-us_topic_0053946969_b208077520224">cd /opt/client/Kafka/kafka/bin</strong></p>
|
|
</p></li><li id="mrs_01_0376__l9974bee6f19240e692c4157eeab1a308"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_0376__abf436e581670449ca4950d9225d58143"><strong id="mrs_01_0376__a64fbd5f493b8412ca7e963f5bdbff088">source /opt/client/bigdata_env</strong></p>
|
|
</p></li><li id="mrs_01_0376__lfa00bf6e182d432dbbe25004a768ab74"><span>Run the following command to perform user authentication (skip this step in normal mode):</span><p><p id="mrs_01_0376__a3161a2660a72482c80662e8cd46c2554"><strong id="mrs_01_0376__b72205782213">kinit</strong> <em id="mrs_01_0376__i15717577224">Component service user</em></p>
|
|
</p></li><li id="mrs_01_0376__lef5a65dfacd94aca8c9991c442b4a360"><a name="mrs_01_0376__lef5a65dfacd94aca8c9991c442b4a360"></a><a name="lef5a65dfacd94aca8c9991c442b4a360"></a><span>For versions earlier than MRS 3.x, run the following commands to manage Kafka topics:</span><p><ul id="mrs_01_0376__uf0ad2c8d0c0c4fb3b550794be48eed98"><li id="mrs_01_0376__lb58d768e76964c39803a0f63f12b2301">Creating a topic<p id="mrs_01_0376__ae5ce81ce5016407c9519ad123428b397"><a name="mrs_01_0376__lb58d768e76964c39803a0f63f12b2301"></a><a name="lb58d768e76964c39803a0f63f12b2301"></a><strong id="mrs_01_0376__b674718483135">sh kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i7752204812138">Topic name</em><strong id="mrs_01_0376__b14752174831312"> --partitions</strong> <em id="mrs_01_0376__i1752104811130">Number of partitions occupied by the topic</em> <strong id="mrs_01_0376__b1375364815133">--replication-factor</strong> <em id="mrs_01_0376__i87531148101313">Number of replicas of the topic</em> <strong id="mrs_01_0376__b18753154811317">--zookeeper</strong> <em id="mrs_01_0376__i1075484841315">IP address of the node where the ZooKeeper instance resides<strong id="mrs_01_0376__b07546487137">:</strong>clientPort</em><strong id="mrs_01_0376__b1375418484133">/kafka</strong></p>
|
|
</li><li id="mrs_01_0376__l89617572a3b04bf7b4617fe6d5c8a0eb">Deleting a topic<p id="mrs_01_0376__a9a1e0b5cbbbd4548aa7c8e8deb799e5a"><a name="mrs_01_0376__l89617572a3b04bf7b4617fe6d5c8a0eb"></a><a name="l89617572a3b04bf7b4617fe6d5c8a0eb"></a><strong id="mrs_01_0376__b91381150141">sh kafka-topics.sh --delete --topic</strong> <em id="mrs_01_0376__i1214313517148">Topic name</em> <strong id="mrs_01_0376__b7144252147">--zookeeper</strong> <em id="mrs_01_0376__i1514455181418">IP address of the node where the ZooKeeper instance resides</em>:<em id="mrs_01_0376__i14144355147">clientPort</em><strong id="mrs_01_0376__b1714465161417">/kafka</strong></p>
|
|
</li></ul>
|
|
<div class="note" id="mrs_01_0376__n1fa9b2e74bc8451f9fd4bd2b74321208"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0376__u9fec8335d2ac4bcf908b5d1689c6a5b3"><li id="mrs_01_0376__l8bd7fab90ce54feb9f3fc1aa45ccf1b0">The number of topic partitions or topic backup replicas cannot exceed the number of Kafka instances.</li><li id="mrs_01_0376__l6ef552b6e07f48eeb1e92169cdc0719f">By default, the value of <span class="parmname" id="mrs_01_0376__en-us_topic_0053946969_parmname89734452817216"><b>clientPort</b></span> of ZooKeeper is <span class="parmvalue" id="mrs_01_0376__p67aea0e3f02b49829ae8bf8dea1fc2d7"><b>2<span id="mrs_01_0376__text59469239252">181</span></b></span>.<p id="mrs_01_0376__p1052717376567">For MRS 1.6.2 or earlier, the value of ZooKeeper's <strong id="mrs_01_0376__b14888105884212">clientPort</strong> defaults to <strong id="mrs_01_0376__b18888258204218">24002</strong>.</p>
|
|
</li><li id="mrs_01_0376__ld36ed7020a27478b960f09a1f17369db">There are three ZooKeeper instances. Use the IP address of any one.</li><li id="mrs_01_0376__lb9d119a01b5e4fbcb3b62dbbf87561eb">For details about managing messages in Kafka topics, see <a href="mrs_01_0379.html">Managing Messages in Kafka Topics</a>.</li></ul>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_0376__li8151829112811"><span>MRS 3.<em id="mrs_01_0376__i716111257383">x</em> and later versions: Use <strong id="mrs_01_0376__b18634102883712">kafka-topics.sh</strong> to manage Kafka topics.</span><p><ul id="mrs_01_0376__ul168653182912"><li id="mrs_01_0376__li25388190164715">Creating a topic:<p id="mrs_01_0376__p111779572114"><a name="mrs_01_0376__li25388190164715"></a><a name="li25388190164715"></a>By default, partitions of a topic are distributed based on the number of partitions on the node and disk. To distribute partitions based on the disk capacity, set <strong id="mrs_01_0376__b166891232192018">log.partition.strategy</strong> to <span class="parmvalue" id="mrs_01_0376__parmvalue7695183141211"><b>capacity</b></span> for the Kafka service.</p>
|
|
<p id="mrs_01_0376__p1070313408128">When a topic is created in Kafka, partitions and copies can be generated based on the combination of rack awareness and cross-AZ feature. The <strong id="mrs_01_0376__b910817148214">--zookeeper </strong>and <strong id="mrs_01_0376__b1689741822113">--bootstrap-server</strong> modes are supported.</p>
|
|
<ul id="mrs_01_0376__ul22051777018"><li id="mrs_01_0376__li88278578191">Disable the rack policy and cross-AZ feature (default policy).<p id="mrs_01_0376__p1315645913191"><a name="mrs_01_0376__li88278578191"></a><a name="li88278578191"></a>Copies of topics created based on this policy are randomly allocated to any node in the cluster.</p>
|
|
<p id="mrs_01_0376__p49557289018"><strong id="mrs_01_0376__b5362949132116">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i1636824911210">topic name </em><strong id="mrs_01_0376__b2036914920217">--partitions </strong><em id="mrs_01_0376__i137019491215">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b12372749102111">--replication-factor </strong><em id="mrs_01_0376__i3373104992119">number of replicas of the topic</em><strong id="mrs_01_0376__b8374114911219">--zookeeper </strong><em id="mrs_01_0376__i1737564917215">IP address of any ZooKeeper node:clientPort</em><strong id="mrs_01_0376__b1637617497213">/kafka</strong></p>
|
|
<p id="mrs_01_0376__p84896551826"><strong id="mrs_01_0376__b227945519216">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i1328516555214">topic name </em><strong id="mrs_01_0376__b528635592111">--partitions </strong><em id="mrs_01_0376__i13287185582118">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b52881955102118">--replication-factor </strong><em id="mrs_01_0376__i228935542112">number of replicas of the topic</em> <strong id="mrs_01_0376__b1529018551215">--</strong><strong id="mrs_01_0376__b182911755172112">bootstrap-server </strong><em id="mrs_01_0376__i829215552213">IP address of the Kafka</em><em id="mrs_01_0376__i122941555182119">cluster:21007</em> <strong id="mrs_01_0376__b12295755132118">--command-config ../config/client.properties</strong></p>
|
|
<p id="mrs_01_0376__p39978131223">If you use <strong id="mrs_01_0376__b1848619311227">--bootstrap-server</strong> to create a topic, set <strong id="mrs_01_0376__b199501468224">rack.aware.enable</strong> and <strong id="mrs_01_0376__b2470182042220">az.aware.enable</strong> to <strong id="mrs_01_0376__b497619820225">false</strong>.</p>
|
|
</li><li id="mrs_01_0376__li13975193411911">Enable the rack policy and disable the cross-AZ feature.<p id="mrs_01_0376__p13129173720194"><a name="mrs_01_0376__li13975193411911"></a><a name="li13975193411911"></a>The leader of each partition of the topic created based on this policy is randomly allocated on the cluster node. However, different replicas of the same partition are allocated to different racks. Therefore, when this policy is used, ensure that the number of nodes in each rack is the same, otherwise, the load of nodes in the rack with fewer nodes is much higher than the average load of the cluster.</p>
|
|
<p id="mrs_01_0376__p12251172619162"><strong id="mrs_01_0376__b1863246194012">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i78641746174010">topic name </em><strong id="mrs_01_0376__b58649465403">--partitions </strong><em id="mrs_01_0376__i6864184618409">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b1986514694016">--replication-factor </strong><em id="mrs_01_0376__i3865164612408">number of replicas of the topic </em><strong id="mrs_01_0376__b19865134604017">--zookeeper </strong><em id="mrs_01_0376__i6865646144016">IP address of any ZooKeeper node:clientPort</em><strong id="mrs_01_0376__b15866646194014">/kafka --enable-rack-aware</strong></p>
|
|
<p id="mrs_01_0376__p10421827541"><strong id="mrs_01_0376__b14461155184018">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i1146165519402">topic name </em><strong id="mrs_01_0376__b8462175504015">--partitions </strong><em id="mrs_01_0376__i046225516404">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b1146235520404">--replication-factor </strong><em id="mrs_01_0376__i1646235511408">number of replicas of the topic</em> <strong id="mrs_01_0376__b3463135513408">--</strong><strong id="mrs_01_0376__b19463125524016">bootstrap-server </strong><em id="mrs_01_0376__i20463195574011">IP address of the Kafka</em><em id="mrs_01_0376__i194631455104018">cluster:21007</em> <strong id="mrs_01_0376__b1346445514408">--command-config ../config/client.properties</strong></p>
|
|
<p id="mrs_01_0376__p856910431743">If you use <strong id="mrs_01_0376__b1722905718407">--bootstrap-server</strong> to create a topic, set <strong id="mrs_01_0376__b1423019574407">rack.aware.enable</strong> to <strong id="mrs_01_0376__b13586148121210">true</strong> and <strong id="mrs_01_0376__b1423075714012">az.aware.enable</strong> to <strong id="mrs_01_0376__b22301257134012">false</strong>.</p>
|
|
</li><li id="mrs_01_0376__li2364112181919">Disable the rack policy and enable the cross-AZ feature.<p id="mrs_01_0376__p136215214193"><a name="mrs_01_0376__li2364112181919"></a><a name="li2364112181919"></a>The leader of each partition of the topic created based on this policy is randomly allocated on the cluster node. However, different replicas of the same partition are allocated to different AZs. Therefore, when this policy is used, ensure that the number of nodes in each AZ is the same, otherwise, the load of nodes in the AZ with fewer nodes is much higher than the average load of the cluster.</p>
|
|
<p id="mrs_01_0376__p1114544314515"><strong id="mrs_01_0376__b13117121664715">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i12123161620471">topic name </em><strong id="mrs_01_0376__b41241616174711">--partitions </strong><em id="mrs_01_0376__i10124121615471">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b12124816114713">--replication-factor </strong><em id="mrs_01_0376__i212571624711">number of replicas of the topic </em><strong id="mrs_01_0376__b41259164478">--zookeeper </strong><em id="mrs_01_0376__i312631615479">IP address of any ZooKeeper node:clientPort</em><strong id="mrs_01_0376__b812601694716">/kafka --enable-az-aware</strong></p>
|
|
<p id="mrs_01_0376__p5921110067"><strong id="mrs_01_0376__b1226713514712">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i8267133594715">topic name </em><strong id="mrs_01_0376__b6268235154716">--partitions </strong><em id="mrs_01_0376__i7268143516476">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b126911350472">--replication-factor </strong><em id="mrs_01_0376__i82691035184714">number of replicas of the topic</em> <strong id="mrs_01_0376__b1126917351472">--</strong><strong id="mrs_01_0376__b132704354477">bootstrap-server </strong><em id="mrs_01_0376__i62700350478">IP address of the Kafka</em><em id="mrs_01_0376__i1127116358476">cluster:21007</em> <strong id="mrs_01_0376__b102711835134712">--command-config ../config/client.properties</strong></p>
|
|
<p id="mrs_01_0376__p4463172818610">If you use <strong id="mrs_01_0376__b97313774716">--bootstrap-server</strong> to create a topic, set <strong id="mrs_01_0376__b13732375476">rack.aware.enable</strong> to <strong id="mrs_01_0376__b167991753152016">false</strong> and <strong id="mrs_01_0376__b57493794714">az.aware.enable</strong> to <strong id="mrs_01_0376__b197412374474">true</strong>.</p>
|
|
</li><li id="mrs_01_0376__li1352625710207">Enable the rack policy and cross-AZ feature.<p id="mrs_01_0376__p145447585208"><a name="mrs_01_0376__li1352625710207"></a><a name="li1352625710207"></a>The leader of each partition of the topic created based on this policy is randomly allocated on the cluster node. However, different replicas of the same partition are allocated to different racks in different AZs. This policy ensures that the number of nodes on each rack in each AZ is the same, otherwise, the load in the cluster is unbalanced.</p>
|
|
<p id="mrs_01_0376__p13798528579"><strong id="mrs_01_0376__b191017813489">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i121598124812">topic name</em><strong id="mrs_01_0376__b8160884812"> --partitions </strong><em id="mrs_01_0376__i121618844812">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b91719814815"> --replication-factor </strong><em id="mrs_01_0376__i9175818482">number of replicas of the topic</em><strong id="mrs_01_0376__b91812811483"> --zookeeper </strong><em id="mrs_01_0376__i11181581483">IP address of any ZooKeeper node</em><em id="mrs_01_0376__i7198818484">:clientPort</em><strong id="mrs_01_0376__b141919815481">/kafka --enable-rack-aware --enable-az-aware</strong></p>
|
|
<p id="mrs_01_0376__p720084517718"><strong id="mrs_01_0376__b381062210489">./kafka-topics.sh --create --topic </strong><em id="mrs_01_0376__i9812142210482">topic name </em><strong id="mrs_01_0376__b1581292214488">--partitions </strong><em id="mrs_01_0376__i158137221487">number of partitions occupied by the topic</em><strong id="mrs_01_0376__b0814172217481">--replication-factor </strong><em id="mrs_01_0376__i18153229481">number of replicas of the topic</em> <strong id="mrs_01_0376__b381513229484">--</strong><strong id="mrs_01_0376__b178161822174810">bootstrap-server </strong><em id="mrs_01_0376__i681719224485">IP address of the Kafka</em><em id="mrs_01_0376__i1181712218480">cluster:21007</em> <strong id="mrs_01_0376__b108181022194819">--command-config ../config/client.properties</strong></p>
|
|
<p id="mrs_01_0376__p15201571584">If you use <strong id="mrs_01_0376__b7436824144814">--bootstrap-server</strong> to create a topic, set <strong id="mrs_01_0376__b1243719248488">rack.aware.enable</strong> and <strong id="mrs_01_0376__b743822404816">az.aware.enable</strong> to <strong id="mrs_01_0376__b10463173616488">true</strong>.</p>
|
|
</li></ul>
|
|
<div class="note" id="mrs_01_0376__note15612115362413"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_0376__ul876017514259"><li id="mrs_01_0376__li476012532513">Kafka supports topic creation in either of the following modes:<ul id="mrs_01_0376__ul15760115192512"><li id="mrs_01_0376__li77601150251">In <strong id="mrs_01_0376__b18769122835313">--zookeeper</strong> mode, the client generates a copy allocation scheme. The community supports this mode from the beginning. To reduce the dependency on the ZooKeeper component, the community will delete the support for this mode in later versions. When creating a topic in this mode, you can select a copy allocation policy by combining the <strong id="mrs_01_0376__b6683151015393">--enable-rack-aware</strong> and <strong id="mrs_01_0376__b106832103397">--enable-az-aware</strong> options. Note: The <strong id="mrs_01_0376__b1030012218392">--enable-az-aware</strong> option can be used only when the cross-AZ feature is enabled on the server, that is, <strong id="mrs_01_0376__b1356813286394">az.aware.enable</strong> is set to <strong id="mrs_01_0376__b193663173917">true</strong>. Otherwise, the execution fails.</li><li id="mrs_01_0376__li376015142519">In <strong id="mrs_01_0376__b15169178125016">--bootstrap-server</strong> mode, the server generates a copy allocation solution. In later versions, the community supports only this mode for topic management. When a topic is created in this mode, the <strong id="mrs_01_0376__b84981349105017">--enable-rack-aware</strong> and <strong id="mrs_01_0376__b116191285115">--enable-az-aware</strong> options cannot be used to control the copy allocation policy. The <strong id="mrs_01_0376__b174231165118">rack.aware.enable</strong> and <strong id="mrs_01_0376__b3409141418519">az.aware.enable</strong> parameters can be used together to control the copy allocation policy. Note that the <strong id="mrs_01_0376__b165091220195111">az.aware.enable</strong> parameter cannot be modified; if the cross-AZ feature is enabled during cluster creation, this parameter is automatically set to <strong id="mrs_01_0376__b18171446155111">true</strong>; the <strong id="mrs_01_0376__b1931515493518">rack.aware.enable</strong> parameter can be customized.</li></ul>
|
|
</li></ul>
|
|
</div></div>
|
|
</li><li id="mrs_01_0376__li194992217202">List of topics:<ul id="mrs_01_0376__ul184931324142015"><li id="mrs_01_0376__l66e92762768d4a3493c515f9bd00760b"><strong id="mrs_01_0376__a72125dcd6e6b4b94ab66472ec993e209">./kafka-topics.sh --list --zookeeper </strong><em id="mrs_01_0376__a15a17c4cf72d4c7cb49b0820dba942ab">service IP address of any ZooKeeper node</em><em id="mrs_01_0376__i48711232204811">:clientPort</em><strong id="mrs_01_0376__a52beb0e66fbf49adbef304bc48fef974">/kafka</strong></li><li id="mrs_01_0376__li1492983018209"><strong id="mrs_01_0376__b11562826172111">./kafka-topics.sh --list --bootstrap-server </strong><em id="mrs_01_0376__i2811612102114">IP address of the Kafka</em><em id="mrs_01_0376__i381110128219">cluster:21007</em> <strong id="mrs_01_0376__b16177142215216">--command-config ../config/client.properties</strong></li></ul>
|
|
</li><li id="mrs_01_0376__li164951610132914">Viewing the topic:<ul id="mrs_01_0376__ul1772491742915"><li id="mrs_01_0376__li553110165299"><strong id="mrs_01_0376__b775644152914">./kafka-topics.sh --describe --zookeeper</strong> <em id="mrs_01_0376__i79811489298">service IP address of any ZooKeeper node</em><em id="mrs_01_0376__i8977204618503">:clientPort</em><strong id="mrs_01_0376__b69864802917">/kafka</strong> --<strong id="mrs_01_0376__b167411123152215">topic</strong> <em id="mrs_01_0376__i44753576296">topic name</em></li><li id="mrs_01_0376__li9238185910295"><strong id="mrs_01_0376__b1877203473019">./kafka-topics.sh --describe --bootstrap-server</strong> <em id="mrs_01_0376__i960761253010">IP address of the Kafka</em><em id="mrs_01_0376__i86074126307">cluster:21007</em> <strong id="mrs_01_0376__b11114115512308">--command-config ../config/client.properties</strong> <strong id="mrs_01_0376__b7706638103017">--topic</strong> <em id="mrs_01_0376__i9876141512303">topic name</em></li></ul>
|
|
</li><li id="mrs_01_0376__li54651651132113">Modifying a topic:<ul id="mrs_01_0376__ul381045111218"><li id="mrs_01_0376__l1147f56f270147e2bea176493ba889ca"><strong id="mrs_01_0376__a0e86a80de59c41d8882708f194e971db">./kafka-topics.sh --alter --topic </strong><em id="mrs_01_0376__a5aaa44a9b26c49c1be9905757aa99128">topic name</em><strong id="mrs_01_0376__a3d2326ee01fc4bbe9ef8c5aeb7770f7b">--config </strong><em id="mrs_01_0376__aa19f8377e45d4f87a238c36693ce9e2a">configuration item=</em><em id="mrs_01_0376__a465f39ac4d7b45e295c2d2356f7d7999">configuration value </em><strong id="mrs_01_0376__a9e3d3011eb884b32b9cb28562cc9c920">--zookeeper </strong><em id="mrs_01_0376__a1921e229f7884d08baba2e84a20f9656">service IP address of any ZooKeeper node</em><em id="mrs_01_0376__i11910154135212">:clientPort</em><strong id="mrs_01_0376__a08bc4aa581624350922e6467eb730d1f">/kafka</strong></li></ul>
|
|
</li><li id="mrs_01_0376__li226143511720">Expanding partitions:<ul id="mrs_01_0376__ul38891245131713"><li id="mrs_01_0376__li14921756121920"><strong id="mrs_01_0376__b1854159151519">./kafka-topics.sh --alter --topic </strong><em id="mrs_01_0376__i457959191519">topic name</em><strong id="mrs_01_0376__b81712871617"> --zookeeper </strong><em id="mrs_01_0376__i131741083163">service IP address of any ZooKeeper node:clientPort</em><strong id="mrs_01_0376__b10976119171611">/kafka --command-config Kafka/kafka/config/client.properties --partitions </strong><em id="mrs_01_0376__i199781019111610">number of partitions after the expansion</em></li><li id="mrs_01_0376__li172251459179"><strong id="mrs_01_0376__b1254502618163">./kafka-topics.sh --alter --topic</strong> <em id="mrs_01_0376__i19548192691618">topic name</em><strong id="mrs_01_0376__b10805133421619"> --bootstrap-server</strong> <em id="mrs_01_0376__i14812113410166">IP address of the Kafka cluster</em><em id="mrs_01_0376__i1072944115165">:21007</em><strong id="mrs_01_0376__b1250510473167"> --command-config Kafka/kafka/config/client.properties --partitions </strong><em id="mrs_01_0376__i4510164781610">number of partitions after the expansion</em></li></ul>
|
|
</li><li id="mrs_01_0376__li42542952613">Deleting a topic<ul id="mrs_01_0376__ul18488133192610"><li id="mrs_01_0376__li05741922122618"><strong id="mrs_01_0376__b45741522132618">./kafka-topics.sh --delete --topic </strong><em id="mrs_01_0376__i857582262617">topic name </em><strong id="mrs_01_0376__b1557522262613">--zookeeper </strong><em id="mrs_01_0376__i257562219265"><em id="mrs_01_0376__i1857542212268"><em id="mrs_01_0376__i45754227267">Service IP address of any ZooKeeper node</em></em>:clientPort</em><strong id="mrs_01_0376__b4575172214261">/kafka</strong></li><li id="mrs_01_0376__li9620173418260"><strong id="mrs_01_0376__b1541691718273">./kafka-topics.sh --delete --topic </strong><em id="mrs_01_0376__i2416161714271">topic name</em><strong id="mrs_01_0376__b1880122342715">--bootstrap-server </strong><em id="mrs_01_0376__i088042332720">IP address of the Kafka cluster</em><em id="mrs_01_0376__i108801723112719">:21007</em> <strong id="mrs_01_0376__b888072311272">--command-config ../config/client.properties</strong></li></ul>
|
|
</li></ul>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0375.html">Using Kafka</a></div>
|
|
</div>
|
|
</div>
|
|
|