【发布时间】:2019-06-01 21:07:29
【问题描述】:
我在 aws 上有 postgresql 数据库服务器。我在本地机器上设置了一个节点 kafka 集群,并想从 postgresql 数据库服务器中提取数据。我一直在使用 jdbc 源连接器,这里是配置(更改了实际值)
name=test-source-postgresql-jdbc-01
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
key.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://localhost:8081
connection.url=jdbc:postgresql://hostname:5432/dbname?
user=abc&password=pwd
connection.user=abc
connection.password=pwd
table.whitelist=abc1
mode=timestamp
timestamp.column.name=timestamp
topic.prefix=test-postgresql-
运行时出现以下错误
ERROR Failed to create job for etc/kafka-connect-jdbc/quickstart-postgresql.properties (org.apache.kafka.connect.cli.ConnectStandalone:102)
ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:113)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector
configuration is invalid and contains the following 2 error(s):
Invalid value org.postgresql.util.PSQLException: Connection to hostname:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. for configuration Couldn't open connection to jdbc:postgresql://abc:5432/dbname?user=abc&password=pwd
curl localhost:8083/connector-pluginsPlease click link
ls share/java/kafka-connect-jdbc -l Please click link
任何帮助将不胜感激!
【问题讨论】:
-
您需要进一步返回您的工作日志以查看关闭的原因是什么。这可能是由正在关闭的进程(SIGTERM、关闭控制台窗口等)触发的,或者是某些原因导致它中止。
-
这可能是 SSH 问题,因为我只使用 SSH 连接像 postico/pgAdmin/PSequel 这样的数据库客户端,但 kafka 不确定如何配置它。
-
你可以使用 GNU
screen来保持进程即使在断开连接时也能运行 -
我认为问题是我的连接器没有运行。我在问题部分添加了错误日志文件。请看一下。
-
我在您的问题中看不到错误日志,只有原始日志输出,其中仅显示 Kafka Connect 正在关闭。
标签: postgresql amazon-rds apache-kafka-connect confluent-platform