Apache nifi 集群安装

nifi 安装 使用案例 0 简介 Apache NiFi是一个基于流编程概念的数据流系统。它支持功能强大且可伸缩的数据路由、转换和系统中介逻辑有向图。NiFi有一个基于web的用户界面,用于设计、控制、反馈和监视数据流。它在服务质量的几个维度上是高度可配置的,比如容错与保证交付、低延迟与高吞吐量以及基于优先级的队列。NiFi为所有接收的、分叉的、连接的、克隆的、修改的、发送的和最终到达配置的最终状态时丢弃的数据... 阅读详情

原文地址:https://pierrevillard.com/2016/08/13/apache-nifi-1-0-0-cluster-setup/
文章写的很好了,步骤性的英文写得也比较易懂,原样搬过来了,没有再翻译

As you may know a version 1.0.0-BETA of Apache NiFi has been released few days ago. The upcoming 1.0.0 release will be a great moment for the community as it it will mark a lot of work over the last few months with many new features being added.

The objective of the Beta release is to give people a chance to try this new version and to give a feedback before the official major release which will come shortly. If you want to preview this new version with a completely new look, you can download the binaries here, unzip it, and run it (‘./bin/nifi.sh start‘ or ‘./bin/run-nifi.bat‘ for Windows), then you just have to access http://localhost:8080/nifi/.

The objective of this post is to briefly explain how to setup an unsecured NiFi cluster with this new version (a post for setting up a secured cluster will come shortly with explanations on how to use a new tool that will be shipped with NiFi to ease the installation of a secured cluster).

One really important change with this new version is the new paradigm around cluster installation. From the NiFi documentation, we can read:

Starting with the NiFi 1.0 release, NiFi employs a Zero-Master Clustering paradigm. Each of the nodes in a NiFi cluster performs the same tasks on the data but each operates on a different set of data. Apache ZooKeeper elects one of the nodes as the Cluster Coordinator, and failover is handled automatically by ZooKeeper. All cluster nodes report heartbeat and status information to the Cluster Coordinator. The Cluster Coordinator is responsible for disconnecting and connecting nodes. As a DataFlow manager, you can interact with the NiFi cluster through the UI of any node in the cluster. Any change you make is replicated to all nodes in the cluster, allowing for multiple entry points to the cluster.

这里写图片描述

zero-master-cluster

OK, let’s start with the installation. As you may know it is greatly recommended to use an odd number of ZooKeeper instances with at least 3 nodes (to maintain a majority also called quorum). NiFi comes with an embedded instance of ZooKeeper, but you are free to use an existing cluster of ZooKeeper instances if you want. In this article, we will use the embedded ZooKeeper option.

I will use my computer as the first instance. I also launched two virtual machines (with a minimal Centos 7). All my 3 instances are able to communicate to each other on requested ports. On each machine, I configure my /etc/hosts file with:

192.168.1.17 node-3
192.168.56.101 node-2
192.168.56.102 node-1

I deploy the binaries file on my three instances and unzip it. I now have a NiFi directory on each one of my nodes.

The first thing is to configure the list of the ZK (ZooKeeper) instances in the configuration file ‘./conf/zookeep.properties‘. Since our three NiFi instances will run the embedded ZK instance, I just have to complete the file with the following properties:

server.1=node-1:2888:3888
server.2=node-2:2888:3888
server.3=node-3:2888:3888

Then, everything happens in the ‘./conf/nifi.properties‘. First, I specify that NiFi must run an embedded ZK instance, with the following property:

nifi.state.management.embedded.zookeeper.start=true
I also specify the ZK connect string:

nifi.zookeeper.connect.string=node-1:2181,node-2:2181,node-3:2181

As you can notice, the ./conf/zookeeper.properties file has a property named dataDir. By default, this value is set to ./state/zookeeper. If more than one NiFi node is running an embedded ZK, it is important to tell the server which one it is.

To do that, you need to create a file name myid and placing it in ZK’s data directory. The content of this file should be the index of the server as previously specify by the server. On node-1, I’ll do:

