canal 索引建立

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 21:00   2710   0

cd /etc/mysql/mysql.conf.d

vim mysqld.cnf

#新增开启bin_log
server-id = 1
binlog_format = ROW
log_bin = mysql_bin

systemctl restart mysql

mysql -u root -p

123456

mysql>show variables like 'log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
+---------------+-------+
1 row in set (0.01 sec)

mysql> grant select,replication slave,replication client on *.* to 'canal'@'%' identified by 'canal';

mysql> grant select,replication slave,replication client on *.* to 'canal'@'localhost' identified by 'canal';

mysql> flush privileges;

下载tar包

https://github.com/alibaba/canal/releases/download/canal-1.1.3/canal.adapter-1.1.3.tar.gz

https://github.com/alibaba/canal/releases/download/canal-1.1.3/canal.deployer-1.1.3.tar.gz

mkdir canal.adapter

mkdir canal.deployer

分别解压进去

cd canal.deployer

cd conf

cd example

vim instance.properties

//修改这一行
canal.instance.mysql.slaveId=2

cd ..

cd ..

bin/startup.sh

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP