Bootstrap Properties
conf目錄下的bootstrap.conf文件允許用戶配置NiFi應(yīng)該如何啟動(dòng)的設(shè)置抄课。 這包括參數(shù)糟袁,例如Java堆的大小阱驾,運(yùn)行的Java命令以及Java系統(tǒng)屬性瓜喇。
只有在NiFi停止并重新啟動(dòng)之后疯汁,對(duì)此文件的任何更改才會(huì)生效。
Property | Description |
---|---|
java | 指定要運(yùn)行的完全限定的java命令地来。 默認(rèn)情況下戳玫,它只是java,但可以改為絕對(duì)路徑或引用一個(gè)環(huán)境變量靠抑,如$ JAVA_HOME / bin / java |
run.as | 運(yùn)行NiFi的用戶名量九。 例如适掰,如果NiFi應(yīng)該作為nifi用戶運(yùn)行颂碧,則將此值設(shè)置為nifi將導(dǎo)致NiFi進(jìn)程作為nifi用戶運(yùn)行。 在Windows上忽略此屬性类浪。 對(duì)于Linux载城,指定的用戶可能需要sudo權(quán)限。 |
lib.dir | 用于NiFi的lib目錄费就。 默認(rèn)情況下诉瓦,它被設(shè)置為./lib |
conf.dir | 用于NiFi的conf目錄。 默認(rèn)情況下力细,它被設(shè)置為./conf |
graceful.shutdown.seconds | 當(dāng)NiFi被指示關(guān)閉時(shí)睬澡,Bootstrap會(huì)等待這個(gè)秒數(shù),以便進(jìn)程徹底關(guān)閉眠蚂。 在這段時(shí)間內(nèi)煞聪,如果服務(wù)仍在運(yùn)行,Bootstrap將“終止”該進(jìn)程逝慧,或強(qiáng)制終止進(jìn)程昔脯。 |
java.arg.N | 當(dāng)進(jìn)程啟動(dòng)時(shí)啄糙,任何數(shù)量的JVM參數(shù)都可以傳遞給NiFi JVM。 缺省值包括最小和最大Java堆大小的屬性云稚,要使用的垃圾回收器等 |
notification.services.file | 當(dāng)NiFi啟動(dòng)或停止時(shí)隧饼,或Bootstrap檢測(cè)到NiFi已經(jīng)死亡時(shí),Bootstrap能夠向相關(guān)方發(fā)送這些事件的通知静陈。 這是通過指定一個(gè)定義可以使用哪個(gè)通知服務(wù)的XML文件來配置的燕雁。 有關(guān)此文件的更多信息,請(qǐng)參閱通知服務(wù)部分鲸拥。 |
notification.max.attempts | 如果配置了通知服務(wù)但無法執(zhí)行其功能贵白,則會(huì)再次嘗試最多次嘗試次數(shù)。 該屬性配置最大嘗試次數(shù)崩泡。 默認(rèn)值是5禁荒。 |
nifi.start.notification.services | 此屬性是通知服務(wù)標(biāo)識(shí)符的逗號(hào)分隔列表,與notification.services.file屬性中定義的Notification Services對(duì)應(yīng)角撞。 具有指定標(biāo)識(shí)符的服務(wù)將用于在NiFi啟動(dòng)時(shí)通知其配置的收件人呛伴。 |
nifi.stop.notification.services | 此屬性是通知服務(wù)標(biāo)識(shí)符的逗號(hào)分隔列表,與notification.services.file屬性中定義的Notification Services對(duì)應(yīng)谒所。 具有指定標(biāo)識(shí)符的服務(wù)將用于在NiFi停止時(shí)通知其配置的收件人热康。 |
nifi.died.notification.services | 此屬性是通知服務(wù)標(biāo)識(shí)符的逗號(hào)分隔列表,與notification.services.file屬性中定義的Notification Services對(duì)應(yīng)劣领。 具有指定標(biāo)識(shí)符的服務(wù)將用于在NiFi停止時(shí)通知其配置的收件人姐军。 |
通知服務(wù) Notification Services
當(dāng)NiFi引導(dǎo)程序啟動(dòng)或停止NiFi,或者檢測(cè)到它意外死亡時(shí)尖淘,它可以通知已配置的收件人奕锌。 目前,唯一提供的機(jī)制是發(fā)送電子郵件或HTTP POST通知村生。 通知服務(wù)配置文件是配置通知功能的XML文件惊暴。
XML文件的默認(rèn)位置是conf / bootstrap-notification-services.xml,但可以在conf / bootstrap.conf文件中更改此值趁桃。
XML文件的語法如下所示:
<services>
<!-- any number of service elements can be defined. -->
<service>
<id>some-identifier</id>
<!-- The fully-qualified class name of the Notification Service. -->
<class>org.apache.nifi.bootstrap.notification.email.EmailNotificationService</class>
<!-- Any number of properties can be set using this syntax.
The properties available depend on the Notification Service. -->
<property name="Property Name 1">Property Value</property>
<property name="Another Property Name">Property Value 2</property>
</service>
</services>
一旦配置了所需的服務(wù)辽话,就可以在bootstrap.conf文件中引用它們。
電子郵件通知服務(wù)Email Notification Service
通過電子郵件發(fā)送通知卫病,實(shí)現(xiàn)是org.apache.nifi.bootstrap.notification.email.EmailNotificationService油啤。 它具有以下屬性:
Property | Required | Description |
---|---|---|
SMTP Hostname | true | 用于發(fā)送電子郵件通知的SMTP服務(wù)器的主機(jī)名 |
SMTP Port | true | 用于SMTP通信的端口 |
SMTP Username | true | Username for the SMTP account |
SMTP Password | Password for the SMTP account | |
SMTP Auth | Flag indicating whether authentication should be used | |
SMTP TLS | 是否應(yīng)啟用TLS的標(biāo)志 | |
SMTP Socket Factory | javax.net.ssl.SSLSocketFactory | |
SMTP X-Mailer Header | 在發(fā)送電子郵件的標(biāo)題中使用的X-Mailer | |
Content Type | 電子郵件內(nèi)容的MIME類型,例如text / plain或text / html | |
From | true | 指定用作發(fā)件人的電子郵件地址蟀苛。 |
To | 收件人列表 | |
CC | The recipients to include in the CC-Line of the email | |
BCC | The recipients to include in the BCC-Line of the email |
除了上面標(biāo)記為必需的屬性之外益咬,還必須至少設(shè)置一個(gè)“收件人”,“抄送”或“密件抄送”屬性屹逛。
配置電子郵件服務(wù)的完整示例如下所示:
<service>
<id>email-notification</id>
<class>org.apache.nifi.bootstrap.notification.email.EmailNotificationService</class>
<property name="SMTP Hostname">smtp.gmail.com</property>
<property name="SMTP Port">587</property>
<property name="SMTP Username">username@gmail.com</property>
<property name="SMTP Password">super-secret-password</property>
<property name="SMTP TLS">true</property>
<property name="From">"NiFi Service Notifier"</property>
<property name="To">username@gmail.com</property>
</service>