Kafka连接debezium postgres

mnemlml8  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(429)

我正在尝试使用debezium将amazonrds中托管的postgressqldb与kafka主题连接起来。
我遵循以下教程:
http://debezium.io/docs/tutorial/
我的kafka和kafka connect服务启动得很好,kafka connect服务还在/usr/share/java dir中接收我的debezium postgres连接器jar。
但是,在尝试使用以下curl命令通过kafka connect api附加postgres config json时:

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d @connector1.json

我最终得到以下错误:

[2018-06-13 23:45:44,749] ERROR Uncaught exception in REST call to /connectors/ (org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper:61)
org.apache.kafka.connect.errors.ConnectException: Could not intialize type registry
    at io.debezium.connector.postgresql.connection.PostgresConnection.<init>(PostgresConnection.java:68)
    at io.debezium.connector.postgresql.PostgresConnector.validate(PostgresConnector.java:95)
    at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:277)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder$6.call(DistributedHerder.java:534)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder$6.call(DistributedHerder.java:531)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:267)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:216)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
    at org.postgresql.Driver.makeConnection(Driver.java:431)
    at org.postgresql.Driver.connect(Driver.java:247)
    at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$1(JdbcConnection.java:161)
    at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:585)
    at io.debezium.connector.postgresql.connection.PostgresConnection.<init>(PostgresConnection.java:65)
    ... 11 more
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:144)
    ... 18 more

请您就这个例外和如何解决提出一些建议好吗?
这里是否有我可能丢失的属性/配置?

9rygscc1

9rygscc11#

您是否将postgres数据库端口配置为可以从外部访问?iirc rds数据库使用ssl进行连接,因此可能需要在postgres连接器中配置ssl。

相关问题