天天看點

canal報錯show master status‘ has an error!

記一次dbus-canal線上日志報錯解決

dbus表檢查資料線,發現

dbus

資料線不通,資料線顯示程序停止

到canal去找日志,解壓最後一個日志檔案

gzip -d 1.log.gz

2021-01-10 23:58:32.964 [destination = evoicedc , address = /dbus-mysql:3306 , EventParser] ERROR com.alibaba.ot
ter.canal.common.alarm.LogAlarmHandler - destination:evoicedc[com.alibaba.otter.canal.parse.exception.CanalParseEx
ception: command : 'show master status' has an error!
Caused by: java.io.IOException: ErrorPacket [errorNumber=1227, fieldCount=-1, message=Access denied; you need (at
least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation, sqlState=42000, sqlStateMarker=#]
with command: show master status
at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.query(MysqlQueryExecutor.java:61)
           

看起來是權限問題,dba

忘記授權給

canal

使用者

--- 授權給Canal使用者
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'canal'@'%';
FLUSH PRIVILEGES;
           

參考:https://github.com/alibaba/canal/issues/1319