我正在尝试使用以下配置创建Postgres接收器连接器:
{
"name": "postgres-kafka-connector",
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "10",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",
"topics": "test-topic",
"connection.url": "jdbc:postgresql:test-18172ff-postgres:5432/b1x",
"connection.user": "postgres",
"connection.password": "*************",
"auto.create": "true"
}
但是,当查看Kafka connect中的日志时,会看到以下内容:
org.apache.kafka.connect.errors.ConnectException:
org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP
重要说明:我正在尝试在Kubernetes上运行此Kafka设置。
知道为什么会这样吗?