Apache Nifi 简明教程
Apache NiFi - Controller Settings
Apache NiFi 提供共享服务,这些服务可以由处理器共享,而报告任务称为控制器设置。这些服务类似于数据库连接池,可供访问同一数据库的处理器使用。
Apache NiFi offers shared services, which can be shared by processors and reporting task is called controller settings. These are like Database connection pool, which can be used by processors accessing same database.
要访问控制器设置,请使用 NiFi UI 右上角的下拉菜单,如下图所示。
To access the controller settings, use the drop down menu at the right top corner of NiFi UI as shown in the below image.
Apache NiFi 提供了许多控制器设置,我们将讨论一个常用的设置,以及如何将其设置为 NiFi。
There are many controller settings offered by Apache NiFi, we will discuss a commonly used one and how we set it up in NiFi.
DBCPConnectionPool
单击“控制器设置”选项后,在 Nifi 设置页面中添加加号。然后从控制器设置列表中选择 DBCPConnectionPool。DBCPConnectionPool 将会添加到主 NiFi 设置页面中,如下图所示。
Add the plus sign in the Nifi Settings page after clicking the Controller settings option. Then select the DBCPConnectionPool from the list of controller settings. DBCPConnectionPool will be added in the main NiFi settings page as shown in the below image.
它包含以下关于控制器 setting:Name 的信息
It contains the following information about the controller setting:Name
-
Type
-
Bundle
-
State
-
Scope
-
Configure and delete icon
单击配置图标并填写所需字段。下表列出了这些字段 -
Click on the configure icon and fill the required fields. The fields are listed down in the table below −
S.No. |
Field Name |
Default value |
description |
1 |
Database Connection URL |
empty |
To specify the connection URL to database. |
2 |
Database Driver Class Name |
empty |
To specify the driver class name for database like com.mysql.jdbc.Driver for mysql. |
3 |
Max Wait Time |
500 millis |
To specify time to wait for the data from a connection to database. |
4 |
Max Total Connections |
8 |
To specify the maximum number of allocated connection in database connection pool. |
要停止或配置控制器设置,首先应停止所有已连接的 NiFi 组件。NiFi 还在控制器设置中添加范围,以管理其配置。因此,只有共享相同设置的组件不会受到影响,并将使用相同的控制器设置。
To stop or configure a controller setting, first all the attached NiFi components should be stopped. NiFi also adds scope in controller settings to manage the configuration of it. Therefore, only the ones which shared the same settings will not get impacted and will use the same controller settings.