Support Questions

Find answers, ask questions, and share your expertise

Update or Migrate a NiFi Cluster

avatar
Explorer

Hello everyone, I have a NiFi cluster (1.12.1) with 3 secure nodes with SSL and 3 more external zookeeper nodes, I need to update this guy to version (1.17.0). I think about uploading a new environment with 1.17.0 and migrating the flow files? Would work?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@RRosa 

I am not clear on what you mean by "migrating the flow files"?  A NiFi FlowFile is the object that is traversed via connections between NiFi component processors on the NiFi canvas.   Are you talking about migrating your actively queued FlowFiles from NiFi cluster 1 (Apache NiFi 1.12.1) to NiFi cluster 2 (Apache NiFi 1.17.0)?    Or are you talking about migrating the flow.xml.gz file (contains everything you have configured on the canvas of yoru NiFi) from old cluster to new?

General guidance for upgrading Apache NiFi can be found in the admin guide here:
https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#upgrading_nifi

The only thing I see NOT covered in that guidance is the preservation of component state.  Within a cluster Component state may be stored depending on component in either a local state directory on each node (each node holds only state for that node) or stored in cluster state (written to ZK and shared across all nodes).  

Now if you are installing the new version of NiFi on the same hosts where the old NiFi nodes were running, simply preserve the state configuration and the new nodes when started with a copy of the flow.xml.gz will continue to read and use same state.  Same goes for new nodes using the same external ZK that the previous nodes used (stop old before starting new hosts).  

While the Documentation recommends that you process out all queued FlowFiles from cluster 1 before starting cluster 2 that is not required.  If new nodes point to same content, flowfile, and provenance repositories as previous node that data will get loaded back in on startup and processing continue where it left off.  Remember that each nodes repositories are unique to that node (meaning you can't combine them and they don't all contain the same content).

Another thing to review is the release notes. 
https://cwiki.apache.org/confluence/display/NIFI/Release+Notes
You'll want to review all the release notes between 1.12 and 1.17.  Apache NiFi is known to deprecate and remove some components (processors, controller services, reporting tasks, etc) from time to time.  You'll want to check to see if any components you use in your current dataflows are being removed.

Additional some components may have changed typically resulting in additional properties being added.  When you start with the newer version of NiFi, it will load your existing flow.xml.gz (1.17 will actually generate a flow.json.gz file from your flow.xml.gz) and upgrade all your components to use the newer 1.17 version of the component classes.  So you'll want to review you flow after upgrade to make sure none of your components that were previous valid have become invalid because new property exist that must be configured.

NOTE: 1.17 will use start using the flow.json.gz once upgrade, as the flow.xml.gz format is deprecated.

If you found this response assisted you with your query, please take a moment to login and click on "Accept as Solution" below this response.

Thank you,
Matt

 

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@RRosa 

I am not clear on what you mean by "migrating the flow files"?  A NiFi FlowFile is the object that is traversed via connections between NiFi component processors on the NiFi canvas.   Are you talking about migrating your actively queued FlowFiles from NiFi cluster 1 (Apache NiFi 1.12.1) to NiFi cluster 2 (Apache NiFi 1.17.0)?    Or are you talking about migrating the flow.xml.gz file (contains everything you have configured on the canvas of yoru NiFi) from old cluster to new?

General guidance for upgrading Apache NiFi can be found in the admin guide here:
https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#upgrading_nifi

The only thing I see NOT covered in that guidance is the preservation of component state.  Within a cluster Component state may be stored depending on component in either a local state directory on each node (each node holds only state for that node) or stored in cluster state (written to ZK and shared across all nodes).  

Now if you are installing the new version of NiFi on the same hosts where the old NiFi nodes were running, simply preserve the state configuration and the new nodes when started with a copy of the flow.xml.gz will continue to read and use same state.  Same goes for new nodes using the same external ZK that the previous nodes used (stop old before starting new hosts).  

While the Documentation recommends that you process out all queued FlowFiles from cluster 1 before starting cluster 2 that is not required.  If new nodes point to same content, flowfile, and provenance repositories as previous node that data will get loaded back in on startup and processing continue where it left off.  Remember that each nodes repositories are unique to that node (meaning you can't combine them and they don't all contain the same content).

Another thing to review is the release notes. 
https://cwiki.apache.org/confluence/display/NIFI/Release+Notes
You'll want to review all the release notes between 1.12 and 1.17.  Apache NiFi is known to deprecate and remove some components (processors, controller services, reporting tasks, etc) from time to time.  You'll want to check to see if any components you use in your current dataflows are being removed.

Additional some components may have changed typically resulting in additional properties being added.  When you start with the newer version of NiFi, it will load your existing flow.xml.gz (1.17 will actually generate a flow.json.gz file from your flow.xml.gz) and upgrade all your components to use the newer 1.17 version of the component classes.  So you'll want to review you flow after upgrade to make sure none of your components that were previous valid have become invalid because new property exist that must be configured.

NOTE: 1.17 will use start using the flow.json.gz once upgrade, as the flow.xml.gz format is deprecated.

If you found this response assisted you with your query, please take a moment to login and click on "Accept as Solution" below this response.

Thank you,
Matt

 

avatar
Explorer

Muito obrigado pela ajuda e esclarecimento, sou novo no nifi e estou estudando como proceder com essa atualização 1.12>1.17.
Acredito que seguindo suas diretrizes eu deveria ser capaz de completar esta tarefa.

Obrigado Matt!

Sinceramente, Ricardo.