谷歌终于加入了对Cloudsql postgresql逻辑复制/解码支持。我正在尝试使用Debezium捕获数据库表上的更改,然后将更改发布为json到Gcp pubsub。我正在使用Debezium服务器和Gcp Pubsub Sink来验证连接是否正常工作,但不断收到以下错误消息:
从Cloudsql中,我已经打开了逻辑解码并将
那么我错过了什么?
org.postgresql.util.PSQLException: ERROR: could not access file "decoderbufs": No such file or directory
。因此,似乎它默认将插件设置为decoderbufs
,但是我确实在环境变量中设置了database.source.plugin.name
。根据这个文档https://hub.docker.com/r/debezium/server,我正在使用DATABASE_SOURCE_PLUGIN_NAME
。这是我的k8s清单的片段。 serviceAccountName: cloudsql-client
containers:
- name: debezium-standalone-server-dv
image: debezium/server:1.6
env:
- name: DEBEZIUM_SOURCE_CONNECTOR_CLASS
value: io.debezium.connector.postgresql.PostgresConnector
- name: DEBEZIUM_SOURCE_DATABASE_HOSTNAME
value: localhost
- name: DEBEZIUM_SOURCE_DATABASE_PORT
value: "5432"
- name: DEBEZIUM_SOURCE_DATABASE_USER
value: cdc
- name: DEBEZIUM_SOURCE_DATABASE_PASSWORD
value: cdc
- name: DEBEZIUM_SOURCE_DATABASE_DBNAME
value: postgres
- name: DEBEZIUM_SINK_TYPE
value: pubsub
- name: DEBEZIUM_SINK_PUBSUB_PROJECT_ID
value: myproject
- name: DEBEZIUM_SOURCE_OFFSET_STORAGE_FILE_FILENAME
value: data/offsets.dat
- name: DEBEZIUM_SOURCE_OFFSET_FLUSH_INTERVAL_MS
value: "0"
- name: DEBEZIUM_SOURCE_DATABASE_SERVER_NAME
value: CDC_POC
- name: DATABASE_SOURCE_PLUGIN_NAME
value: wal2json
从Cloudsql中,我已经打开了逻辑解码并将
REPLICATION
属性添加到用户中,我可以通过运行SELECT * FROM pg_create_logical_replication_slot('test_slot', 'wal2json');
来"手动"创建它。我也可以通过查询复制槽SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL);
来查看更改。那么我错过了什么?