Installing NiFi Cluster on Windows Server

Step 1: Update hosts file entry with below 

127.0.0.1 node1
127.0.0.1 node2
127.0.0.1 node3

Step 2: Update zookeeper.properties File on all the 3 instances

server.1=node1:2888:3888;2181
server.2=node2:2889:3889;2182
server.3=node3:2890:3890;2183

Step 3: Create myid File

Create ./state/zookeeper/myid file on all the 3 instances

Step 4: Update content of myid file


Update the value of myid file to 1 on instance 1, 2 on instance 2 and 3 on instance 3

Step 5: Update nifi.properties file

On all 3 nodes:

nifi.state.management.embedded.zookeeper.start=true
nifi.zookeeper.connect.string=node1:2181,node2:2182,node3:2183

On node1


nifi.cluster.is.node=true
nifi.cluster.node.address=node1
nifi.cluster.node.protocol.port=9991
nifi.cluster.node.load.balance.port=6342
nifi.remote.input.host=node1
nifi.remote.input.secure=false
nifi.remote.input.socket.port=10001
nifi.web.http.host=node1

On node2

nifi.cluster.is.node=true
nifi.cluster.node.address=node2
nifi.cluster.node.protocol.port=9992
nifi.cluster.node.load.balance.port=6343
nifi.remote.input.host=node2
nifi.remote.input.secure=false
nifi.remote.input.socket.port=10002
nifi.web.http.host=node2

On node3

nifi.cluster.is.node=true
nifi.cluster.node.address=node3
nifi.cluster.node.protocol.port=9993
nifi.cluster.node.load.balance.port=6344
nifi.remote.input.host=node3
nifi.remote.input.secure=false
nifi.remote.input.socket.port=10003
nifi.web.http.host=node3

Read more about zookeeper here.

The following table lists the default ports used by NiFi and the corresponding property in the nifi.properties file.

FunctionPropertyDefault Value
HTTP Portnifi.web.http.port8080
HTTPS Port*nifi.web.https.port9443
Remote Input Socket Port*nifi.remote.input.socket.port10443
Cluster Node Protocol Port*nifi.cluster.node.protocol.port11443
Cluster Node Load Balancing Portnifi.cluster.node.load.balance.port6342
Web HTTP Forwarding Portnifi.web.http.port.forwardingnone

Read More about nifi.properties here

Cluster Icon showing 3 out of 3 nodes connected
Notice the new option called “cluster” in global menu.
NiFi Cluster Summary

Sample logs from logs/nifi-app.log
This is the typical logs you will see while nifi cluster startup is running.




