forked from docs/doc-exports
Reviewed-by: Antonova, Ekaterina <ekantono@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
74 lines
13 KiB
HTML
74 lines
13 KiB
HTML
<a name="kafka-ug-0015"></a><a name="kafka-ug-0015"></a>
|
|
|
|
<h1 class="topictitle1">Viewing Kafka Consumer Information</h1>
|
|
<div id="body0000001291897433"><p id="kafka-ug-0015__p181530565111">If a consumer group has consumers who are accessing a Kafka instance, you can view their connection information.</p>
|
|
<div class="section" id="kafka-ug-0015__section1950093111817"><h4 class="sectiontitle">Prerequisites</h4><p id="kafka-ug-0015__p237943731810">The consumer list and connection address can be viewed only when consumers in a consumer group are connected to the Kafka instance (that is, the consumer group is in the <strong id="kafka-ug-0015__b9691133721512">STABLE</strong> state).</p>
|
|
</div>
|
|
<div class="section" id="kafka-ug-0015__section16740253152"><h4 class="sectiontitle">Viewing the Consumer List (Console)</h4><ol id="kafka-ug-0015__ol202972359157"><li id="kafka-ug-0015__li353314276616"><span>Log in to the console.</span></li><li id="kafka-ug-0015__li7534122712610"><span>Click <span><img id="kafka-ug-0015__image437122211711" src="en-us_image_0143929918.png"></span> in the upper left corner to select a region.</span><p><div class="note" id="kafka-ug-0015__note5534727065"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kafka-ug-0015__p853411271611">Select the region where your Kafka instance is located.</p>
|
|
</div></div>
|
|
</p></li><li id="kafka-ug-0015__li275385101417"><span>Click <strong id="kafka-ug-0015__b10971146101619">Service List</strong> and choose <strong id="kafka-ug-0015__b19972114641613">Application</strong> > <strong id="kafka-ug-0015__b0972174616168">Distributed Message Service</strong>. The Kafka instance list is displayed.</span></li><li id="kafka-ug-0015__li1953462718613"><span>Click an instance to go to the instance details page.</span></li><li id="kafka-ug-0015__li1153419278618"><span>In the navigation pane, choose <strong id="kafka-ug-0015__b12441556101614">Consumer Groups</strong>.</span></li><li id="kafka-ug-0015__li1829733518154"><span>Click the name of the desired consumer group.</span></li><li id="kafka-ug-0015__li9783112618516"><span>On the <strong id="kafka-ug-0015__b3587141191715">Consumers</strong> tab page, view the consumer list.</span><p><p id="kafka-ug-0015__p105492358618">In the consumer list, you can view the consumer ID, consumer address, and client ID.</p>
|
|
</p></li><li id="kafka-ug-0015__li118161936183018"><span>(Optional) To query a specific consumer, enter the consumer ID in the search box and press <strong id="kafka-ug-0015__b11130141094410">Enter</strong>.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="kafka-ug-0015__section7157144213304"><h4 class="sectiontitle">Viewing the Consumer List (Kafka CLI)</h4><ul id="kafka-ug-0015__ul145946914322"><li id="kafka-ug-0015__li8594993327">For a Kafka instance with ciphertext access disabled, run the following command in the <strong id="kafka-ug-0015__b4789723172811">/bin</strong> directory of the Kafka client:<pre class="screen" id="kafka-ug-0015__screen35946911327">./kafka-consumer-groups.sh --bootstrap-server ${connection-address} --group ${group-name} --members --describe</pre>
|
|
<p id="kafka-ug-0015__p251111134315">Parameter description:</p>
|
|
<ul id="kafka-ug-0015__ul6641131564310"><li id="kafka-ug-0015__li536311374319"><strong id="kafka-ug-0015__b2015649543104515">connection-address</strong>: can be obtained from the <strong id="kafka-ug-0015__b1604293376104515">Connection</strong> area on the <strong id="kafka-ug-0015__b947421403104515">Basic Information</strong> page on the Kafka console.</li><li id="kafka-ug-0015__li259419356438"><strong id="kafka-ug-0015__b1357143612176">group-name</strong>: consumer group name.</li></ul>
|
|
<p id="kafka-ug-0015__p1968375217431">Example:</p>
|
|
<pre class="screen" id="kafka-ug-0015__screen67215263469">[root@ecs-kafka bin]# ./kafka-consumer-groups.sh --bootstrap-server 192.168.xx.xx:9092,192.168.xx.xx:9092,192.168.xx.xx:9092 --group test --members --describe
|
|
|
|
GROUP CONSUMER-ID HOST CLIENT-ID #PARTITIONS
|
|
test console-consumer-571a64fe-b0c4-47ce-833d-9e0da5a88d14 /192.168.0.215 console-consumer 3
|
|
[root@ecs-kafka bin]#</pre>
|
|
</li><li id="kafka-ug-0015__li135941897328">For a Kafka instance with ciphertext access enabled, do as follows:<ol id="kafka-ug-0015__ol15959915327"><li id="kafka-ug-0015__li1873184414916">(Optional) Modify the client configuration file.<div class="p" id="kafka-ug-0015__p14473184894916"><a name="kafka-ug-0015__li1873184414916"></a><a name="li1873184414916"></a>View <strong id="kafka-ug-0015__b181939147851319">Security Protocol</strong> in the <strong id="kafka-ug-0015__b149343931151319">Connection</strong> area on the <strong id="kafka-ug-0015__b56575751151319">Basic Information</strong> page on the Kafka console. The configuration settings vary depending on the protocol.<ul id="kafka-ug-0015__ul2643717214"><li id="kafka-ug-0015__li4646711216">SASL_PLAINTEXT: Skip this step if the username and password are already set. Otherwise, create the <strong id="kafka-ug-0015__b134902710951329">ssl-user-config.properties</strong> file in the <strong id="kafka-ug-0015__b186088116451329">/config</strong> directory on the Kafka client and add the following content to the file:<pre class="screen" id="kafka-ug-0015__screen4598144192618">security.protocol=SASL_PLAINTEXT
|
|
# If the SASL mechanism is SCRAM-SHA-512, configure as follows:
|
|
sasl.jaas.config=org.apache.kafka.common.security.<strong id="kafka-ug-0015__kafka-ug-180604018_b883312781111">scram.</strong><strong id="kafka-ug-0015__kafka-ug-180604018_b1783311741112">ScramLoginModule</strong> required \
|
|
username="**********" \
|
|
password="**********";
|
|
sasl.mechanism=<strong id="kafka-ug-0015__kafka-ug-180604018_b128331377110">SCRAM-SHA-512</strong>
|
|
# If the SASL mechanism is PLAIN, configure as follows:
|
|
sasl.jaas.config=org.apache.kafka.common.security.<strong id="kafka-ug-0015__kafka-ug-180604018_b166481219196">plain.PlainLoginModule</strong> required \
|
|
username="**********" \
|
|
password="**********";
|
|
sasl.mechanism=<strong id="kafka-ug-0015__kafka-ug-180604018_b964813191391">PLAIN</strong></pre>
|
|
<p id="kafka-ug-0015__p117102681410">Parameter description: <strong id="kafka-ug-0015__b1398982651103926">username</strong> and <strong id="kafka-ug-0015__b690789222103926">password</strong> are the ones you set when enabling ciphertext access for the first time or when creating a user.</p>
|
|
</li><li id="kafka-ug-0015__li493632862118">SASL_SSL: Skip this step if the username, password, and SSL certificate are already set. Otherwise, create the <strong id="kafka-ug-0015__b195419116051329">ssl-user-config.properties</strong> file in the <strong id="kafka-ug-0015__b39271852651329">/config</strong> directory on the Kafka client and add the following content to the file:<pre class="screen" id="kafka-ug-0015__screen0832225182718">security.protocol=SASL_SSL
|
|
ssl.truststore.location={ssl_truststore_path}
|
|
ssl.truststore.password=dms@kafka
|
|
ssl.endpoint.identification.algorithm=
|
|
# If the SASL mechanism is SCRAM-SHA-512, configure as follows:
|
|
sasl.jaas.config=org.apache.kafka.common.security.<strong id="kafka-ug-0015__kafka-ug-180604018_b4657131681320">scram.</strong><strong id="kafka-ug-0015__kafka-ug-180604018_b20657171612138">ScramLoginModule</strong> required \
|
|
username="**********" \
|
|
password="**********";
|
|
sasl.mechanism=<strong id="kafka-ug-0015__kafka-ug-180604018_b15657121620131">SCRAM-SHA-512</strong>
|
|
# If the SASL mechanism is PLAIN, configure as follows:
|
|
sasl.jaas.config=org.apache.kafka.common.security.<strong id="kafka-ug-0015__kafka-ug-180604018_b0657101619133">plain.PlainLoginModule</strong> required \
|
|
username="**********" \
|
|
password="**********";
|
|
sasl.mechanism=<strong id="kafka-ug-0015__kafka-ug-180604018_b1665720164136">PLAIN</strong></pre>
|
|
<p id="kafka-ug-0015__p346462202711">Parameter description:</p>
|
|
<ul id="kafka-ug-0015__ul2355135542711"><li id="kafka-ug-0015__kafka-ug-180604018_li9578173610155"><strong id="kafka-ug-0015__kafka-ug-180604018_b15940166202617">ssl.truststore.location</strong>: path for storing the <strong id="kafka-ug-0015__kafka-ug-180604018_b1994056112615">client.jks</strong> certificate. Even in Windows, you need to use slashes (/) for the certificate path. Do not use backslashes (\), which are used by default for paths in Windows. Otherwise, the client will fail to obtain the certificate.</li><li id="kafka-ug-0015__kafka-ug-180604018_li4578153611159"><strong id="kafka-ug-0015__kafka-ug-180604018_b02112214397">ssl.truststore.password</strong>: server certificate password, which must be set to <strong id="kafka-ug-0015__kafka-ug-180604018_b3211521103916">dms@kafka</strong> and cannot be changed.</li><li id="kafka-ug-0015__kafka-ug-180604018_li2057818362154"><strong id="kafka-ug-0015__kafka-ug-180604018_b163656567392">ssl.endpoint.identification.algorithm</strong>: whether to verify the certificate domain name. <strong id="kafka-ug-0015__kafka-ug-180604018_b4285516104010">This parameter must be left blank, which indicates disabling domain name verification</strong>.</li><li id="kafka-ug-0015__kafka-ug-180604018_li194571669169"><strong id="kafka-ug-0015__kafka-ug-180604018_b16925191015415">username</strong> and <strong id="kafka-ug-0015__kafka-ug-180604018_b17925141034110">password</strong>: username and password you set when enabling ciphertext access for the first time or when creating a user.</li></ul>
|
|
</li></ul>
|
|
</div>
|
|
</li><li id="kafka-ug-0015__li85951698326">Run the following command in the <strong id="kafka-ug-0015__b5188648122814">/bin</strong> directory of the Kafka client:<pre class="screen" id="kafka-ug-0015__screen115959912326">./kafka-consumer-groups.sh --bootstrap-server ${connection-address} --group ${group-name} --members --describe --command-config ../config/ssl-user-config.properties </pre>
|
|
<p id="kafka-ug-0015__p1912814541468">Parameter description:</p>
|
|
<ul id="kafka-ug-0015__ul1312885454618"><li id="kafka-ug-0015__li1312895494616"><strong id="kafka-ug-0015__b1504050626104515">connection-address</strong>: can be obtained from the <strong id="kafka-ug-0015__b1223230487104515">Connection</strong> area on the <strong id="kafka-ug-0015__b929205341104515">Basic Information</strong> page on the Kafka console.</li><li id="kafka-ug-0015__li12128115416465"><strong id="kafka-ug-0015__b24601142121714">group-name</strong>: consumer group name.</li></ul>
|
|
<p id="kafka-ug-0015__p1323264474">Example:</p>
|
|
<pre class="screen" id="kafka-ug-0015__screen6183615144718">[root@ecs-kafka bin]# ./kafka-consumer-groups.sh --bootstrap-server 192.168.xx.xx:9093,192.168.xx.xx:9093,192.168.xx.xx:9093 --group test --members --describe --command-config ../config/ssl-user-config.properties
|
|
|
|
GROUP CONSUMER-ID HOST CLIENT-ID #PARTITIONS
|
|
test console-consumer-566d0c82-07d3-4d87-9a6e-f57a9bc9fc69 /192.168.0.215 console-consumer 3
|
|
[root@ecs-kafka bin]#</pre>
|
|
</li></ol>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="kafka-ug-0015__section48018524714"><h4 class="sectiontitle">Viewing Consumer Connection Addresses (Console)</h4><ol id="kafka-ug-0015__ol3215151213171"><li id="kafka-ug-0015__li10427115412419"><span>Log in to the console.</span></li><li id="kafka-ug-0015__li14905725134512"><span>Click <span><img id="kafka-ug-0015__image1681706343" src="en-us_image_0143929918.png"></span> in the upper left corner to select a region.</span><p><div class="note" id="kafka-ug-0015__note596412409275"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kafka-ug-0015__p11964174020277">Select the region where your Kafka instance is located.</p>
|
|
</div></div>
|
|
</p></li><li id="kafka-ug-0015__li189561034172215"><span>Click <strong id="kafka-ug-0015__b31645067995717">Service List</strong> and choose <strong id="kafka-ug-0015__b27421515195717">Application</strong> > <strong id="kafka-ug-0015__b70178647495717">Distributed Message Service</strong>. The Kafka instance list is displayed.</span></li><li id="kafka-ug-0015__li13248719142014"><span>Click the desired Kafka instance to view the instance details.</span></li><li id="kafka-ug-0015__li1063043712019"><span>In the navigation pane, choose <strong id="kafka-ug-0015__b1011962162714">Consumer Groups</strong>.</span></li><li id="kafka-ug-0015__li578915528416"><span>Click the desired consumer group.</span></li><li id="kafka-ug-0015__li14266184912490"><span>On the <strong id="kafka-ug-0015__b39381724172718">Consumers</strong> tab page, view the consumer addresses.</span></li></ol>
|
|
</div>
|
|
</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>
|
|
|