假如我的配置是这样
canal.instance.master.address=ip:port canal.instance.master.journal.name= canal.instance.master.position= canal.instance.master.timestamp= canal.instance.master.gtid=
那么canal是从目标ip:port 获取最小的binlog pos开始同步吗. 还是从最新的位置呢?
也就是说canal是通过show binlog logs
show binary logs; +-----------------------------+------------+ | Log_name | File_size | +-----------------------------+------------+ | 0040273306-mysql-bin.002492 | 1073742339 | | 0040273306-mysql-bin.002493 | 1073742006 | | 0040273306-mysql-bin.002494 | 1073742056 | | 0040273306-mysql-bin.002495 | 1073767572 | | 0040273306-mysql-bin.002496 | 1073747118 |
找到最旧的位置, file=0040273306-mysql-bin.002492 pos=1 做为change master语句
还是说通过 show master status
fanboshi@192.168.4.27 16:32:24 [(none)]> show master status; +-----------------------------+------------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +-----------------------------+------------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ | 0040273306-mysql-bin.002682 | 1004220587 | | | 38f8425e-9182-5934-b32a-7e4317fe4a04:1-2687352400, 50bedb44-148f-ee18-6670-3c42d5878c6d:1-3102967082, a3a2c90e-328f-11e9-aece-20040fee8318:1-64510 | +-----------------------------+------------+--------------+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
file=0040273306-mysql-bin.002682, pos=1004220587 作为change master语句呢
原提问者GitHub用户Fanduzi
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。