介绍
我有一个可以定期更新的mysql数据库。我想定期检查此mysql数据库是否有Nifi更改。
为此,CaptureChangeMySQL处理器似乎很完美。
但是,我无法使其工作。
我遵循了this tutorial,但是在从数据库中插入/删除行时,处理器没有捕获任何内容。
建立
MySQL配置
它有一个名为
test
的数据库,其中有一个device
表,其中包含2万多行。我的
my.cnf
文件中的/etc/mysql/
文件如下:#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
server_id = 1
log_bin = delta
binlog_format=row
binlog_do_db = source
Nifi CaptureChangeMySQL配置
Nifi CDC MapCache配置(分布式 map 缓存客户端服务)
Nifi分布式 map 缓存服务器配置
使用这种配置,我的CaptureChange处理器什么也不做(至少看不到任何东西)。我在做什么错而无法使用它?
最佳答案
在my.cnf
文件中,您已设置binlog_do_db = source
。binlog-do-db
使主数据库仅将指定数据库的语句写入其二进制日志中。在您的情况下,应将其设置为测试。
请参阅MySQL 5.7 binlog-do-db=db_name
关于mysql - 如何使用nifi CaptureChangeMySQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59394974/