【发布时间】:2021-09-02 22:47:35
【问题描述】:
我想使用 kafka connect 将多个表数据从 oracle 加载到 postgres
这是我正在使用的源配置:-
curl -i -X PUT http://localhost:8083/connectors/src_1/config \
-H "Content-Type: application/json" \
-d '{
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"connection.url":"jdbc:oracle:thin:@//localhost:1521/db",
"connection.user":"<user>",
"connection.password":"<psswd>",
"mode":"bulk",
"table.whitelist":"EMP,CUS",
"poll.interval.ms":7200000,
"quote.sql.identifiers":"never"
}'
通过上述配置,我可以创建两个名为“EMP”和“CUS”的主题。现在,我想将这些数据从主题加载到已在 postgres 中创建的各个表中。
这是我的接收器配置:-
curl -X PUT http://localhost:8083/connectors/tgt_1/config \
-H "Content-Type: application/json" \
-d '{
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"connection.url":"jdbc:postgresql://localhost:5432/postgres",
"connection.user":"<user>",
"connection.password":"<passwd>",
"tasks.max" : "1",
"topics":"CUS,EMP",
"insert.mode":"insert",
"quote.sql.identifiers":"never"
}'
使用上述配置,我遇到了一个错误,称为不匹配的表或自动创建被禁用。但是当我尝试创建单独的接收器连接器并使用表名设置属性table.name.format 时小写它工作正常。
所以,我尝试在table.whitelist 中以较小的大小写提供表名,以便以较小的大小写创建主题,并且可以与目标表名匹配。但是,源连接器既不抛出错误也不运行任务。
谁能为我的问题提供一个合适的解决方案。 谢谢!
【问题讨论】:
标签: apache-kafka apache-kafka-connect confluent-platform