canal-admin

dyrnq/canal-admin Docker Image

dyrnq

canal-admin part of https://github.com/alibaba/canal

下载次数: 0状态:社区镜像维护者:dyrnq仓库类型:镜像最近更新:

docker-canal

https://github.com/alibaba/canal is Alibaba's open source distributed database incremental subscription & consumption component. Based on long connections, it supports incremental data subscription and consumption, and also provides database incremental subscription and consumption based on the MySQL protocol.

  • canal-server is the canal server.
  • canal-admin is the canal management web ui.
  • canal-adapter is the canal client adapter.

This project builds the docker images of each component of cannel and sorts out the related usage.

These images have the following features:

  • base_image is eclipse-temurin(ubuntu noble).
  • build with jdk8, jdk11, jdk17, jdk21.
  • use gosu running that admin user which uid is 1000 and gid 1000.
  • follow the image building principle and one container only does one thing, the last run java with pid=1(minor ***ry on the original bin/startup.sh).
  • supported version >=1.1.4. see tags https://hub.docker.com/r/dyrnq/canal-server/tags.
  • Note that these images is not an official mirror.

canal-server

canal-server is the canal server.

MattersDescription
Image namehttps://hub.docker.com/r/dyrnq/canal-server/tags
Container entry point/docker-entrypoint.sh
working dir/home/admin/canal-server
working uid/gid1000/1000
working user/groupadmin/admin
startup.sh/home/admin/canal-server/bin/startup.sh
startup.sh githubhttps://github.com/alibaba/canal/blob/master/deployer/src/main/bin/startup.sh
conf/canal.propertiescanal running full configuration
conf/canal_local.propertiescanal running partial configuration ( work with canal-admin)
conf/example/instance.propertieshttps://github.com/alibaba/canal/blob/master/deployer/src/main/resources/example/instance.properties

canal-admin

canal-admin is the canal management web ui.

MattersDescription
Image namehttps://hub.docker.com/r/dyrnq/canal-admin/tags
Container entry point/docker-entrypoint.sh
working dir/home/admin/canal-admin
working uid/gid1000/1000
working user/groupadmin/admin
startup.sh/home/admin/canal-admin/bin/startup.sh
startup.sh githubhttps://github.com/alibaba/canal/blob/master/admin/admin-web/src/main/bin/startup.sh
sql filehttps://github.com/alibaba/canal/blob/master/docker/image/canal_manager.sql
web login default user/passwdadmin/***
canal.adminUser/canal.adminPasswdcanal.adminUser/canal.adminPasswd are canal-admin configuration.

canal.admin.user/canal.admin.passwd are canal-server configuration.

canal.admin.passwd need encryption see https://github.com/alibaba/canal/wiki/Canal-Admin-ServerGuide#面向userpasswd的安全acl机制.

canal.adminUser/canal.adminPasswd and canal.admin.user/canal.admin.passwd need to match.

e.g.

sql
--- 密文的生成方式,请登录mysql,执行如下密文生成sql即可(记得去掉第一个首字母的星号)

select password('admin')

+-------------------------------------------+
| password('admin')                         |
+-------------------------------------------+
| *4ACFE3202A5FF5CF467898FC58AAB1D615029441 |
+-------------------------------------------+

--- 如果遇到mysql8.0,可以使用select upper(sha1(unhex(sha1('admin'))))

canal-adapter

canal-adapter is the canal client adapter.

MattersDescription
Image namehttps://hub.docker.com/r/dyrnq/canal-adapter/tags
Container entry point/docker-entrypoint.sh
working dir/home/admin/canal-adapter
working uid/gid1000/1000
working user/groupadmin/admin
startup.sh/home/admin/canal-adapter/bin/startup.sh
startup.sh githubhttps://github.com/alibaba/canal/blob/master/client-adapter/launcher/src/main/bin/startup.sh

image volume mount

image namevolume mount
dyrnq/canal-server/home/admin/canal-server/{conf,logs,plugin}
dyrnq/canal-admin/home/admin/canal-admin/{conf,logs}
dyrnq/canal-adapter/home/admin/canal-adapter/{conf,logs,plugin}

Note that if the entire directory is mounted, the original files in the container will be overwritten. You can first copy the default files from the container and then mount them into the working container.

e.g.

bash
docker run -itd --rm --name canal-tmp --entrypoint "" dyrnq/canal-server:1.1.8-alpha-3-jdk21 bash -c "tail -f /dev/null"
docker cp canal-tmp:/home/admin/canal-server/conf $(pwd)
docker rm -f canal-tmp 2>/dev/null || true

HA

prerequisites:

  • zookeeper.
  • mysql.

canal.instance.tsdb.enable=true

HA must use mysql replace default h2 tsdb configuration.

  1. create mysql database canal_tsdb
  2. create table from https://github.com/alibaba/canal/blob/master/deployer/src/main/resources/spring/tsdb/sql/create_table.sql
  3. update use mysql tsdb
bash
canal.instance.tsdb.enable=true
canal.instance.tsdb.url=jdbc:mysql://<IP>:3306/canal_tsdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# canal.instance.tsdb.url=jdbc:mysql://<IP>:3306/canal_tsdb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
canal.instance.tsdb.dbUsername=canal
canal.instance.tsdb.dbPassword=canal
canal.instance.tsdb.spring.xml=classpath:spring/tsdb/mysql-tsdb.xml

canal.instance.global.spring.xml

HA must use zookeeper, canal.instance.global.spring.xml = classpath:spring/default-instance.xml is using zookeeper, but not configed as default.

bash
# canal.instance.global.spring.xml = classpath:spring/memory-instance.xml
# canal.instance.global.spring.xml = classpath:spring/file-instance.xml
canal.instance.global.spring.xml = classpath:spring/default-instance.xml

HA with canal-admin

  1. run canal-admin.
  2. login canal-admin with user/password.
  3. create cluster.
  4. config main config for the cluster which step 3 created.
  5. modify the main config which step 4 created. some key configs e.g. canal.zkServers = zoo1:2181,zoo2:2181,zoo3:2181 canal.serverMode = rocketMQ rocketmq.namesrv.addr = 192.168.88.123:9876
  6. add instance config and modify instance config. some key configs e.g. canal.instance.master.address=main-db5:3306 canal.instance.mysql.slaveId=
  7. run canal-server with local parameter. see https://github.com/alibaba/canal/wiki/Canal-Admin-ServerGuide#变化点

HA without canal-admin

  1. configs all canal.properties for all the canal-server. see https://github.com/alibaba/canal/blob/master/deployer/src/main/resources/canal.properties.
  2. keep the canal.properties configs same.
  3. config instance configs for all the canal-server.
  4. run canal-server.

k8s

In k8s, using a shared configmap(canal.properties) to configure each canal-server the same, it doesn't seem necessary deploy the canal-admin module(to be verified).

ref

  • https://github.com/alibaba/canal
  • https://hub.docker.com/u/canal

镜像拉取方式

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

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

docker pull docker.xuanyuan.run/dyrnq/canal-admin:<标签>

DockerHub 原生拉取命令

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