目录
- 1. 组件说明
- 2. 下载解压
- 3. 初始化元数据库canal_manager
- 4. canal.admin-1.1.5/conf/application.yml
- 5. canal.deployer-1.1.5/conf/canal.properties
- 6. 启动
Canal Admin提供一种更方便的管理canal.deploy、instance的操作
1. 组件说明
组件 | 版本 | 服务器 | 安装教程 | 作用 |
---|---|---|---|---|
canal | 1.1.5 | canal1, canal2, canal3 | canal HA安装 + mysql多节点自动切换 | 为Canal Admin提供运维接口 |
zookeeper | 3.6.3 | canal1, canal2, canal3 | zookeeper全分布式安装 | |
mysql | 8.0.25 | canal1, canal2 | mysql master-master架构搭建 | canal.deploy源数据库 |
mysql | 8.0.25 | canal3 | centos7安装mysql8.0.25版本 | Client Admin的配置储存数据库 |
2. 下载解压
[root@canal1 ~]#
[root@canal1 ~]# wget https://github.com/alibaba/canal/releases/download/canal-1.1.5/canal.admin-1.1.5.tar.gz
[root@canal1 ~]#
[root@canal1 ~]# mkdir canal.admin-1.1.5
[root@canal1 ~]#
[root@canal1 ~]# tar -zxvf canal.admin-1.1.5.tar.gz -C canal.admin-1.1.5
[root@canal1 ~]#
3. 初始化元数据库canal_manager
[root@canal1 ~]#
[root@canal1 ~]# mysql -h canal3 -P 3306 -u root -pRoot_123 -e "source /root/canal.admin-1.1.5/conf/canal_manager.sql"
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@canal1 ~]#
4. canal.admin-1.1.5/conf/application.yml
[root@canal1 ~]#
[root@canal1 ~]# cat canal.admin-1.1.5/conf/application.yml
server:
port: 8089
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
spring.datasource:
address: canal3:3306
database: canal_manager
username: root
password: Root_123
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://${spring.datasource.address}/${spring.datasource.database}?useUnicode=true&characterEncoding=UTF-8&useSSL=false
hikari:
maximum-pool-size: 30
minimum-idle: 1
canal:
adminUser: admin
adminPasswd: admin123
[root@canal1 ~]#
5. canal.deployer-1.1.5/conf/canal.properties
在3台服务器进行操作,修改部分为:
canal.admin.manager = canal1:8089
canal.admin.user = admin
canal.admin.passwd = admin123
canal.admin.register.auto = true
canal.admin.register.cluster =
然后重启canal.deployer
6. 启动
[root@canal1 ~]#
[root@canal1 ~]# canal.admin-1.1.5/bin/restart.sh
[root@canal1 ~]#
查看logs如下:
[root@canal1 ~]#
......省略部分......
2021-07-30 03:43:04.404 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8089 (http) with context path ''
2021-07-30 03:43:04.408 [main] INFO com.alibaba.otter.canal.admin.CanalAdminApplication - Started CanalAdminApplication in 8.066 seconds (JVM running for 9.103)
[root@canal1 ~]#
通过http://canal1:8089进行登录,密码用户名为:admin / 123456, 密码不是application.yml设置的admin123