blob: 4dbb209965037bd22b692ac5699daa85961e1831 [file] [log] [blame]
<!DOCTYPE html>
<html class="no-js" lang="en">
<title>Apache NiFi MiNiFi Getting Started</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/assets/images/nifi16.ico"/>
<link rel="stylesheet" href="/stylesheets/app.min.27f785d2dfa83c24896261ad5106f3c19ee004c4d04b8a1c4b22e03a3a9fcb2a.css">
<link rel="stylesheet" href="/assets/stylesheets/font-awesome.min.css">
<script src="/assets/js/modernizr.js"></script>
<script src="/assets/js/webfontloader.js"></script>
var _paq = window._paq = window._paq || [];
(function() {
var baseUri = "//";
_paq.push(['setTrackerUrl', baseUri + 'matomo.php']);
_paq.push(['setSiteId', '28']);
var trackerElement = document.createElement('script');
var firstScriptElement = document.getElementsByTagName('script')[0];
trackerElement.async = true;
trackerElement.src = baseUri + 'matomo.js';
var firstScriptElement = document.getElementsByTagName('script')[0];
if ( === '') {
firstScriptElement.parentNode.insertBefore(trackerElement, firstScriptElement);
<body><div class="sticky contain-to-grid">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<a href="index.html">
<img id="logo-top-bar" src="/assets/images/minifi-drop-white.svg" alt="MiNiFi"/>
<li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>
<section class="top-bar-section">
<ul class="right">
<li class="has-dropdown">
<a href="#">Documentation</a>
<ul class="dropdown">
<li><a href="getting-started.html"><i class="fa"></i>Getting Started</a></li>
<li><a href="minifi-java-agent-quick-start.html"><i class="fa"></i>MiNiFi Java Quick Start Guide</a></li>
<li><a href="system-admin-guide.html"><i class="fa"></i>Administrator's Guide</a></li>
<li><a href="minifi-toolkit.html"><i class="fa"></i>Converter Toolkit</a></li>
<li><a href="faq.html"><i class="fa"></i>FAQ</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Wiki</a></li>
<li class="has-dropdown">
<a href="#">Downloads</a>
<ul class="dropdown">
<li><a href="download.html">Download MiNiFi Components</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>MiNiFi Java Release Notes</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>MiNiFi C++ Release Notes</a></li>
<li class="has-dropdown">
<a href="#">Community</a>
<ul class="dropdown">
<li><a href=""><i class="fa fa-external-link external-link"></i>Contributor Guide</a></li>
<li><a href="../mailing_lists.html">Mailing Lists &amp; Chat</a></li>
<li><a href="../people.html">People</a></li>
<li class="has-dropdown">
<a href="#">Development</a>
<ul class="dropdown">
<li><a href="../release-guide.html">Release Guide</a></li>
<li><a href="../licensing-guide.html">Licensing Guide</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Source - Java Agent</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Source - GitHub - Java Agent</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Source - C++ Agent</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Source - GitHub - C++ Agent</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>MiNiFi Java Issues</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>MiNiFi C++ Issues</a></li>
<li class="has-dropdown">
<a href="#">ASF Links</a>
<ul class="dropdown">
<li><a href=""><i class="fa fa-external-link external-link"></i>Apache Software Foundation</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Privacy Policy</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Sponsorship</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Security</a></li>
<li><a href=""><i class="fa fa-external-link external-link"></i>Thanks</a></li>
<a href="../index.html">Apache NiFi</a>
<div class="row">
<div class="large-12 columns">
<div class="large-space"></div>
<h1 id="getting-started-with-minifi">Getting started with MiNiFi</h1>
<p>This page explains how to configure and deploy MiNiFi agents.</p>
<p>The Java agent is able to run most of <a href="">NiFi&rsquo;s available processors</a>, but is a larger binary distribution (49MB) and consumes greater system resources (24MB max JVM heapsize by default). If you need maximum flexibility to make routing and processing decisions at your data&rsquo;s point of origin, the Java agent is a good fit.</p>
<p>The C++ agent is a smaller binary (3.2MB), consumes low system memory (about 5MB at idle) but has <a href="">a limited subset of processors</a>. If your primary concern is gathering and pushing data to downstream consumers and minimizing system impact, the C++ agent is a good fit.</p>
<li>Install the appropriate OS level dependencies:</li>
<h4 id="minifi-java">MiNiFi Java:</h4>
<li>Java 1.8+</li>
<h4 id="minifi-c">MiNiFi C++:</h4>
<h6 id="rhelcentos">RHEL/CentOS:</h6>
<li>yum install -y epel-release</li>
<li>yum install -y leveldb</li>
<h6 id="debianubuntu">Debian/Ubuntu:</h6>
<li>apt install -y libleveldb-dev</li>
<li>apt install -y libxml2</li>
<ol start="2">
<li>Download the relevant compressed binary from the <a href="download.html">Downloads</a> page</li>
<li>Copy and decompress the binary to your target deployment environment</li>
<li>Set the MINIFI_HOME environment variable to your decompressed binary directory</li>
<li>From $MINIFI_HOME, ./bin/ {start|stop|run|restart|status|flowStatus|dump|install}</li>
<p><em>flowStatus</em> and <em>dump</em> are available only for MiNiFi Java.</p>
<p>For MiNiFi Java, the agent logs to $MINIFI_HOME/logs/minifi-app.log.</p>
<p>For MiNiFi C++, the agent logs to $MINIFI_HOME/minifi-app.log.txt</p>
<h1 id="configuring-minifi-agent-flows">Configuring MiNiFi Agent Flows</h1>
<p>Agents execute the flow defined in $MINIFI_HOME/conf/config.yml. The shipped config.yml file has an &ldquo;empty&rdquo; flow.</p>
<p>While it&rsquo;s possible to create and modify config.yml programmatically or by hand, the more common scenario is to:</p>
<li>Use NiFi&rsquo;s web interface to define a flow</li>
<li>Save the flow as a template and download its XML file</li>
<li>Use the <a href="minifi-toolkit.html">Converter Toolkit</a> to convert the template XML to an equivalent config.yml</li>
<li>Put the config.yml file in $MINIFI_HOME/conf and start the agent.</li>
<h1 id="pushing-data-from-minifi-to-nifi">Pushing Data From MiNiFi to NiFi</h1>
<p>What follows is an illustrated walkthrough of configuring MiNiFi and NiFi to generate and collect log data.</p>
<p>If you&rsquo;re new to NiFi, watch the <a href="">NiFi introductory video series</a> before proceeding. If you don&rsquo;t already have NiFi, you can download it from <a href="">here</a>.</p>
<h2 id="configuring-nifi-to-receive-data">Configuring NiFi to Receive Data</h2>
<p>First, check that $NIFI_HOME/conf/ has a Site to Site input socket port specified:</p>
<pre tabindex="0"><code># Site to Site properties
nifi.remote.input.http.transaction.ttl=30 sec
</code></pre><p>Restart NiFi so changes take effect.</p>
<p>On NiFi&rsquo;s web UI, place an Input Port &ldquo;From MiNiFi&rdquo; and connect it to a downstream processor:
<img src="../assets/images/minifi/nifi-receive.png" alt=""></p>
<h2 id="creating-the-minifi-flow">Creating the MiNiFi Flow</h2>
<p>Create a new process group, and double click on it to enter it. Working inside this new processor group will let us create a clean template that includes flow components meant to run in MiNiFi.</p>
<p>Inside the process group, create a Remote Process Group (RPG) and give it the URL of your NiFi instance. The RPG will connect to NiFi and discover the input port created earlier.</p>
<p>Create a TailFile processor and connect it to the RPG, selecting the &ldquo;From MiNiFi&rdquo; input port.
<img src="../assets/images/minifi/minifi-flow.png" alt=""></p>
<p>Now create a template, download it as an XML file, and download the <a href="download.html">Converter ToolKit</a>.</p>
<p>From the toolkit directory:</p>
<pre tabindex="0"><code>[user@host minifi-toolkit-0.0.1]# ./bin/ transform /path/to/template.xml /output/path/config.yml
Java home: /usr/lib/jvm/jre-1.8.0-openjdk
MiNiFi Toolkit home: /minifi-toolkit-0.0.1
No validation errors found in template.
</code></pre><p>Open the config.yml file and add Port and Host to a Properties section at the end of the Input Ports section (at the end of the file):</p>
<pre tabindex="0"><code>Remote Processing Groups:
- name: http://localhost:8080/nifi
url: http://localhost:8080/nifi
comment: ''
timeout: 30 sec
yield period: 10 sec
Input Ports:
name: MiNiFi-input
comment: ''
max concurrent tasks: 1
use compression: false
Properties: # Deviates from spec and will later be removed when this is autonegotiated
Port: 1026
Host Name: localhost
</code></pre><p>Copy the generated config.yml file into $MINIFI/conf/config.yml, and start MiNiFi:</p>
<pre tabindex="0"><code>[user@host nifi-minifi-cpp-0.1.0]# ./bin/ start
Starting MiNiFi with PID 463 and pid file /nifi-minifi-cpp-0.1.0/bin/
</code></pre><p>After a few seconds, you should see NiFi receiving data on the input port:
<img src="../assets/images/minifi/nifi-received.png" alt=""></p>
<p>If you do not see data in the queue, it may have already been consumed by the downstream processor (PutFile in this case). If no data is arriving on the input port at all, check the MiNiFi log files, and confirm that the file being tailed exists and is not empty.</p>
<div class="row">
<div class="large-12 columns footer">
<a href="">
<img id="asf-logo" alt="Apache Software Foundation" src="/assets/images/asf_logo.png" width="200" style="margin:0px 10px" />
<a href="">
<img src="" style="margin:0px 10px" />
<div id="copyright">
<p>Copyright &#169; 2023 The Apache Software Foundation, Licensed under the <a
href="">Apache License, Version 2.0</a>.<br/>Apache, the
Apache feather logo, NiFi, Apache NiFi and the project logo are trademarks of The Apache Software
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/foundation.js"></script>
<script src="/assets/js/app.js"></script>