docker化canal与canal-adapter
今日公司需求,需要将mysql更新实时同步到kafka中,后来又要将数据库中的一张表的变化实时同步到另一台mysql中,于是乎canal与canal-adapter紧急解决,其中踩了不少坑,下面为总结内容 官方文档: https://github.com/alibaba/canal/wiki 一、canal镜像的创建及canal的compose文件 1、Dockerfile文件内容 FROM openjdk: 8 -jre- alpine ADD [ " canal.tar.gz " , " /opt/ " ] WORKDIR /opt/ canal EXPOSE 11110 11112 COPY [ " entrypoint.sh " , " / " ] VOLUME [ " /opt/canal/logs " , " /opt/canal/conf " ] ENTRYPOINT /entrypoint. sh View Code 2、entrypoint.sh文件内容 #!/bin/ sh Base_dir =/opt/canal/ conf Log_dir =/opt/canal/ logs if [ -n ${canal_instance_master_address} ]; then sed -i " /^canal.instance.master.address=