Apache NiFi - Environment Setup



In this chapter, we will learn about the environment setup of Apache NiFi. The steps for installation of Apache NiFi are as follows −

Setup Java Development Kit (JDK)

You can download the latest version of SDK from Oracle's Java site − Java SE Downloads. You will find instructions for installing JDK in downloaded files, follow the given instructions to install and configure the setup. Finally set PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.

If you are running Windows and have installed the JDK in C:\jdk-24, you would have to put the following line in your C:\autoexec.bat file.

set PATH=C:\jdk-24;%PATH% 
set JAVA_HOME=C:\jdk-24

Alternatively, on Windows NT/2000/XP, you will have to right-click on My Computer, select Properties → Advanced → Environment Variables. Then, you will have to update the PATH value and click the OK button.

On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk-24 and you use the C shell, you will have to put the following into your .cshrc file.

setenv PATH /usr/local/jdk-24/bin:$PATH 
setenv JAVA_HOME /usr/local/jdk-24

Download and Install Apache NiFi

Download Apache NiFi from https://nifi.apache.org/download.html

Install Apache NiFi

The installation process for Apache NiFi is very easy. The process differs with the OS −

  • Windows OS − Unzip the zip package and the Apache NiFi is installed.

  • UNIX OS − Extract tar file in any location and the Apache NiFi is installed.

$tar -xvf nifi-2.5.0-bin.tar.gz

Run Apache NiFi

Open command prompt, go to the bin directory of NiFi. For example, D:\Projects\nifi-2.5.0\bin, and execute nifi.bat file.

D:\Projects\nifi-2.5.0\bin>nifi start

It will take a few minutes to get the NiFi UI up. A user can check nifi-app.log, once NiFi UI is up then, a user can enter http://localhost:8443/nifi/ to access UI.

When NiFi starts, it generates username and password which can be located in nifi-app.log similar to following lines −

Generated Username [765a61d9-a5d5-40db-abd0-3b65ebe953b8]
Generated Password [TkerHbRLjBlrv33/JalB5iDSBpwln4CR]

We've logged in using the generated username/password and following UI comes up. −

NiFi GUI
Advertisements