天天看点

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