postgres

debezium/postgres Docker Image

自动构建

用于Debezium变更数据捕获的PostgreSQL,基于postgres:11-alpine构建,包含postgres-decoderbufs和wal2json逻辑解码插件,支持将数据库变更捕获为事件流并记录到Kafka主题。

29 次收藏下载次数: 0状态:自动构建维护者:debezium仓库类型:镜像最近更新:
下载命令
点击查看

This repository has been relocated to https://quay.io/repository/debezium/postgres.

The https://www.postgresql.org relational database management system has a feature called https://www.postgresql.org/docs/11/static/logicaldecoding-explanation.html that allows clients to extract all persistent changes to a database's tables into a coherent, easy to understand format which can be interpreted without detailed knowledge of the database's internal state. An output plugin transform the data from the write-ahead log's internal representation into the format the consumer of a replication slot desires.

This image is based upon https://hub.docker.com/_/postgres/ and adds two logical decoding plug-ins:

  • https://github.com/debezium/, based on Protocol Buffers and maintained by the Debezium community
  • https://github.com/eulerto/wal2json, based on JSON and maintained by the wal2json community

Both are supported by the Debezium PostgreSQL Connector to capture changes committed to the database and record the data change events in Kafka topics. In addition, Debezium supports the pgoutput plug-in, which is available by default on Postgres 10 and later.

This provides an example of how the Debezium output plugin can be installed and how to enable PostgreSQL's logical decoding feature.

What is Debezium?

Debezium is a distributed platform that turns your existing databases into event streams, so applications can quickly react to each row-level change in the databases. Debezium is built on top of Kafka and provides Kafka Connect compatible connectors that monitor specific database management systems. Debezium records the history of data changes in Kafka logs, so your application can be stopped and restarted at any time and can easily consume all of the events it missed while it was not running, ensuring that all events are processed correctly and completely.

Running Debezium involves Zookeeper, Kafka, and services that run Debezium's connectors. For simple evaluation and experimentation, all services can all be run on a single host machine, using the recipe outlined below. Production environments, however, require properly running and networking multiple instances of each service to provide the performance, reliability, replication, and fault tolerance. This can be done with a platform like OpenShift that manages multiple Docker containers running on multiple hosts and machines. But running Kafka in a Docker container has limitations, so for scenarios where very high throughput is required, you should run Kafka on dedicated hardware as explained in the http://kafka.apache.org/documentation.html.

How to use this image

This image is used in the same manner as the https://hub.docker.com/_/postgres/ image, though the /usr/share/postgresql/postgresql.conf.sample file configures the logical decoding feature:

# LOGGING
log_min_error_statement = fatal

# CONNECTION
listen_addresses = '*'

# MODULES
shared_preload_libraries = 'decoderbufs'

# REPLICATION
wal_level = logical             # minimal, archive, hot_standby, or logical (change requires restart)
max_wal_senders = 1             # max number of walsender processes (change requires restart)
#wal_keep_segments = 4          # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s       # in milliseconds; 0 disables
max_replication_slots = 1       # max number of replication slots (change requires restart)

This file instructs PostgreSQL to load https://github.com/debezium/postgres-decoderbufs, enable the logical decoding feature, and configure a single replication slot that will be used by the Debezium PostgreSQL Connector.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 postgres 镜像标签

docker pull docker.xuanyuan.run/debezium/postgres:<标签>

DockerHub 原生拉取命令

docker pull debezium/postgres:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告