canal安裝部署
基於日誌增量訂閱和消費的業務包括:
資料庫映象
資料庫實時備份
索引構建和實時維護(拆分異構索引、倒排索引等)
業務 cache 重新整理
帶業務邏輯的增量資料處理
當前的 canal 支援源端 MySQL 版本包括 5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x
一 實驗環境
二 實驗步驟
2.1 配置源端MariaDB
2.1.1 修改配置檔案
my.cnf 中配置如下:
[mysqld]
log-bin=mysql-bin
binlog-format=ROW
server_id=1
2.1.2 為canal建立專用賬號
CREATE USER CanalUser IDENTIFIED BY '密碼';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'CanalUser'@'192.168.144.242';
FLUSH PRIVILEGES;
2.2 下載安裝canal
2.2.1 下載
下載 canal, 訪問 release 頁面 , 選擇需要的包下載, 如以 1.1.4 版本為例:
開啟網頁後,往下拉,找到1.1.4:
再往下拉,展開Asserts:
cd /opt && mkdir canal && cd canal
將安裝包上傳到/opt/canal路徑下。
2.2.2 安裝jdk
可參考https://blog.csdn.net/yabingshi_tech/article/details/51498017
2.2.3 安裝canal
mkdir /usr/local/canal
tar zxvf canal.deployer-1.1.4.tar.gz -C /usr/local/canal
cd /usr/local/canal
[root@localhost canal]# ll
總用量 4
drwxr-xr-x. 2 root root 76 11月 5 13:28 bin
drwxr-xr-x. 5 root root 123 11月 5 13:28 conf
drwxr-xr-x. 2 root root 4096 11月 5 13:28 lib
drwxrwxrwx. 2 root root 6 9月 2 2019 logs
2.2.4 修改配置檔案
cd conf/example/
mv instance.properties instance.properties_bak_20201105
vi instance.properties
新增:
#不能與mysql的server_id重複
canal.instance.mysql.slaveId = 1234
#position info
canal.instance.master.address = 192.168.144.241:3306
canal.instance.master.journal.name =
canal.instance.master.position =
canal.instance.master.timestamp =
#canal.instance.standby.address =
#canal.instance.standby.journal.name =
#canal.instance.standby.position =
#canal.instance.standby.timestamp =
#username/password,需要改成自己的資料庫資訊
canal.instance.dbUsername = CanalUser
canal.instance.dbPassword = canal
canal.instance.defaultDatabaseName =
canal.instance.connectionCharset = UTF-8
#table regex
canal.instance.filter.regex = .\*\\\\..\*
2.3 啟動canal
2.3.1 啟動
sh /usr/local/canal/bin/startup.sh
#對應的關閉命令是:
sh /usr/local/canal/bin/stop.sh
2.3.2 檢查日誌是否有報錯
下面兩個日誌必須都是成功啟動的狀態:
#檢查server 日誌
vi /usr/local/canal/logs/canal/canal.log
2013-02-05 22:45:27.967 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## start the canal server.
2013-02-05 22:45:28.113 [main] INFO com.alibaba.otter.canal.deployer.CanalController - ## start the canal server[10.1.29.120:11111]
2013-02-05 22:45:28.210 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## the canal server is running now ......
#檢查instance 的日誌
vi /usr/local/canal/logs/example/example.log
2013-02-05 22:50:45.636 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [canal.properties]
2013-02-05 22:50:45.641 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [example/instance.properties]
2013-02-05 22:50:45.803 [main] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start CannalInstance for 1-example
2013-02-05 22:50:45.810 [main] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start successful....
--本篇文章主要參考自https://github.com/alibaba/canal/wiki/QuickStart
相關文章
- 阿里canal部署和應用阿里
- Canal高可用架構部署架構
- Linux安裝部署Linux
- ELK安裝部署
- chromedriver安裝部署Chrome
- SQOOP安裝部署OOP
- keepalived 安裝部署
- Hadoop安裝部署Hadoop
- Zabbix安裝部署
- Doris安裝部署
- mac環境canal+mysql+kafka的安裝及使用MacMySqlKafka
- canal+mysql+kafka實時資料同步安裝、配置MySqlKafka
- Centos7安裝安裝部署dockerCentOSDocker
- ElasticSearch + Kibana 安裝部署Elasticsearch
- hadoop的安裝部署Hadoop
- Jenkins安裝部署(一)Jenkins
- Saltstack基本安裝部署
- docke安裝與部署
- CDH - [02] 安裝部署
- gitlab - [02] 安裝部署Gitlab
- Tomcat 8安裝部署Tomcat
- DataX - [02] 安裝部署
- flume的安裝部署
- RocketMQ安裝及部署MQ
- python安裝部署(3.12)Python
- Hive(八)安裝部署Hive
- Apache Ranger安裝部署ApacheRanger
- openGauss Datakit安裝部署
- Hive 3.1.2安裝部署Hive
- Oozie--安裝部署
- minio client安裝部署client
- Zabbix監控安裝部署
- Nagios+PNP安裝部署iOS
- 【Invoke AI】安裝部署指南AI
- 本地安裝部署禪道
- zookeeper安裝部署步驟
- SkyWalking 安裝部署操作指引
- milvus-backup安裝部署