SpringBoot整合canal-2.安装canal

创建docker网络

#创建canal网络
docker network create canal-test

#查询创建的网络信息
docker network ls

#查询当前网络的信息
docker network inspect canal-test

拉取canal镜像并启动

docker pull canal/canal-server

docker-启动命令

docker run -p 11111:11111 --name canal \
    -e canal.destinations=test \
    -e canal.instance.master.address=mysql:3306  \
    -e canal.instance.dbUsername=canal  \
    -e canal.instance.dbPassword=Canal@123456  \
    -e canal.instance.connectionCharset=UTF-8 \
    -e canal.instance.tsdb.enable=true \
    -e canal.instance.gtidon=false  \
    -e canal.instance.filter.regex=patrol_robot_dev..*
    --network canal-test \
    --restart=always \
    -d canal/canal-server

docker-compose启动脚本

version: '3.2'
services: 
 canal:
    networks:
      basic_net:
    ports:
      - "11111:11111"
    depends_on:
      mysql:
        condition: service_healthy
    image: canal/canal-server:latest
    container_name: basic-canal
    restart: always
    privileged: true
    environment:
      - TZ=Asi
上一篇:如何查询SQL Server数据库服务器的IP地址