mkdir ./state
mkdir ./state/zookeeper
echo 1 > ./state/zookeeper/myid 

operation needs to be done on each node (don’t forget to change the ID).

If you don’t do this, you may see the following kind of exceptions in the logs:

Caused by: java.lang.IllegalArgumentException: ./state/zookeeper/myid file is missing

Then we go to clustering properties. For this article, we are setting up an unsecured cluster, so we must keep:

nifi.cluster.protocol.is.secure=false

Then, we have the following properties:

nifi.cluster.is.node=true
nifi.cluster.node.address=node-1
nifi.cluster.node.protocol.port=9999
nifi.cluster.node.protocol.threads=10
nifi.cluster.node.event.history.size=25
nifi.cluster.node.connection.timeout=5 sec
nifi.cluster.node.read.timeout=5 sec
nifi.cluster.firewall.file=

I set the FQDN of the node I am configuring, and I choose the arbitrary 9999 port for the communication with the elected cluster coordinator. I apply the same configuration on my other nodes:

nifi.cluster.is.node=true
nifi.cluster.node.address=node-2
nifi.cluster.node.protocol.port=9999
nifi.cluster.node.protocol.threads=10
nifi.cluster.node.event.history.size=25
nifi.cluster.node.connection.timeout=5 sec
nifi.cluster.node.read.timeout=5 sec
nifi.cluster.firewall.file=

and

nifi.cluster.is.node=true
nifi.cluster.node.address=node-3
nifi.cluster.node.protocol.port=9999
nifi.cluster.node.protocol.threads=10
nifi.cluster.node.event.history.size=25
nifi.cluster.node.connection.timeout=5 sec
nifi.cluster.node.read.timeout=5 sec
nifi.cluster.firewall.file=

We have configured the exchanges between the nodes and the cluster coordinator, now let’s move to the exchanges between the nodes (to balance the data of the flows).

We have the following properties:

nifi.remote.input.host=node-1
nifi.remote.input.secure=false
nifi.remote.input.socket.port=9998
nifi.remote.input.http.enabled=true
nifi.remote.input.http.transaction.ttl=30 sec

Again, I set the FQDN of the node I am configuring and I choose the arbitrary 9998 port for the Site-to-Site (S2S) exchanges between the nodes of my cluster. The same applies for all the nodes (just change the host property with the correct FQDN).

It is also important to set the FQDN for the web server property, otherwise we may get strange behaviors with all nodes identified as ‘localhost’ in the UI. Consequently, for each node, set the following property with the correct FQDN:

nifi.web.http.host=node-1

And that’s all! Easy, isn’t it?

OK, let’s start our nodes and let’s tail the logs to see what’s going on there!

./bin/nifi.sh start && tail -f ./logs/nifi-app.log

If you look at the logs, you should see that one of the node gets elected as the cluster coordinator and then you should see heartbeats created by the three nodes and sent to the cluster coordinator every 5 seconds.

You can connect to the UI using the node you want (you can have multiple users connected to different nodes, modifications will be applied on each node). Let’s go to:

http://node-2:8080/nifi

Here is what it looks like:

这里写图片描述

Screen Shot 2016-08-13 at 7.33.08 PM

As you can see in the top-left corner, there are 3 nodes in our cluster. Besides, if we go in the menu (button in the top-right corner) and select the cluster page, we have details on our three nodes:

这里写图片描述

Screen Shot 2016-08-13 at 7.35.28 PM

We see that my node-2 has been elected as cluster coordinator, and that my node-3 is my primary node. This distinction is important because some processors must run on a unique node (for data consistency) and in this case we will want it to run “On primary node” (example below).

We can display details on a specific node (“information” icon on the left):

这里写图片描述

Screen Shot 2016-08-13 at 7.35.48 PM

OK, let’s add a processor like GetTwitter. Since the flow will run on all nodes (with balanced data between the nodes), this processor must run on a unique processor if we don’t want to duplicate data. Then, in the scheduling strategy, we will choose the strategy “On primary node”. This way, we don’t duplicate data, and if the primary node changes (because my node dies or gets disconnected), we won’t loose data, the workflow will still be executed.

