〇、參考資料
一、現(xiàn)象
1、Oracle源表數(shù)據(jù)
2、PG同步后的表數(shù)據(jù)
3、現(xiàn)象
時間不一致,差了8個小時
4、查看對應(yīng)的connector信息
(1)source
{
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"mode": "timestamp",
"timestamp.column.name": "UPDDATTIM_0",
"topic.prefix": "connector_topic_",
"connection.password": "system",
"connection.user": "system",
"db.timezone": "Asia/Shanghai",
"name": "source_connector_Test_TimeFormat_Order",
"connection.url": "jdbc:oracle:thin:@//192.168.0.2:1521/helowin",
"table.whitelist": "TEST.Test_TimeFormat_Order"
}
(2)sink文章來源:http://www.zghlxwxcb.cn/news/detail-506514.html
{
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"table.name.format": "wxf_test.Test_TimeFormat_Order",
"connection.password": "qaz123",
"tasks.max": "1",
"topics": "connector_topic_Test_TimeFormat_Order",
"delete.enabled": "false",
"auto.evolve": "true",
"connection.user": "postgres",
"name": "sink_connector_Test_TimeFormat_Order",
"auto.create": "true",
"connection.url": "jdbc:postgresql://ip:5432/bigdata",
"insert.mode": "upsert",
"pk.mode": "record_value",
"pk.fields": "Order_ID"
}
二、解決方式
1、方案
即sink和source都加文章來源地址http://www.zghlxwxcb.cn/news/detail-506514.html
?2、最終source
{
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"mode": "timestamp",
"timestamp.column.name": "UPDDATTIM_0",
"topic.prefix": "connector_topic_",
"connection.password": "system",
"connection.user": "system",
"db.timezone": "Asia/Shanghai",
"name": "source_connector_Test_TimeFormat_Order",
"connection.url": "jdbc:oracle:thin:@//192.168.0.2:1521/helowin",
"table.whitelist": "TEST.TEST_TIMEFORMAT_ORDER"
}
3、最終sink
{
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"table.name.format": "wxf_test.TEST_TIMEFORMAT_ORDER",
"connection.password": "qaz123",
"tasks.max": "1",
"topics": "connector_topic_TEST_TIMEFORMAT_ORDER",
"delete.enabled": "false",
"auto.evolve": "true",
"connection.user": "postgres",
"db.timezone": "Asia/Shanghai",
"name": "sink_connector_Test_TimeFormat_Order",
"auto.create": "true",
"connection.url": "jdbc:postgresql://192.168.0.2:5432/bigdata",
"insert.mode": "upsert",
"pk.mode": "record_value",
"pk.fields": "ORDER_ID"
}
到了這里,關(guān)于【kafka】JDBC connector進行表數(shù)據(jù)增量同步過程中的源表與目標(biāo)表時間不一致問題解決...的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!