gpt4 book ai didi

docker - 使用纯文本时,kafka-connect SSL错误

转载 作者:行者123 更新时间:2023-12-02 18:21:18 24 4
gpt4 key购买 nike

我正在关注本教程:https://docs.confluent.io/4.0.0/installation/docker/docs/tutorials/connect-avro-jdbc.html

并将我的代码放在这里:https://github.com/lexsteens/kafka-connect-tutorial

我在注册JDBC连接器时遇到问题:它被注册,但是在http://localhost:28083/connectors/quickstart-jdbc-source/status中查看其状态时,我得到了状态FAILED和以下堆栈跟踪:

org.apache.kafka.connect.errors.DataException: quickstart-jdbc-test
at io.confluent.connect.avro.AvroConverter.fromConnectData(AvroConverter.java:77)
at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:220)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:187)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)
at java.util.concurrent.Executors.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.kafka.common.errors.SerializationException: Error serializing Avro message
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:161)
at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:218)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:307)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:299)
at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:294)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:61)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:100)
at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:79)
at io.confluent.connect.avro.AvroConverter.serialize(AvroConverter.java:110)
at io.confluent.connect.avro.AvroConverter.fromConnectData(AvroConverter.java:75)
at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:220)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:187)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)
at java.util.concurrent.Executors.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

但是,我没有要求SSL加密(请参阅 docker-compose ...)。

我试图用Google搜索这个问题或在这里找到它,但是没有成功。

最佳答案

对于初学者,请从您的Compose文件中完全删除localhost。我很惊讶服务会正常启动。查看Networking in Compose,了解不需要设置hostname属性,您可以仅使用“服务名称”链接服务。例如,kafka将连接到zookeeper:32181而不是localhost,而您的Connector JSON应该连接到mysql:3306地址,而不是localhost:3306等。

您可以查看我的compose file for reference,它部分取自Confluent's Docker Compose

到目前为止,虽然我仅使用S3 Connect进行过测试,但是您的问题出在AvroConverter上,该代码已在所有这些项目中共享,并且我可以验证它是否确实可以将Avro消息写入S3。

特别是关于错误,它们与Schema Registry有关,并且您的Connect服务具有HTTPS地址,但看起来不像您为该容器设置了SSL

顺便说一句,我的建议是至少尝试4.1.2图像而不是4.0.0以获得最新的补丁程序。如果不是,则最新为5.0.0

关于docker - 使用纯文本时,kafka-connect SSL错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51902900/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com