2020-05-15 13:49:32,526 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:49:31,511 and sent to node3:9993 at 2020-05-15 13:49:32,526; send took 1014 millis
2020-05-15 13:49:38,542 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:49:37,528 and sent to node3:9993 at 2020-05-15 13:49:38,542; send took 1014 millis
2020-05-15 13:49:44,559 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:49:43,544 and sent to node3:9993 at 2020-05-15 13:49:44,559; send took 1015 millis
2020-05-15 13:49:50,576 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:49:49,561 and sent to node3:9993 at 2020-05-15 13:49:50,576; send took 1014 millis
2020-05-15 13:49:56,591 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:49:55,578 and sent to node3:9993 at 2020-05-15 13:49:56,590; send took 1013 millis
2020-05-15 13:50:02,608 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:01,593 and sent to node3:9993 at 2020-05-15 13:50:02,608; send took 1014 millis
2020-05-15 13:50:08,624 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:07,609 and sent to node3:9993 at 2020-05-15 13:50:08,624; send took 1014 millis
2020-05-15 13:50:14,638 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:13,626 and sent to node3:9993 at 2020-05-15 13:50:14,638; send took 1012 millis
2020-05-15 13:50:20,655 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:19,639 and sent to node3:9993 at 2020-05-15 13:50:20,655; send took 1015 millis
2020-05-15 13:50:26,669 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:25,657 and sent to node3:9993 at 2020-05-15 13:50:26,669; send took 1012 millis
2020-05-15 13:50:32,687 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:31,671 and sent to node3:9993 at 2020-05-15 13:50:32,687; send took 1016 millis
2020-05-15 13:50:38,700 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:37,689 and sent to node3:9993 at 2020-05-15 13:50:38,700; send took 1011 millis
2020-05-15 13:50:38,902 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@311eb725 checkpointed with 2 Records and 0 Swap Files in 282 milliseconds (Stop-the-world time = 85 milliseconds, Clear Edit Logs time = 147 millis), max Transaction ID 6
2020-05-15 13:50:44,718 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:43,701 and sent to node3:9993 at 2020-05-15 13:50:44,718; send took 1016 millis
2020-05-15 13:50:50,737 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:49,719 and sent to node3:9993 at 2020-05-15 13:50:50,737; send took 1017 millis
2020-05-15 13:50:56,755 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:50:55,738 and sent to node3:9993 at 2020-05-15 13:50:56,755; send took 1016 millis
2020-05-15 13:51:02,771 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:51:01,757 and sent to node3:9993 at 2020-05-15 13:51:02,771; send took 1015 millis
2020-05-15 13:51:08,786 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:51:07,774 and sent to node3:9993 at 2020-05-15 13:51:08,786; send took 1012 millis
2020-05-15 13:51:14,799 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:51:13,788 and sent to node3:9993 at 2020-05-15 13:51:14,799; send took 1010 millis
2020-05-15 13:51:20,876 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:51:19,801 and sent to node3:9993 at 2020-05-15 13:51:20,876; send took 1075 millis
2020-05-15 13:51:26,898 INFO [Clustering Tasks Thread-3] o.a.n.c.c.ClusterProtocolHeartbeater Heartbeat created at 2020-05-15 13:51:25,877 and sent to node3:9993 at 2020-05-15 13:51:26,898; send took 1020 millis
2020-05-15 13:51:27,443 INFO [Process Cluster Protocol Request-5] o.a.n.c.c.node.NodeClusterCoordinator Status of node1:8080 changed from NodeConnectionStatus[nodeId=node1:8080, state=CONNECTED, updateId=27] to NodeConnectionStatus[nodeId=node1:8080, state=DISCONNECTED, Disconnect Code=User Disconnected Node, Disconnect Reason=User anonymous requested that node be disconnected from cluster, updateId=31]
2020-05-15 13:51:27,451 INFO [Process Cluster Protocol Request-5] o.a.n.c.p.impl.SocketProtocolListener Finished processing request 5672c1d7-ac99-4347-a697-2055f1332e44 (type=NODE_STATUS_CHANGE, length=1226 bytes) from 127.0.0.1 in 25 millis
2020-05-15 13:51:28,449 INFO [Process Cluster Protocol Request-10] o.a.n.c.p.impl.SocketProtocolListener Finished processing request 9ded0276-46ec-4556-b571-fb928979e8b9 (type=DISCONNECTION_REQUEST, length=647 bytes) from node1:8080 in 15 millis
2020-05-15 13:51:28,449 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Received disconnection request message from cluster coordinator with explanation: User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:28,449 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Disconnecting node due to User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:28,497 INFO [Disconnect from Cluster] o.apache.nifi.controller.FlowController Cluster State changed from Clustered to Not Clustered
2020-05-15 13:51:28,504 INFO [Disconnect from Cluster] o.a.n.c.l.e.CuratorLeaderElectionManager This node is no longer registered to be elected as the Leader for Role 'Primary Node'
2020-05-15 13:51:28,504 INFO [Disconnect from Cluster] o.a.n.c.l.e.CuratorLeaderElectionManager This node is no longer registered to be elected as the Leader for Role 'Cluster Coordinator'
2020-05-15 13:51:28,505 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Node disconnected due to User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:29,497 INFO [Process Cluster Protocol Request-9] o.a.n.c.p.impl.SocketProtocolListener Finished processing request 17bb8cff-22b6-4f1e-a894-65971c4f9ba5 (type=DISCONNECTION_REQUEST, length=647 bytes) from node1:8080 in 8 millis
2020-05-15 13:51:29,498 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Received disconnection request message from cluster coordinator with explanation: User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:29,500 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Disconnecting node due to User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:29,501 INFO [Disconnect from Cluster] o.a.n.c.l.e.CuratorLeaderElectionManager Cannot unregister Leader Election Role 'Primary Node' becuase that role is not registered
2020-05-15 13:51:29,501 INFO [Disconnect from Cluster] o.a.n.c.l.e.CuratorLeaderElectionManager Cannot unregister Leader Election Role 'Cluster Coordinator' becuase that role is not registered
2020-05-15 13:51:29,501 INFO [Disconnect from Cluster] o.a.nifi.controller.StandardFlowService Node disconnected due to User anonymous requested that node be disconnected from cluster
2020-05-15 13:51:31,164 INFO [pool-15-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2020-05-15 13:51:31,164 INFO [pool-15-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2020-05-15 13:52:39,229 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@311eb725 checkpointed with 2 Records and 0 Swap Files in 324 milliseconds (Stop-the-world time = 123 milliseconds, Clear Edit Logs time = 151 millis), max Transaction ID 6
2020-05-15 13:53:31,165 INFO [pool-15-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2020-05-15 13:53:31,165 INFO [pool-15-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2020-05-15 13:54:39,520 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@311eb725 checkpointed with 2 Records and 0 Swap Files in 290 milliseconds (Stop-the-world time = 64 milliseconds, Clear Edit Logs time = 182 millis), max Transaction ID 6
2020-05-15 13:54:52,216 INFO [Process Cluster Protocol Request-8] o.a.n.c.c.node.NodeClusterCoordinator Status of node1:8080 changed from NodeConnectionStatus[nodeId=node1:8080, state=DISCONNECTED, Disconnect Code=User Disconnected Node, Disconnect Reason=User anonymous requested that node be disconnected from cluster, updateId=31] to NodeConnectionStatus[nodeId=node1:8080, state=CONNECTING, updateId=33]
2020-05-15 13:54:52,216 INFO [Process Cluster Protocol Request-8] o.a.n.c.p.impl.SocketProtocolListener Finished processing request 42dcc606-3a7b-4aa7-b528-514928bc1702 (type=NODE_STATUS_CHANGE, length=1154 bytes) from 127.0.0.1 in 7 millis
2020-05-15 13:54:53,692 INFO [Reconnect to Cluster] o.a.nifi.controller.StandardFlowService Processing reconnection request from cluster coordinator.
2020-05-15 13:54:53,693 INFO [Process Cluster Protocol Request-2] o.a.n.c.p.impl.SocketProtocolListener Finished processing request 4aaff87d-067a-4aac-b257-9b6496f7ffe2 (type=RECONNECTION_REQUEST, length=2739806 bytes) from node1:8080 in 68 millis
2020-05-15 13:54:53,694 INFO [Reconnect to Cluster] o.a.n.c.c.node.NodeClusterCoordinator Resetting cluster node statuses from {1a907492-bda5-4ca4-abad-cb45597ad4c0=NodeConnectionStatus[nodeId=node1:8080, state=CONNECTING, updateId=33], 47e4ea7f-1ae1-4d8f-a0bc-d569f2c4237f=NodeConnectionStatus[nodeId=node3:8082, state=CONNECTED, updateId=28], 71a5a9c0-3966-4611-99f8-d4238a1aa023=NodeConnectionStatus[nodeId=node2:8084, state=CONNECTED, updateId=31]} to {node2:8084=NodeConnectionStatus[nodeId=node2:8084, state=CONNECTED, updateId=31], node1:8080=NodeConnectionStatus[nodeId=node1:8080, state=CONNECTING, updateId=33], node3:8082=NodeConnectionStatus[nodeId=node3:8082, state=CONNECTED, updateId=28]}

Leave a Comment