Giter VIP home page Giter VIP logo

go-cdc's Introduction

cdc-go

系统启动时需要的环境变量:

postgres_db 配置文件所在数据库地址
prometheus_address prometheus 暴露端口号

示例:

postgres_db=postgres://postgres:[email protected]/postgres
prometheus_address=:9527

需要的数据库表

cdc.monitor脚本如下:

CREATE SCHEMA IF NOT exists cdc;
DROP TABLE IF EXISTS cdc.monitor;
CREATE TABLE cdc.monitor
(
    id        serial primary key,
    body_type text,
    body      json
);

具体配置文件

{
  "identity_id": 1, 
  "listen": {
    "database_type": "postgres", // 数据库类型
    "conn": "postgres://postgres:[email protected]/postgres?replication=database", //数据库连接字符串
    "slot": {
      "slotName": "test_demo1", // postgres 复制槽名称
      "temporary": true, // 是否临时槽
      "plugin": "wal2json", // wal 解码插件
      "plugin_args": [] // 插件参数
    }
  },
  "monitors": [
    {
      "table": "test", // 监听表
      "schema": "test", //监听schema
      "fields": ["name"], //监听字段
      "behavior": "", // 监听行为,如果为空则监听INSERT UPDATE DELETE 操作
      "description": ""
    }
  ],
  "rabbit": {
    "conn": "amqp://admin:[email protected]:26174", // rabbitmq协议地址
    "queue": "cdc_mq_demo_one" // 队列名称
  }
}

go-cdc's People

Contributors

xiongxy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.