一 通过docker-compose 快速搭建
安装 canal-admin
- zoo.cfg 配置文件
dataDir=/data
dataLogDir=/datalog
tickTime=2000
initLimit=5
syncLimit=2
autopurge.snapRetainCount=3
autopurge.purgeInterval=0
maxClientCnxns=60
standaloneEnabled=true
admin.enableServer=true
server.1=zk1:2888:3888;2181
- docker-compose.yml配置文件
version: "3.1"
services:
canal-admin:
image: "canal/canal-admin:v1.1.5"
privileged: true
restart: always
container_name: canal-admin
environment:
- TZ=Asia/Shanghai
- server.port=8089
- canal.adminUser=admin
- canal.adminPasswd=123456
ports:
- "8089:8089"
安装 zookeeper
- docker-compose.yml 配置文件
version: '3'
services:
zk1:
image: zookeeper:3.6
restart: always
container_name: zk1
hostname: zk1
# 给docker容器给超级权限,访问宿主机目录
privileged: true
ports:
- 2181:2181
- 2888:2888
- 3888:3888
environment:
# 当前zk实例的id
ZOO_MY_ID: 1
# 整个zk集群的机器端口列表(2181:对client端提供服务的端口,3888:选举leader使用,2888:集群内机器通讯使用(Leader监听此端口))
volumes:
- '/docker/zookeeper/data:/data'
- '/docker/zookeeper/datalog:/datalog'
- '/docker/zookeeper/conf:/conf'
canal-server-1 部署
docker-composer.yml
version: "3.1"
services:
canal:
image: "canal/canal-server:v1.1.5"
privileged: true
restart: always
container_name: canal
environment:
- TZ=Asia/Shanghai
- canal.register.ip=192.168.2.150
- canal.admin.manager=192.168.2.150:8089
- canal.admin.port=11110
- canal.admin.user=admin
# 密码 canal-admin 配置的密码 SELECT PASSWORD({canal.adminPasswd}) 获取
- canal.admin.passwd=6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
- canal.admin.register.name=node1
- canal.admin.register.auto=true
- canal.admin.register.cluster=zoo
volumes:
- '/docker/canal/logs:/home/admin/canal-server/logs'
ports:
- "11111:11111"
- "11110:11110"
- "11112:11112"
- "9100:9100"
canal-server-2 部署
docker-composer.yml
version: "3.1"
services:
canal:
image: "canal/canal-server:v1.1.5"
privileged: true
restart: always
container_name: canal
environment:
- TZ=Asia/Shanghai
- canal.register.ip=192.168.2.151
- canal.admin.manager=192.168.2.151:8089
- canal.admin.port=11110
- canal.admin.user=admin
# 密码 canal-admin 配置的密码 SELECT PASSWORD({canal.adminPasswd}) 获取
- canal.admin.passwd=6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
- canal.admin.register.name=node1
- canal.admin.register.auto=true
- canal.admin.register.cluster=zoo
volumes:
- '/docker/canal/logs:/home/admin/canal-server/logs'
ports:
- "11111:11111"
- "11110:11110"
- "11112:11112"
- "9100:9100"
标签:canal,admin,register,server,集群,docker,true
From: https://www.cnblogs.com/coolr/p/17016635.html