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>
46 lines
7.9 KiB
HTML
46 lines
7.9 KiB
HTML
<a name="kafka-faq-0604001"></a><a name="kafka-faq-0604001"></a>
|
|
|
|
<h1 class="topictitle1">Troubleshooting Kafka Connection Exceptions</h1>
|
|
<div id="body1591252420426"><div class="section" id="kafka-faq-0604001__section61272278356"><h4 class="sectiontitle">Overview</h4><p id="kafka-faq-0604001__p174371833143520">This section describes how to troubleshoot Kafka connection problems.</p>
|
|
</div>
|
|
<div class="section" id="kafka-faq-0604001__section13333257123718"><h4 class="sectiontitle">Problem Classification</h4><p id="kafka-faq-0604001__p960415389">If the connection to a Kafka instance is abnormal, perform the following operations to troubleshoot the fault:</p>
|
|
<ul id="kafka-faq-0604001__ul18773193845410"><li id="kafka-faq-0604001__li1177333895420"><a href="#kafka-faq-0604001__section74671936425">Checking the Network</a></li><li id="kafka-faq-0604001__li1773113895412"><a href="#kafka-faq-0604001__section165211131204818">Checking Consumer and Producer Configurations</a></li><li id="kafka-faq-0604001__li57738381541"><a href="#kafka-faq-0604001__section45927511503">Common Errors on Java Clients</a></li><li id="kafka-faq-0604001__li1977313387546"><a href="#kafka-faq-0604001__section105071026185013">Common Errors on the Go Client</a></li></ul>
|
|
</div>
|
|
<div class="section" id="kafka-faq-0604001__section74671936425"><a name="kafka-faq-0604001__section74671936425"></a><a name="section74671936425"></a><h4 class="sectiontitle">Checking the Network</h4><p id="kafka-faq-0604001__p5849193916388">Before connecting to a Kafka instance, ensure that the client and the instance are interconnected. If they cannot be connected, check the network connection.</p>
|
|
<p id="kafka-faq-0604001__p3569121216429">For example, if you have enabled SASL_SSL to access the Kafka instance, run the following command:</p>
|
|
<p id="kafka-faq-0604001__p184641919154318"><strong id="kafka-faq-0604001__b1483112229432">curl -kv {ip}:{port}</strong></p>
|
|
<ul id="kafka-faq-0604001__ul156690547475"><li id="kafka-faq-0604001__li19669754134713">If the network is normal, information similar to the following is shown:<p id="kafka-faq-0604001__p9310149123418"><a name="kafka-faq-0604001__li19669754134713"></a><a name="li19669754134713"></a><span><img id="kafka-faq-0604001__image831064911344" src="en-us_image_0272312053.png"></span></p>
|
|
</li><li id="kafka-faq-0604001__li11192135911473">If the network is abnormal or disconnected, information similar to the following is shown:<p id="kafka-faq-0604001__p16874232164314"><a name="kafka-faq-0604001__li11192135911473"></a><a name="li11192135911473"></a><span><img id="kafka-faq-0604001__image13301139144110" src="en-us_image_0252483830.png"></span></p>
|
|
</li></ul>
|
|
<div class="p" id="kafka-faq-0604001__p13429116185316"><strong id="kafka-faq-0604001__b184119578214">Solution:</strong><ol id="kafka-faq-0604001__ol93585320451"><li id="kafka-faq-0604001__li20358932154514">Check whether the client and the Kafka instance are in the same VPC. If they are not in the same VPC, refer to <a href="kafka-faq-200426019.html">Do Kafka Instances Support Cross-VPC Access?</a></li><li id="kafka-faq-0604001__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__section165211131204818"><a name="kafka-faq-0604001__section165211131204818"></a><a name="section165211131204818"></a><h4 class="sectiontitle">Checking Consumer and Producer Configurations</h4><p id="kafka-faq-0604001__p1969764224912">View logs to check whether the parameters printed during the initialization of the consumer and producer are the same as those set in the configuration files.</p>
|
|
<p id="kafka-faq-0604001__p269713421490">If they are different, check the parameters in the configuration file.</p>
|
|
</div>
|
|
<div class="section" id="kafka-faq-0604001__section45927511503"><a name="kafka-faq-0604001__section45927511503"></a><a name="section45927511503"></a><h4 class="sectiontitle">Common Errors on Java Clients</h4><ul id="kafka-faq-0604001__ul74454350487"><li id="kafka-faq-0604001__li3445135124813"><strong id="kafka-faq-0604001__b10525221197">Domain name verification enabled</strong><p id="kafka-faq-0604001__p1275524944818">The following error is displayed:</p>
|
|
<p id="kafka-faq-0604001__p78751655124818"><span><img id="kafka-faq-0604001__image553110064917" src="en-us_image_0252462263.png"></span></p>
|
|
<p id="kafka-faq-0604001__p1574775613455"><strong id="kafka-faq-0604001__b970172118469">Solution</strong>: Check the <strong id="kafka-faq-0604001__b174783254467">consumer.properties</strong> and <strong id="kafka-faq-0604001__b155611928164612">producer.properties</strong> files, in which the <strong id="kafka-faq-0604001__b1419194734619">ssl.endpoint.identification.algorithm</strong> parameter must be left empty, indicating that domain name verification is disabled.</p>
|
|
<pre class="screen" id="kafka-faq-0604001__screen1432130184612">ssl.endpoint.identification.algorithm=</pre>
|
|
</li><li id="kafka-faq-0604001__li1419744618528"><strong id="kafka-faq-0604001__b14892153316914">SSL certificate failing to be loaded</strong><p id="kafka-faq-0604001__p1560411299564">The following error is displayed:</p>
|
|
<p id="kafka-faq-0604001__p31621528175612"><span><img id="kafka-faq-0604001__image1216222818562" src="en-us_image_0252462634.png"></span></p>
|
|
<p id="kafka-faq-0604001__p1610222020471"><strong id="kafka-faq-0604001__b737713457471">Solution:</strong></p>
|
|
<ol id="kafka-faq-0604001__ol143987254479"><li id="kafka-faq-0604001__li33986257471">Check whether the <strong id="kafka-faq-0604001__b127415311539">client.</strong><strong id="kafka-faq-0604001__b07433125312">truststore.</strong><strong id="kafka-faq-0604001__b77413118531">jks</strong> file exists in the corresponding address.</li><li id="kafka-faq-0604001__li163991250477">Check the permissions on the processes and files.</li><li id="kafka-faq-0604001__li5394553154819">Check whether the <strong id="kafka-faq-0604001__b14808203515484">ssl.truststore.password</strong> parameter in the <strong id="kafka-faq-0604001__b396753811488">consumer.properties</strong> and <strong id="kafka-faq-0604001__b1178894110480">producer.properties</strong> files is correctly set.<div class="p" id="kafka-faq-0604001__p346495604818"><strong id="kafka-faq-0604001__b1428272653104358">ssl.truststore.password</strong> is the server certificate password, which must be set to <strong id="kafka-faq-0604001__b1567022603104358">dms@kafka</strong> and cannot be changed.<pre class="screen" id="kafka-faq-0604001__screen1929216139484">ssl.truststore.password=dms@kafka </pre>
|
|
</div>
|
|
</li></ol>
|
|
</li><li id="kafka-faq-0604001__li4280443195317"><strong id="kafka-faq-0604001__b4524949899">Incorrect topic name</strong><p id="kafka-faq-0604001__p299317428562">The following error is displayed:</p>
|
|
<p id="kafka-faq-0604001__p12348144135615"><span><img id="kafka-faq-0604001__image1734884105611" src="en-us_image_0252462689.png"></span></p>
|
|
<p id="kafka-faq-0604001__p1934815415562"><strong id="kafka-faq-0604001__b16969428164911">Solution</strong>: Create another topic or enable the automatic topic creation function.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="kafka-faq-0604001__section105071026185013"><a name="kafka-faq-0604001__section105071026185013"></a><a name="section105071026185013"></a><h4 class="sectiontitle">Common Errors on the Go Client</h4><p id="kafka-faq-0604001__p1669142562211">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__b777165845019">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-faq-191030001.html">Connections</a></div>
|
|
</div>
|
|
</div>
|
|
|