pika新版binlog標(biāo)記時(shí)間戳,因此開發(fā)了新舊binlog轉(zhuǎn)換及新binlog轉(zhuǎn)換到可讀binlog的轉(zhuǎn)換工具
工具目錄:
pika/tools/binlog_tools/binlog_parser
使用參數(shù):
- -h -- 顯示幫助
- -c --轉(zhuǎn)換方式:new2old old2new new2read
- -i -- 輸入的binlog 默認(rèn): ./old_log/write2file0
- -o -- 輸出binlog的路徑,默認(rèn) : ./new_log/
樣例:
. /binlog_parser -c old2new -i ./old_log/write2file0,write2file1,write2file2 -o ./new_log/
注意:
- 程序檢查輸入的binlog是否是連續(xù)的,因此請(qǐng)輸入連續(xù)的binlog名
- 程序檢測(cè)binlog名字是否是write2file開頭的,路徑后是否跟隨write2file等,否則都會(huì)打印相應(yīng)錯(cuò)誤
- 由于manifest文件更新不一定及時(shí),相應(yīng)offset未更新入manifest的binlog數(shù)據(jù)在轉(zhuǎn)換工程中會(huì)丟失
性能指標(biāo):
經(jīng)測(cè)算,新舊binlog轉(zhuǎn)換時(shí)間,100m文件轉(zhuǎn)換時(shí)間為秒級(jí),1到10秒不等。新binlog到可讀binlog的轉(zhuǎn)換到10秒到20秒不等。
更多建議: