docker-compose deployment Canal (directly click the docker-compose configuration file)

1 background

All services of the company's project are deployed using docker-compose, so this article was produced.

部署很简单,需要对 Canal 有一点点了解就OK,主要是 docker-compose 的配置文件

For the introduction and general installation of Canal, please read my other article: https://blog.csdn.net/qq_23845083/article/details/131834011

(话不多说,直接上配置内容)

2 configuration files

canal:
    image: canal/canal-server:v1.1.5
    container_name: canal
    ports:
    #canal默认端口号,一般不用改,除非端口冲突
      - 11111:11111
    environment:
      #设置从库id,随便设置,不与主库id相冲突即可
      - canal.instance.mysql.slaveId=222
      - canal.instance.master.address=192.168.1.207:23307
      # mysql 复制账号
      - canal.instance.dbUsername=root
      - canal.instance.dbPassword=dev@xhkj
      - canal.mq.topic=testTopic
      - canal.auto.scan=false
      # 此项 destinations 配置,在 java 代码里集成的时候会用到
      - canal.destinations=test
      #数据库名.表名
      - canal.instance.filter.regex=gh_bimops.*
    volumes:
      - /data/docker/jar/canal/conf/:/usr/local/dockercompose/canal/conf/
      - /data/docker/jar/canal/logs/:/usr/local/dockercompose/canal/logs/
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: "20m"

最后,顺带贴一下我服务器的配置截图:
insert image description here

3 Start Canal

docker-compose restart canal

The screenshot after startup is as follows:
insert image description here

Guess you like

Origin blog.csdn.net/qq_23845083/article/details/131851405