这里写图片描述

Screen Shot 2016-08-13 at 7.45.19 PM

Then I can connect my processor to a PutFile processor to save the tweets in JSON by setting a local directory (/tmp/twitter):

这里写图片描述
Screen Shot 2016-08-13 at 7.52.25 PM

If I run this flow, all my JSON tweets will be stored on the primary node, the data won’t be balanced. To balance the data, I need to use a RPG (Remote Process Group), the RPG will connect to the coordinator to evaluate the load of each node and balance the data over the nodes. It gives us the following flow:

这里写图片描述

Screen Shot 2016-08-13 at 8.00.26 PM

I have added an input port called “RPG”, then I have added a Remote Process Group that I connected to ” http://node-2:8080/nifi ” and I enabled transmission so that the Remote Process Group was aware of the existing input ports on my cluster. Then in the Remote Process Group configuration, I enabled the RPG input port. I then connected my GetTwitter to the Remote Process Group and selected the RPG input port. Finally, I connected my RPG input port to my PutFile processor.

When running the flow, I now have balanced data all over my nodes (I can check in the local directory ‘/tmp/twitter‘ on each node).

That’s all for this post. I hope you enjoyed it and that it will be helpful for you if setting up a NiFi cluster. All comments/remarks are very welcomed and I kindly encourage you to download Apache NiFi, to try it and to give a feedback to the community if you have any.

《数据同步-NIFI系列》Nifi详细教程入门-04Nifi单节点、集群部署以及迁移 零主集群即每个节点都可以作为主节点执行任务,节点通过Zookeeper协调,首先Zookeeper会选择一个节点作为集群协调器,然后集群中所有节点都会像该节点发送心跳。如果集群协调器确定允许该节点加入,则将当前流提供给该节点,当节点的流配置版本与集群协调器的版本相同,则该节点可以加入集群,否则不能加入。:集群协调器是Nifi集群中的一个节点,由Zookeeper选举出,负责管理集群中允许执行任务的节点,并为新加入的节点提供最新的数据流量。当选择卸载节点后,该节点的流文件会重新平衡到活动中的其他节点。 阅读详情

相关推荐

4、NiFi集群部署及验证、监控及节点管理

如果投票时间(nifi.cluster.flow.election.max.wait.time)到了或者某一个flow.xml.gz已经达到票数(nifi.cluster.flow.election.max.candidates),则选出一个正确的flow.xml.gz。集群中的每个节点都对数据执行相同的任务,但每个节点都在不同的数据集上运行。如果集群协调器确定允许该节点加入(基于其配置的防火墙文件),则将当前流提供给该节点,并且该节点能够加入集群,假设节点的流副本与集群协调器提供的副本匹配。

alanchanchn的专栏 8万+

NIFI源码学习-(六)NIFI与KETTLE区别

kettle和NIFI都是大数据工具,不过前者是CS架构,只能在本地客户端开发好job之后,把包部署出去,后者却能在BS架构下通过浏览器页面随时调整流程。但是这些都是只是表面。 在网上也有对于二者的比较,说的到点的能说到二者对于实时性数据的支持上差异比较大,kettle几乎不支持实时性。本文详细说下这种差异导致的不同使用场景和内部原因。 一、适用场景 kettle:需要通过定时任务的方式,从不同的数据源进行ETL作业。此时数据多是已经产生了的。 NIFI:需要与别的系统通过实时调用服务的方式,将数据

东南_bit的博客 5113

ETL解决方案大PK:Apache NiFi、DataX、Kettle哪个更适合你?

本文将详细介绍Apache NiFi、DataX、Kettle这三个可视化ETL解决方案,并对其进行对比分析。文章将涵盖每个解决方案的基本概念、特点、安装方法、使用场景以及实际应用案例。通过本文的学习,读者可以了解这三种ETL解决方案的优缺点,并在实际项目中选择合适的解决方案。

