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
|