Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automating NIFI template deployment

Tags:

apache-nifi

I'm new to nifi and am trying to understand (since it looks many GUI based) if there is a way to automate scale up and down on Nifi and how one would take an xml Nifi template and deploy it to a cluster.

Essentially what we're trying to do is use Nifi to collect JMX and log files off of kafka servers as they come up in an automated fashion so logging and JMX counters start flowing to, lets say and Elasticsearch cluster.

For example, right now we've automated deployment of the kafka servers using Ansible, so the hope was to configure and deploy Nifi xml teamplates along with the cluster deployment so no manual intervention is required to collect the kafka jmx counters and log files.

How would one automate this in Nifi?

like image 312
lightweight Avatar asked Feb 18 '17 04:02

lightweight


People also ask

How do you deploy NiFi flows?

To do this, navigate to your Flow Management Data Hub cluster and click the NiFi Registry icon which logs you into the NiFi Registry UI. In the NiFi Registry UI, find the flow definition that you want to export by looking for the flow name that you provided when you started versioning your process group.

How can I call NiFi API?

Open your browser and go to http://localhost:8080/nifi to access the Nifi UI where you can create the flow. You should see a canvas as shown below when the page loads.

What is registry in NiFi?

Registry - a subproject of Apache NiF - is a complementary application that provides a central location for storage and management of shared resources across one or more instances of NiFi or MiNiFi.


1 Answers

There are a number of tools and techniques available to automate deployment of a template, including:

  • curl, see SO: Post a NIFI template via REST? - most basic API template deployment.
  • nifi-api-deploy - performs template deployment plus some migration tasks.
  • nifi-deploy-process-group - performs process group migration.

The hard part is migrating from the existing flow to the new flow, especially where an existing flow may have queued flowfiles, and provenance history references the existing flow. But if you are automating the entire deployment of the NiFi cluster and deploying the template to an empty canvas, this might not be a problem.

You can read a full treatment of the issues involved and future plans in Configuration Management of Flows.

like image 125
James Avatar answered Sep 27 '22 20:09

James