Nifi 与 Kettle

Kettle是一个开源的ETL(Extract-Transform-Load)工具,可以用于数据集成、数据转换和数据处理等任务。它提供了一组可视化的设计工具,使得用户可以通过简单的拖拽和连接来构建数据流程,并且还支持多种数据源和数据目标,如数据库、文件、Web服务等。Kettle还提供了强大的转换和运行时功能,如数据抽取、字段转换、查询和过滤、数据合并等。此外,Kettle还可以轻松地与其他系统集成,如Hadoop、NoSQL数据存储、数据仓库、BI等。Kettle已经很强大了,为何还要学习Nifi?

Admans的专栏 3055

从光耦隔离到稳定驱动:信捷伺服与STM32的硬件设计陷阱与救赎

本文深入探讨了信捷伺服驱动器与STM32微控制器配合时的硬件设计关键问题,包括光耦隔离电路选型、电源电压选择、拨码开关设置等核心环节。针对伺服驱动器的稳定驱动需求,提供了从电路设计到抗干扰策略的完整解决方案,帮助工程师规避常见陷阱,提升工业控制系统的可靠性。

gold8的专栏 312

多尺度Transformer+特征融合新范式,算力减半精度猛增

在大模型时代,多尺度特征融合与Transformer架构的结合正成为研究热点。多尺度特征融合能够捕捉数据在不同尺度上的关键信息,而Transformer架构凭借其强大的并行处理能力和对长距离依赖的建模能力,为复杂数据处理提供了新的思路。这种结合在处理多模态数据时展现出巨大潜力。

Tulingxueshu的博客 1061

nifi集群_NIFI介绍

Nifi1.11.4简介NiFi 最初由美国国家安全局(NSA)开发和使用的一个可视化、可定制的数据集成产品。2014 年 NSA 将其贡献给了 Apache 开源社区,2015 年 7 月成为 Apache 顶级项目。NiFi 特性NiFi 为数据流而设计,它可以用来在不同的数据中心之间搭建数据流通的管道。NiFi 通过拖拽界面、配置参数、简单地连接,即可完成对数据流的托管和系统间的自...

weixin_40003046的博客 1285

ROS Noetic + Realsense ROS 2.3.2 在鲁班猫4上的完整工作空间搭建与相机启动调试

本文详细介绍了在鲁班猫4(RK3588S)开发板上搭建ROS Noetic与Realsense ROS 2.3.2开发环境的完整流程,包括Realsense SDK安装、工作空间配置、D435i深度相机驱动调试等关键步骤,为机器人视觉系统开发提供实用指南。

weixin_33217202的博客 238

Nifi介绍、安装、实践案例

第1章NiFi基本概念 1.1 概述 简单地说,NiFi是为了自动化系统之间的数据流而构建的。虽然术语“数据流”在各种环境中使用,但我们在此处使用它来表示系统之间自动化和管理的信息流。这个问题空间一直存在,因为企业有多个系统,其中一些系统创建数据,一些系统消耗数据。已经讨论并广泛阐述了出现的问题和解决方案模式。企业集成模式中提供了一个全面且易于使用的表单。 NiFi的诞生,要致力于解决的问题...

Allenzyg的博客 1万+

windows sever2019切换Linux内核

安装docker engine后,内核是windows,很多镜像都无法安装使用。 一,在https://github.com/linuxkit/lcow/release 下载最新版本release.zip,我使用了如下版本。 二,新建文件夹C:\Program Files\Linux Containers ,把release.zip(不要解压)放入此文件夹 三,编辑docker配置文件( C:\ProgramData\docker\config\daemon.json) ,电脑中没有该文件,新建一

记录日常疑问 3875

DA14531-外设驱动篇-UART收发通信应用

宏定义注解CFG_PRINTF用户开启串口串口打印宏设置波特率选择115200。

hejinwu1314的博客 730

nifi集群_Apache NiFi系统管理员指南 系统要求/如何安装和启动NiFi

