Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Data Engineering with Python

You're reading from  Data Engineering with Python

Product type Book
Published in Oct 2020
Publisher Packt
ISBN-13 9781839214189
Pages 356 pages
Edition 1st Edition
Languages
Author (1):
Paul Crickard Paul Crickard
Profile icon Paul Crickard

Table of Contents (21) Chapters

Preface 1. Section 1: Building Data Pipelines – Extract Transform, and Load
2. Chapter 1: What is Data Engineering? 3. Chapter 2: Building Our Data Engineering Infrastructure 4. Chapter 3: Reading and Writing Files 5. Chapter 4: Working with Databases 6. Chapter 5: Cleaning, Transforming, and Enriching Data 7. Chapter 6: Building a 311 Data Pipeline 8. Section 2:Deploying Data Pipelines in Production
9. Chapter 7: Features of a Production Pipeline 10. Chapter 8: Version Control with the NiFi Registry 11. Chapter 9: Monitoring Data Pipelines 12. Chapter 10: Deploying Data Pipelines 13. Chapter 11: Building a Production Data Pipeline 14. Section 3:Beyond Batch – Building Real-Time Data Pipelines
15. Chapter 12: Building a Kafka Cluster 16. Chapter 13: Streaming Data with Apache Kafka 17. Chapter 14: Data Processing with Apache Spark 18. Chapter 15: Real-Time Edge Data with MiNiFi, Kafka, and Spark 19. Other Books You May Enjoy Appendix

Chapter 15: Real-Time Edge Data with MiNiFi, Kafka, and Spark

In this chapter, you will learn how Internet-of-Things (IoT) devices, small computers, and sensors can send data into a data pipeline using Apache NiFi. For computers or devices with little processing power, MiNiFi allows them to be part of a NiFi data pipeline. MiNiFi is a lightweight version of NiFi with a stripped-down set of processors and no graphical user interface. It is built to send data using a data pipeline built into NiFi and deployed to the device.

In this chapter, we're going to cover the following main topics:

  • Setting up MiNiFi on a device
  • Building and deploying a MiNiFi task in NiFi

Setting up MiNiFi

Apache MiNiFi is a lightweight version of NiFi, to be used in data collection at the source. Increasingly, the source has become smaller IoT devices, sensors, and low-powered computers such as the Raspberry Pi. To incorporate these devices into your data pipelines, you need a way to get the data off the device. MiNiFi allows you to stream the data to NiFi as part of a standard data pipeline.

To get the MiNiFi binary, browse to https://nifi.apache.org/minifi/. The following screenshot is of the MiNiFi home page and will provide you with information and documentation for the project:

Figure 15.1 – The Apache MiNiFi home page

From the main navigation bar, go to Downloads and select the Download MiNiFi Components option. You will need to decide whether you want to run the MiNiFi Java or MiNiFi C++ version. Which version is appropriate will depend on the specifications of the device where MiNiFi will live. If you need the smallest footprint...

Building a MiNiFi task in NiFi

In this section, you will build a data pipeline and deploy it to MiNiFi. The data pipeline will generate flow files and send them to NiFi. The next section will take this further and use a processor that is not included with MiNiFi.

To use MiNiFi, you will need an older version of NiFi. The current tool – 0.5.0 – breaks because of changes to properties output from the nifi template. It will be fixed in 0.6.0, but until then, you will need to use at least version 1.9.0 of NiFi. You can get older NiFi versions at https://archive.apache.org/dist/nifi/1.9.0/. Unzip NiFi using the tar command with the -xvzf flags. Place the folder in your home directory using mv or your file explorer tools.

You will also need an older version of Java. To install the correct version of Java, use the following command:

sudo apt-get install openjdk-8-jre

Lastly, you will also need to make sure that NiFi is configured to allow site-to-site connections...

Summary

In this chapter, you learned how MiNiFi provides a means by which you can stream data to a NiFi instance. With MiNiFi, you can capture data from sensors, smaller devices such as a Raspberry Pi, or on regular servers where the data lives, without needing a full NiFi install. You learned how to set up and configure a remote processor group that allows you to talk to a remote NiFi instance.

In the Appendix, you will learn how you can cluster NiFi to run your data pipelines on different machines so that you can further distribute the load. This will allow you to reserve servers for specific tasks, or to spread large amounts of data horizontally across the cluster. By combining NiFi, Kafka, and Spark into clusters, you will be able to process more data than any single machine.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Data Engineering with Python
Published in: Oct 2020 Publisher: Packt ISBN-13: 9781839214189
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}