- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Execute an action on NiFi startup
- Labels:
-
Apache NiFi
-
Cloudera DataFlow (CDF)
Created ‎11-21-2015 11:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the best way to execute a one-time action during a NiFi startup? E.g. call home and report the (floating) IP address of the instance, or update a registry, etc.
Contrary to a reporting task, the idea is to fire once, not be running continuously while NiFi is up and have no requirement to be configured by a user explicitly (other than an admin deploying the code).
Created ‎11-22-2015 01:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NiFi supports the notion of Bootstrap Notification Services. These services can be configured to run when NiFi is Started, when NiFi is stopped, or when NiFi unexpected dies (or any combination of those). Currently, the only implementation that exists is the E-Mail Notification Service, but others could certainly be developed. These are configured in the conf/bootstrap.conf file and associated conf/boostrap-notification-services.xml file.
Created ‎11-22-2015 01:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NiFi supports the notion of Bootstrap Notification Services. These services can be configured to run when NiFi is Started, when NiFi is stopped, or when NiFi unexpected dies (or any combination of those). Currently, the only implementation that exists is the E-Mail Notification Service, but others could certainly be developed. These are configured in the conf/bootstrap.conf file and associated conf/boostrap-notification-services.xml file.
Created ‎11-22-2015 11:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @mpayne , this worked quite well for Started and Stopped events. I had a question on DIED notification, however. What logic does it use to detect this event? E.g. if I killed a child NiFi process, the bootstrap log simply has 'NiFi never started entry added', whereas I expected something else.
Created ‎11-23-2015 01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you start NiFi, the bootstrap process is constantly monitoring the NiFi process. If it notices that the NiFi process doesn't exist anymore, it will produce a NIFI_DIED notification and then restart NiFi.