系统要求Apache NiFi可以运行在像笔记本电脑一样简单的设备上,但是它也可以跨许多企业级服务器集群运行。因此,所需的硬件和内存量将取决于所涉及数据流的大小和性质。NiFi处理数据时,数据会存储在磁盘上。因此,NiFi需要为其各种存储库分配足够的磁盘空间,尤其是内容存储库,流文件存储库和源头存储库(有关这些存储库的更多信息,请参见系统属性部分)。NiFi具有以下最低系统要求:需要Ja...

weixin_39766014的博客 428

树莓派 5 AI 套件(Hailo)示例

该用户自定义类作为输入传递给回调函数,该函数在管道输出上运行。它用于主程序与回调函数之间的通信。它对 hailo_rpi_common::app_callback_class 进行了扩展,并可根据应用程序的具体情况定制附加变量和方法。

机器人控制与仿真应用 4117

NiFi 单机和集群安装与使用

文章目录1. 安装1.1 压缩包安装1.2 Docker安装2. 使用 1. 安装 1.1 压缩包安装 NiFi官网下载 mkdir /usr/local/softwares/nifi tar -zxvf nifi-1.10.0-bin.tar.gz -C /usr/local/softwares/nifi 在NiFi安装目录下执行 可在conf/nifi.properties修改端口,原808...

shpunishment的博客 2170

【YOLOv8改进-卷积Conv】 SAConv(Switchable Atrous Convolution):可切换的空洞卷积

许多现代目标检测器通过采用二次观察和思考机制展示了卓越的性能。在本文中,我们在目标检测的主干设计中探索了这一机制。在宏观层面上,我们提出了递归特征金字塔(Recursive Feature Pyramid),该金字塔将特征金字塔网络(Feature Pyramid Networks)的额外反馈连接融入到底层的自下而上主干层中。在微观层面上,我们提出了可切换空洞卷积(Switchable Atrous Convolution),该卷积通过不同的空洞率卷积特征,并使用切换函数汇集结果。

专注于图像领域,主要研究内容包括计算机视觉和深度学习,特别是在图像分类、目标检测和图像生成等方面有深入的研究和实践经验。 1528

电子电气架构 --- 整车电源管理

保证启动能力:防止因电池电量耗尽而导致的车辆无法启动,这对于确保车辆在任何时候都能可靠运行至关重要。 延长电池寿命:通过避免电池深度放电,有助于延长其使用寿命,减少更换电池的需求和成本。 提升用户体验:虽然负载被关闭可能会暂时影响舒适度,但通过在必要时自动采取行动,可以减少驾驶员的焦虑和不确定性,提高整体的用户满意度。

Soly_kun的博客 1087

Apache NiFi 安装配置

单机 下载 http://nifi.apache.org/download.html nifi-1.7.1-source-release.zip【源码学习,IDEA编译偏好】 nifi-1.7.1-bin.tar.gz 【下载运行文件】 安装 tar zxvf nifi-1.7.1-bin.tar.gz 配置 conf/nifi.properties修改端口号和路径: #启动后访问的地址: n...

qq_26618073的博客 2458

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

【亲测免费】 Apache NiFi 安装与使用指南

Apache NiFi 安装与使用指南 1. 项目目录结构及介绍 在解压或克隆 apache/nifi-site.git 后,您将得到Apache NiFi的基本目录结构: nifi/ ├── bin/ 存放启动和停止NiFi的服务脚本 ├── conf/ 包含NiFi的主要配置文件 ├── lib/ 存放NiFi运行所需的jar包和其他库文件 ├── lo...

gitblog_00508的博客 1124

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

Apache NiFi快速安装指南:从零开始的完整教程

Apache NiFi是一个强大的数据流自动化工具,专门用于数据采集、处理和分发。本文将为您提供**Apache NiFi快速安装**的完整步骤,帮助您在几分钟内完成部署并开始使用这个强大的数据流管理平台。🚀 ## 什么是Apache NiFi? Apache NiFi是一个开源的**数据流自动化工具**,旨在自动化数据在系统间的流动。它提供了一个直观的Web界面,让您能够设计、控制和监控数

