update操作,对应的binlog如下:
connector.getWithoutAck(batchSize)只能获取到TRANSACTIONBEGIN和TRANSACTIONEND,如图
db的配置如下:
[mysqld]
pid-file= /var/run/mysqld/mysqld.pid
socket= /var/run/mysqld/mysqld.sock
datadir= /data/mysql
log-error= /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address= 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#自定义参数
explicit_defaults_for_timestamp
lower_case_table_names=1
max_connections = 2000
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
innodb_open_files=65535
max_connect_errors=3500
max_connections=3100
max_user_connections=3000
open_files_limit=65535
#connect_timeout=30
#interactive_timeout=200
#wait_timeout=200
log-bin=mysql-bin #添加这一行就ok
binlog-format=ROW #选择row模式
server_id=1 #配置mysql replaction需要定义,不能和canal的slaveId重复
#skip-name-resolve
innodb_log_file_size=1000M
innodb_buffer_pool_size=2g
innodb_log_buffer_size=10M
innodb_sync_array_size=16
thread_cache_size=256
max_binlog_size=500M
binlog_cache_size=1M
key_buffer_size=8M
#开启慢查询 slow_query_log值为1或on表示开启,为0或off为关闭
slow_query_log=on
#设置慢查询日志放在哪里
slow_query_log_file=mysql-slow
#设置sql执行时间多长为慢查询
long_query_time=2
#表示没有使用索引的sql查询也会记录下来
#log-queries-not-using-indexes
#支持emoji
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci