一:在linux環境下安裝部署好mysql
開啟binlog
Vim /etc/my.cnf
mysql的binlog格式有3種,為了把binlog解析成json資料格式,要設定binlog的格式為row(binlog有三種格式:Statement、Row以及Mixed)

3重新開機msyql服務
service mysqld restart
檢視是否已經開啟binlog
檢視是否已經開啟binlog 是否改為row模式
/var/lib/mysql下看到生成了相應的binlog監聽日志檔案,如圖,master.000001檔案,每次重新開機msyql服務,就會生成一個新的監聽檔案
配置Maxwell相關的部署工作
1下載下傳Maxwell
官網
http://maxwells-daemon.io/
安裝 tar –zxvf maxwell-1.14.4.tar.gz
建立Maxwell的db和使用者
create database maxwell;
GRANT ALL on maxwell.* to 'maxwell'@'%' identified by '123456’;
GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE on *.* to 'maxwell'@'%';
flush privileges;
3.5測試STDOUT:
bin/maxwell --user='maxwell' \
--password='123456' --host='127.0.0.1' \
--producer=stdout
測試:
Mysql插入資料:
insert into demo(id,name,age,address) values(999,'jepson',18,'www.ruozedata.com');
maxwel
監控到資料