doc-exports/docs/dms/umn/kafka-faq-0604001.html
Chen, Junjie ca9677b121 DMS UMN 20230201 Version
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>
2024-07-22 13:20:04 +00:00

46 lines
9.6 KiB
HTML

<a name="kafka-faq-0604001"></a><a name="kafka-faq-0604001"></a>
<h1 class="topictitle1">Troubleshooting Kafka Connection Exceptions</h1>
<div id="body8662426"><div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section61272278356"><h4 class="sectiontitle">Overview</h4><p id="kafka-faq-0604001__en-us_topic_0251961792_p174371833143520">This section describes how to troubleshoot Kafka connection problems.</p>
</div>
<div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section13333257123718"><h4 class="sectiontitle">Problem Classification</h4><p id="kafka-faq-0604001__en-us_topic_0251961792_p960415389">If the connection to a Kafka instance is abnormal, perform the following operations to troubleshoot the problem:</p>
<ul id="kafka-faq-0604001__en-us_topic_0251961792_ul18773193845410"><li id="kafka-faq-0604001__en-us_topic_0251961792_li1177333895420"><a href="#kafka-faq-0604001__en-us_topic_0251961792_section74671936425">Checking the Network</a></li><li id="kafka-faq-0604001__en-us_topic_0251961792_li1773113895412"><a href="#kafka-faq-0604001__en-us_topic_0251961792_section165211131204818">Checking Consumer and Producer Configurations</a></li><li id="kafka-faq-0604001__en-us_topic_0251961792_li57738381541"><a href="#kafka-faq-0604001__en-us_topic_0251961792_section45927511503">Checking for Common Errors on Java Clients</a></li><li id="kafka-faq-0604001__en-us_topic_0251961792_li1977313387546"><a href="#kafka-faq-0604001__en-us_topic_0251961792_section105071026185013">Checking for Common Errors on the Go Client</a></li></ul>
</div>
<div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section74671936425"><a name="kafka-faq-0604001__en-us_topic_0251961792_section74671936425"></a><a name="en-us_topic_0251961792_section74671936425"></a><h4 class="sectiontitle">Checking the Network</h4><p id="kafka-faq-0604001__en-us_topic_0251961792_p5849193916388">Ensure that the client and the Kafka instance can be connected. If they cannot be connected, check the network.</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p3569121216429">For example, if you have enabled SASL for the Kafka instance, run the following command:</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p184641919154318"><strong id="kafka-faq-0604001__en-us_topic_0251961792_b1483112229432">curl -kv <em id="kafka-faq-0604001__i67692436418">{ip}</em>:<em id="kafka-faq-0604001__i0555547540">{port}</em></strong></p>
<ul id="kafka-faq-0604001__en-us_topic_0251961792_ul156690547475"><li id="kafka-faq-0604001__en-us_topic_0251961792_li19669754134713">If the network is normal, information similar to the following is displayed:<p id="kafka-faq-0604001__en-us_topic_0251961792_p9310149123418"><a name="kafka-faq-0604001__en-us_topic_0251961792_li19669754134713"></a><a name="en-us_topic_0251961792_li19669754134713"></a><span><img id="kafka-faq-0604001__en-us_topic_0251961792_image831064911344" src="en-us_image_0000001073725903.png"></span></p>
</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li11192135911473">If the network is abnormal or disconnected, information similar to the following is displayed:<p id="kafka-faq-0604001__en-us_topic_0251961792_p16874232164314"><a name="kafka-faq-0604001__en-us_topic_0251961792_li11192135911473"></a><a name="en-us_topic_0251961792_li11192135911473"></a><span><img id="kafka-faq-0604001__en-us_topic_0251961792_image13301139144110" src="en-us_image_0000001074272218.png"></span></p>
</li></ul>
<div class="p" id="kafka-faq-0604001__en-us_topic_0251961792_p13429116185316"><strong id="kafka-faq-0604001__b20503668292023">Solution:</strong><ol id="kafka-faq-0604001__en-us_topic_0251961792_ol93585320451"><li id="kafka-faq-0604001__en-us_topic_0251961792_li20358932154514">Check whether the client and the Kafka instance are in the same VPC. If no, <a href="kafka-faq-200426019.html">establish a VPC peering connection</a>.</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li7358103211457">Check whether the security group rules are correctly configured. For details, see <a href="kafka-faq-180604024.html">How Do I Select and Configure a Security Group?</a></li></ol>
</div>
</div>
<div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section165211131204818"><a name="kafka-faq-0604001__en-us_topic_0251961792_section165211131204818"></a><a name="en-us_topic_0251961792_section165211131204818"></a><h4 class="sectiontitle">Checking Consumer and Producer Configurations</h4><p id="kafka-faq-0604001__en-us_topic_0251961792_p1969764224912">View logs to check whether the parameters printed during initialization of the consumer and producer are the same as those set in the configuration files.</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p269713421490">If they are different, check the parameters in the configuration files.</p>
</div>
<div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section45927511503"><a name="kafka-faq-0604001__en-us_topic_0251961792_section45927511503"></a><a name="en-us_topic_0251961792_section45927511503"></a><h4 class="sectiontitle">Checking for Common Errors on Java Clients</h4><ul id="kafka-faq-0604001__en-us_topic_0251961792_ul74454350487"><li id="kafka-faq-0604001__en-us_topic_0251961792_li3445135124813">Error 1: Domain name verification is not disabled.<p id="kafka-faq-0604001__en-us_topic_0251961792_p1275524944818"><a name="kafka-faq-0604001__en-us_topic_0251961792_li3445135124813"></a><a name="en-us_topic_0251961792_li3445135124813"></a>The following error information is displayed:</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p78751655124818"><span><img id="kafka-faq-0604001__en-us_topic_0251961792_image553110064917" src="en-us_image_0000001074591800.png"></span></p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p1574775613455"><strong id="kafka-faq-0604001__b7355167592023">Solution</strong>: Leave the <strong id="kafka-faq-0604001__b12295262182023">ssl.endpoint.identification.algorithm</strong> parameter in the <strong id="kafka-faq-0604001__b13442186772023">consumer.properties</strong> and <strong id="kafka-faq-0604001__b10367950232023">producer.properties</strong> files empty to disable domain name verification.</p>
<pre class="screen" id="kafka-faq-0604001__en-us_topic_0251961792_screen1432130184612">ssl.endpoint.identification.algorithm=</pre>
</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li1419744618528">Error 2: SSL certificates fail to be loaded.<p id="kafka-faq-0604001__en-us_topic_0251961792_p1560411299564"><a name="kafka-faq-0604001__en-us_topic_0251961792_li1419744618528"></a><a name="en-us_topic_0251961792_li1419744618528"></a>The following error information is displayed:</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p31621528175612"><span><img id="kafka-faq-0604001__en-us_topic_0251961792_image1216222818562" src="en-us_image_0000001073623595.png"></span></p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p1610222020471"><strong id="kafka-faq-0604001__b19799749132023">Solution:</strong></p>
<ol id="kafka-faq-0604001__en-us_topic_0251961792_ol143987254479"><li id="kafka-faq-0604001__en-us_topic_0251961792_li33986257471">Check whether the <strong id="kafka-faq-0604001__b86321183478">client.jks</strong> file exists in the corresponding address.</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li163991250477">Check the permissions on the processes and files.</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li5394553154819">Check whether the <strong id="kafka-faq-0604001__b16497913052023">ssl.truststore.password</strong> parameter in the <strong id="kafka-faq-0604001__b7948035372023">consumer.properties</strong> and <strong id="kafka-faq-0604001__b16294370552023">producer.properties</strong> files is correctly set.<div class="p" id="kafka-faq-0604001__en-us_topic_0251961792_p346495604818"><strong id="kafka-faq-0604001__b11791432882023">ssl.truststore.password</strong> is the server certificate password, which must be set to <strong id="kafka-faq-0604001__b11147243212023">dms@kafka</strong> and cannot be changed.<pre class="screen" id="kafka-faq-0604001__en-us_topic_0251961792_screen1929216139484">ssl.truststore.password=dms@kafka </pre>
</div>
</li></ol>
</li><li id="kafka-faq-0604001__en-us_topic_0251961792_li4280443195317">Error 3: The topic name is incorrect.<p id="kafka-faq-0604001__en-us_topic_0251961792_p299317428562"><a name="kafka-faq-0604001__en-us_topic_0251961792_li4280443195317"></a><a name="en-us_topic_0251961792_li4280443195317"></a>The following error information is displayed:</p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p12348144135615"><span><img id="kafka-faq-0604001__en-us_topic_0251961792_image1734884105611" src="en-us_image_0000001073954006.png"></span></p>
<p id="kafka-faq-0604001__en-us_topic_0251961792_p1934815415562"><strong id="kafka-faq-0604001__b17132062262023">Solution</strong>: Create a new topic or enable the automatic topic creation function.</p>
</li></ul>
</div>
<div class="section" id="kafka-faq-0604001__en-us_topic_0251961792_section105071026185013"><a name="kafka-faq-0604001__en-us_topic_0251961792_section105071026185013"></a><a name="en-us_topic_0251961792_section105071026185013"></a><h4 class="sectiontitle">Checking for Common Errors on the Go Client</h4><p id="kafka-faq-0604001__p68931858151614">The Go client fails to connect to Kafka over SSL and the error "first record does not look like a TLS handshake" is returned.</p>
<p id="kafka-faq-0604001__p32031407128"><strong id="kafka-faq-0604001__b044772102313">Solution:</strong> Enable the TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 cipher suite (which is disabled by default).</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="kafka-ug-0723006.html">Troubleshooting</a></div>
</div>
</div>