当前位置:网站首页>Canal Chapter 5
Canal Chapter 5
2022-07-23 09:35:00 【Cynhard_ Cheung】
Canal Quick installation and deployment official website address :https://github.com/alibaba/canal/wiki/ClientExample0. Machine preparation Canal Server side :slave1MySQL Address :slave11. download canal Download address :https://github.com/alibaba/canal/releases/tag/canal-1.1.2 2. decompression mkdir /home/hadoop/app/canaltar zxvf canal.deployer-1.1.2.tar.gz -C /home/hadoop/app/canal After decompression , Get into /home/hadoop/app/canal Catalog , You can see the following structure 3. Modify the configuration file cd confcd example/vi instance.properties Modify the following items ## mysql serverId( Cannot be associated with mysql The configuration of the server_id identical )canal.instance.mysql.slaveId=1234# position info Need to change to your own database information canal.instance.master.address=slave1:3306# username/password Need to change to your own database information canal.instance.dbUsername=canalcanal.instance.dbPassword=canalcanal.instance.connectionCharset = UTF-8canal.instance.defaultDatabaseName =test The illustration : You can also configure filtered tables , Here is no filtering 4. Download the client code 1) Download address https://github.com/alibaba/canal/releases/tag/canal-1.1.22) Import the source code into IDEAsssIDEA—>Open Open the downloaded project source code 3) find canal Test code SimpleCanalClientTest.javacanal-1.1.2—>example—>SimpleCanalClientTest.java take ip It is amended as follows canal host ip 5. Permission to modify related files chmod -R 777 /tmp Change the temporary directory to " Anyone can read, write and execute "6. start-up canal service bin/startup.sh Observe canal journal tail -f canal.log If there is no error, it indicates that the startup is normal .example Take a look at : There are still errors : The illustration : Reset the password to canal 了 , And then in my.cnf The middle one should be removed
1. start-up canal The test program
8. Prepare database test data in slave1 Import into the database of the node stu.sql Table data , Then you can be right stu Insert table data 、 Delete or modify . 9. Observe IDEA The data operation of the console on the database table , You can print on the console binlog journal .
边栏推荐
猜你喜欢
随机推荐
复盘:一副牌(54张),三人斗地主,大小王在同一家的概率是多少
QML(17)——读写txt文件
Understand the box model, and the basic methods of box model's frame, internal and external margins, horizontal layout, vertical layout, setting floating, and dealing with height collapse
判断两个类型是否相同
I want to learn financial management in digging money. Is it safe to open an account?
肽核酸PNA规格信息|大豆过氧化酶标记肽核酸(Peptide nucleic acid,PNA)
从零开始的C
LeetCode 练习——关于二叉树的最近公共祖先两道题
FPGA出错的积累
真人踩过的坑,告诉你避免自动化测试常犯的10个错误
35岁程序员,早到的中年危机
How to learn MySQL efficiently and systematically?
MATLAB之优劣解距离法Topsis模型
肽核酸PNA-多肽suc-Ala-Ala-Pro-Aaa-pNa|Suc-Ala3-pNA|Pyr-Phe-Leu-pNA
使用递归字符串反转和全排列
QML (17) -- read and write txt files
Program environment and pretreatment
【HLS】流水线仿真之排队函数的调用
Transformer summary
xmpp 服务研究(一)








