Search code examples
mysqlapache-nificdcmysqlbinlog

Unable to connect to the binlog client in NiFi


I'm building a NiFi dadaflow, and I need to get the data changes from a MySql database, so I want to use the CaptureChangeMySQL processor to do that.

I get the following error when I run the CaptureChangeMySQL processor and I don't see what's causing this :

Failed to process session due to Could not connect binlog client to any of the specified hosts due to: BinaryLogClient was unable to connect in 10000ms: org.apache.nifi.processor.exception.ProcessException: Could not connect binlog client to any of the specified hosts due to: BinaryLogClient was unable to connect in 10000ms

I have the following controller services enabled :

  • DistributedMapCacheClientService
  • DistributedMapCacheServer

But I'm not sure if they are properly configured :

DistributedMapCacheServer properties

DistributedMapCacheClientService properties

In MySql, I have enabled the log_bin variable, by default it wasn't. I checked and I have indeed some binlog files created when data change.

So I think the issue is with the controller services and how they connect, it's not clear to me.

I searched for tutorials about how to use this NiFi processor but I couldt not find how to fix this error. I looked mainly at this one : https://community.hortonworks.com/articles/113941/change-data-capture-cdc-with-apache-nifi-version-1-1.html but it did not helped me.

Does anyone have already use this processor to do CDC?

Thank you in advance.


Solution

  • I found what was wrong : I was trying to connect to the wrong port for the MySQL Host of the CaptureChangeMySQL processor :x