如何在Linux上安装Canal同步工具
1. 下载安装包
所用到的安装包
canal.admin-1.1.4.tar.gz
链接:https://pan.baidu.com/s/1B1LxZUZsKVaHvoSx6VV3sA
提取码:v7ta
canal.deployer-1.1.4.tar.gz
链接:https://pan.baidu.com/s/13RSqPinzgaaYQUyo9D8ZCQ
提取码:v7ta
2. 解压安装
# 这里安装到/usr/local目录下
cd /usr/local
mkdir -p /usr/local/canal
tar -xzvf canal.deployer-1.1.4.tar.gz -C /usr/local/canal/
mkdir -p /usr/local/canal-admin
tar -xvf canal.admin-1.1.4.tar.gz -C /usr/local/canal-admin
3. 初始化管理数据库
导入初始化数据脚本:
mysql -uroot -p123456 < /usr/local/canal-admin/conf/canal_manager.sql
4. 修改MySQL服务同步配置
vi /etc/my.cnf
[mysqld]
log-bin=mysql-bin # 开启 binlog
binlog-format=ROW # 选择 ROW 模式
server_id=1 # MySQL ID服务标识
service mysqld restart
mysql> FLUSH PRIVILEGES;
mysql> CREATE USER canal IDENTIFIED BY 'canal';
mysql> GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'canal'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
5. 修改后台管理配置文件
vi /usr/local/canal-admin/conf/application.yml
/usr/local/canal-admin/bin/startup.sh
6. Canal服务配置
vi /usr/local/canal/conf/canal_local.properties
/usr/local/canal/bin/startup.sh local
原文地址:https://blog.csdn.net/qq_46248151/article/details/143983652
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!