mysql+zookper+canal环境下修改position的方法

修改canal position步骤:
步骤一:查看mysql binlog日志,确定要开始的position,参考命令如下
	查看有哪些binlog文件:show binary logs;
	查看具体的binlog文件:show binlog events in "mysql-bin.000897"; 
	查看正在运行的binlog文件:show master status;
步骤二:访问canal server服务器,停掉该服务
cd /u02/tomcat/canal/bin      
./stop.sh
步骤三:访问对应的zookper destination
查看position情况:get /otter/canal/destinations/deatinationName/1001/cursor
修改position:set /otter/canal/destinations/deatinationName/1001/cursor  {"@type":"com.alibaba.otter.canal.protocol.position.LogPosition","identity":{"slaveId":-1,"sourceAddress":{"address":"xx.xx.xx.xx","port":xxxx}},"postion":{"included":false,"journalName":"mysql-bin.000906","position":141201179,"serverId":1,"timestamp":1571019574000}}
cZxid = 0x15247db
ctime = Sat Oct 12 18:05:00 CST 2019
mZxid = 0x1552676
mtime = Mon Oct 14 10:19:35 CST 2019
pZxid = 0x15247db
cversion = 0
dataVersion = 97
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 268
numChildren = 0
步骤四:重启canal server
cd /u02/tomcat/canal/bin      
./startup.sh

你可能感兴趣的:(canal)