Skip to main content
gauravj1391
Silver ⭐️⭐️⭐️
May 8, 2017 5:28 PM UTC
Solved

Connecting Apache NiFi Clusters Using Remote Process Groups

I am working with nifi cluster. As in tutorial it is suggestion to use remote process group with cluster for load balancing.

But to use Remote process group, we have to provide url of other nifi instance which is hardcoded. So what will happen if that nifi instance goes down in between of workflow execution. Is remote process call is working in that situation as load balancing concept is implemented in Remote process call.

MattWho
MattWhoAnswer
Titanium ⭐️⭐️
May 8, 2017 7:22 PM UTC
@Gaurav Jain

The URL provided when adding the Remote Process Group (RPG) to your canvas must be successful only when initially added. Once a successful connection is established the target instance will return a list of currently connected cluster nodes. The source instance with the RPG will record those hosts in peer files. From that point forward the RPG constantly updates the list of available nodes and will not only load-balance to those nodes but will also use anyone of them to get an updated status. Lets assume your source instance of NiFi has trouble getting a status update from any of the nodes, it will still attempt to load-balance with failover delivery of data to the last known set of nodes until communication is successful in getting an updated list.

In addition, NiFi will also allow you to specify multiple URLs in the RPG when you create it. Simply provide a comma separated list of URLS for the nodes in the same target cluster. This does not change how the RPG works. It will still constantly retrieve a new listing of available nodes. This allows the target cluster to scale up or down without affecting your Site-To-Site (S2S) functionality.

Thanks,

Matt

11 replies

MattWho
Titanium ⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️
May 8, 2017 7:22 PM UTC
@Gaurav Jain

The URL provided when adding the Remote Process Group (RPG) to your canvas must be successful only when initially added. Once a successful connection is established the target instance will return a list of currently connected cluster nodes. The source instance with the RPG will record those hosts in peer files. From that point forward the RPG constantly updates the list of available nodes and will not only load-balance to those nodes but will also use anyone of them to get an updated status. Lets assume your source instance of NiFi has trouble getting a status update from any of the nodes, it will still attempt to load-balance with failover delivery of data to the last known set of nodes until communication is successful in getting an updated list.

In addition, NiFi will also allow you to specify multiple URLs in the RPG when you create it. Simply provide a comma separated list of URLS for the nodes in the same target cluster. This does not change how the RPG works. It will still constantly retrieve a new listing of available nodes. This allows the target cluster to scale up or down without affecting your Site-To-Site (S2S) functionality.

Thanks,

Matt

Translate
MattWho
Titanium ⭐️⭐️
Titanium ⭐️⭐️
May 8, 2017 10:08 PM UTC

@Gaurav Jain

Each node in a cluster is responsible for working on its own FlowFiles. Each node is unaware of what FlowFiles other nodes are working on. If a NiFi processor component is working on a FlowFile at the time the Node goes down, the transformation work will start over once that the node is running again. A node disconnecting will not cause processing of FlowFiles to stop on the disconnected node.

Processors that do transformation of FlowFile content will produce a new FlowFile once the transformation is complete. So if failure exists mid processing, the original remains on the incoming queue to the processor and the intermediate work is lost. This is how NiFi ensures no data loss occurs in unexpected failures.

That being said Data plane High Availability (HA) is one of NiFi's roadmap items.

Thanks,

Matt

Translate
gauravj1391
Silver ⭐️⭐️⭐️
May 11, 2017 5:52 PM UTC

flow.pngThanks Matt,

All above steps are helpful for me to setup cluster.

I attach my workflow. Workflow is configured so that GetSFTP is executed on primary node and after that there is Remote process group.

By GetSFTP all file contents are put on primary node local content repository.

So when flow reaches to remote process group,it will distribute flowfiles to nodes connected in cluster.

As each node read contents from their local content repository, so in case of RPG , Is contents are again written over nodes local contents repository? If so, then suppose a case where GetSFTP gets multiple file having 2tb total size and write all contents in primary node content repo. After that RPG distribute flowfiles among different nodes, and again it will write contents in their respective repo. So this will be overhead of space as well as time.

Translate
gauravj1391
Silver ⭐️⭐️⭐️
May 8, 2017 9:59 PM UTC

This means that, if one node is performing some transformation to flowfile, and in between it if that node goes down, then its overall functionality is transferred to another node.

Translate