debezium-kafka connect

jpfvwuh4  于 2021-06-05  发布在  Kafka
关注(0)|答案(1)|浏览(576)

我们正试图建立一个 SQL-Server->Debezium->Kafka Connect->Kafka Pipeline sql server(mssql)中几个表的设置
启动安装程序时,出现以下错误:日志:

{
  "name": "mssql-server-uat",
  "connector": {
    "state": "RUNNING",
    "worker_id": "172.17.0.3:8083"
  },
  "tasks": [
    {
      "id": 0,
      "state": "FAILED",
      "worker_id": "172.17.0.3:8083",
      "trace": <separately given below>
    }
  ],
  "type": "source"
}

跟踪:

org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
    at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:42)
    at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.execute(SqlServerStreamingChangeEventSource.java:267)
    at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:101)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Connection timed out (Read failed)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2892)
    at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:2031)
    at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:6418)
    at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7579)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:590)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:522)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:444)
    at io.debezium.jdbc.JdbcConnection.prepareQueryAndMap(JdbcConnection.java:657)
    at io.debezium.connector.sqlserver.SqlServerConnection.timestampOfLsn(SqlServerConnection.java:210)
    at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.lambda$execute$1(SqlServerStreamingChangeEventSource.java:243)
    at io.debezium.jdbc.JdbcConnection.prepareQuery(JdbcConnection.java:525)
    at io.debezium.connector.sqlserver.SqlServerConnection.getChangesForTables(SqlServerConnection.java:172)
    at io.debezium.connector.sqlserver.SqlServerStreamingChangeEventSource.execute(SqlServerStreamingChangeEventSource.java:162)
    ... 6 more
Caused by: java.net.SocketException: Connection timed out (Read failed)
    at java.base/java.net.SocketInputStream.socketRead0(Native Method)
    at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
    at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
    at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:2023)
    ... 21 more

可能的原因是什么?因为sql server正常运行,这很奇怪
如有需要,对问题进行评论以获取任何特定信息
编辑:此错误不会一直阻止连接。启动时,连接工作,cdc事件流式传输到kafka,甚至由我们编写的kafka使用者读取,但突然超时,出现上述错误。

js4nwp54

js4nwp541#

kafka connect无法连接到sql server。

SQLServerException: Connection timed out

可能的原因有:
在连接器配置中指定了错误的主机名
您的网络不允许kafka connect连接到sql server(例如,如果您使用docker并且没有正确配置网络)
防火墙正在阻止到sql server的入站流量
编辑:
如果这个错误是间歇性的,那么这就意味着sql server本身可能正在超时,所以我要和您的DBA谈谈,让他们查看它正在运行的示例和机器,看看是否有迹象表明连接为什么会超时。

相关问题