Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
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>
2022-12-09 14:55:21 +00:00

23 lines
3.9 KiB
HTML

<a name="mrs_01_1767"></a><a name="mrs_01_1767"></a>
<h1 class="topictitle1">Using the Kafka Client</h1>
<div id="body1595906785612"><div class="section" id="mrs_01_1767__sc56932df916a4d24859352da76142ea0"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1767__p14611115486">This section guides users to use a Kafka client in an O&amp;M or service scenario.</p>
<p id="mrs_01_1767__p153114292618">This section applies to MRS 3.<em id="mrs_01_1767__i204324229015">x</em> or later clusters.</p>
</div>
<div class="section" id="mrs_01_1767__s79bb1c7b423c4060865a9b4d95db5e75"><h4 class="sectiontitle">Prerequisites</h4><ul id="mrs_01_1767__u8d981bff995b440bb3ca4cb2c8ba71e4"><li id="mrs_01_1767__l5bccbfc9af3b4643bd8aac6a2ba50381">The client has been installed. For example, the installation directory is <strong id="mrs_01_1767__b99027781941142">/opt/client</strong>.</li><li id="mrs_01_1767__la8a352e20c414015a0e60f8023ecc0a5">Service component users are created by the administrator as required. Machine-machine users need to download the keytab file. A human-machine user must change the password upon the first login. (Not involved in normal mode)</li><li id="mrs_01_1767__l47578df816ad459594b25a9dea076617">After changing the domain name of a cluster, redownload the client to ensure that the <strong id="mrs_01_1767__b20445586175">kerberos.domain.name</strong> value in the configuration file of the client is set to the correct server domain name.</li></ul>
</div>
<div class="section" id="mrs_01_1767__s955d8af9dd264d11aeb7e52f541081bc"><h4 class="sectiontitle">Procedure</h4><ol id="mrs_01_1767__o88060f2769064662a63412566d17b012"><li id="mrs_01_1767__lac0304168b134dbf966709a6ce549e7d"><span>Log in to the node where the client is installed as the client installation user.</span></li><li id="mrs_01_1767__l9c0d2dbdcb7d41eab895a9f75b9a02b2"><span>Run the following command to go to the client installation directory:</span><p><p id="mrs_01_1767__a96ae52efde9642948f638441a036c79a"><strong id="mrs_01_1767__a50193f1676c741a5ae432c55250667d6">cd /opt/client</strong></p>
</p></li><li id="mrs_01_1767__l02709ddfb0a744f9ab239374e40a3e8b"><span>Run the following command to configure environment variables:</span><p><p id="mrs_01_1767__a7060369a3f304b7890e4afb33f3e22ee"><strong id="mrs_01_1767__addfe02b6a608430294a07fc537cc9c53">source bigdata_env</strong></p>
</p></li><li id="mrs_01_1767__ldb284e6385c84600ad3f1461ac3c91af"><span>Run the following command to perform user authentication (skip this step in normal mode):</span><p><p id="mrs_01_1767__a7f6163ea7e9647adaa8162c5dac727dd"><strong id="mrs_01_1767__acc96b76dcb744fc489a0b59f1c273122">kinit</strong> <em id="mrs_01_1767__a5d872242846741a79417e03f22cdedde">Component service user</em></p>
</p></li><li id="mrs_01_1767__lc4b824efb2a1488aaa387a8cb3b251e2"><span>Run the following command to switch to the Kafka client installation directory:</span><p><p id="mrs_01_1767__aa1b5b3a5318649f08238cf3e2756f175"><strong id="mrs_01_1767__ad13b355a781d4b84926441a74ad8def1">cd Kafka/kafka/bin</strong></p>
</p></li><li id="mrs_01_1767__laabc28f593bf42bfae2cd3e8583285ad"><span>Run the following command to use the client tool to view and use the help information:</span><p><ul id="mrs_01_1767__ua03b7977dea04dbaba216860ca236179"><li id="mrs_01_1767__l696f63d4913a4f8d8e282792cea62d77"><strong id="mrs_01_1767__a6f2539c94d4e49f6a763bcd3e7846112">./kafka-console-consumer.sh</strong>: Kafka message reading tool</li><li id="mrs_01_1767__l0449cd76b3a2446691426f2e91566a53"><strong id="mrs_01_1767__a67a8866c515041df9cc02177c5087dc2">./kafka-console-producer.sh</strong>: Kafka message publishing tool</li><li id="mrs_01_1767__l03407800f3db4534bc8ce42d1915018d"><strong id="mrs_01_1767__a0a35a2b6f32f4e9991d6a5b9a4c9ccdd">./kafka-topics.sh</strong>: Kafka topic management tool</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>