gitblog_00238的博客 1044

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

nifi mysql hive_Nifi入门

NiFi基本概念概述简单地说,NiFi是为了自动化系统之间的数据流而构建的。虽然术语“数据流”在各种环境中使用,但我们在此处使用它来表示系统之间自动化和管理的信息流。这个问题空间一直存在,因为企业有多个系统,其中一些系统创建数据,一些系统消耗数据。已经讨论并广泛阐述了出现的问题和解决方案模式。企业集成模式 中提供了一个全面且易于使用的表单。NiFi的诞生,要致力于解决的问题:因为网络故障、磁盘故障...

weixin_32661017的博客 592

Nifi-1.16.0集群搭建

​ 一、环境准备 1、服务器资源分配 IP 服务 192.168.0.11 Zookeeper、NiFi、Kerberos 192.168.0.12 Zookeeper、NiFi 192.168.0.13 Zookeeper、NiFi 文件下载链接: nifi-1.16.0-bin.tar.gz:下载 nifi-toolkit-1.16.0-bin.tar.gz:下载 相关参考文档: NIFI文档 2、禁用selinux > vi /etc/selinux/config

Jagger的博客 1635

Nifi集群安装配置

Nifi集群安装配置

weixin_50584118的博客 701

Helm Chart for Apache NiFi 安装与配置指南

Helm Chart for Apache NiFi 安装与配置指南 1. 项目基础介绍 本项目是一个开源的 Helm Chart,用于在 Kubernetes 集群中部署 Apache NiFi。Apache NiFi 是一个强大的数据流程管理系统,用于自动化数据流的管理。它支持高度可扩展的数据处理模型,并提供了易于使用的前端界面。 主要编程语言:此项目主要是使用 YAML 语言编写,它是 Ku...

gitblog_00914的博客 1055

NIFI安装和与kafka通信笔记

1.什么是NIFI? Apache NIFI是一个易于使用,功能强大且可靠的数据拉去,数据处理和分发系统 NIFI原本是NSA的一个项目,目前代码已经开源,是Apache开源基金会的顶级项目之一 NIFI是基于JAVA的,使用Maven管理支持包 NIFI基于web方式工作,无需编写代码,图像化操作数据流 2. NIFI安装 官方下载地址:https://nifi.apache.org/download.html 这里的tar.gz是linux下的安装包,Windows用户下载zip包安装即可。

一智哇的博客 1330

大数据笔记-NIFI(第一篇)

简而言之,NiFi 旨在使系统之间的数据流自动化。虽然术语“数据流”在各种情况下使用,但我们在这里使用它来表示系统之间的自动化和管理信息流。自从企业拥有多个系统以来,这个问题空间就一直存在,其中一些系统创建数据,而一些系统消耗数据。出现的问题和解决方案模式已被广泛讨论和阐明。企业集成模式中提供了一个全面且易于使用的表格。系统故障网络故障,磁盘故障,软件崩溃,人们犯错误。数据访问超出了消费能力有时,给定的数据源可能会超过处理或交付链的某些部分——只需要一个薄弱环节就会出现问题。边界条件只是建议。...

我睡觉的时候不困 2142

helm-nifi:一键部署Apache NiFi至Kubernetes

helm-nifi:一键部署Apache NiFi至Kubernetes 在当今数据流处理领域,Apache NiFi成为了企业级解决方案中的热门选择。其可视化数据流管理、易于维护和扩展的特点,使得它被广泛应用于实时数据处理场景。今天,我们将介绍一个开源项目——helm-nifi,它可以帮助用户轻松地在Kubernetes环境中部署Apache NiFi。 项目介绍 helm-nifi是一个Hel...

gitblog_01054的博客 654
上一篇: 基于YARN集群构建运行PySpark Application
下一篇: Hive分区表count(*)不起mapreduce的真相
Ronney-Hua
博客等级 码龄10年 48粉丝 74原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值