问题
I am new to Apache NIFI tool. I am trying to import data from mongo db and put that data into the HDFS. I have created 2 processors one for MongoDB and second for HDFS and I configured them correctly. The job is running successfully and storing the data into HDFS but the job should terminate automatically on success. But it is not, and creating too many files in HDFS. I want to know how to make On Demand Job in NIFI and how to determine that a job is successfull.
回答1:
GetMongo
will continue to pull data from MongoDB based on the provided properties such as Query
, Projection
, Limit
. It has no way of tracking the execution process, at least for now. What you can do, however, is changing the Run Schedule
and/or Scheduling Strategy
. You can find them by right clicking on the processor and clicking Configure
. By default, Run Schedule
will be 0 sec which means running continuously. Changing it to, say, 60 min
will make the processor run every one hour. This will still read the same documents from MongoDB again every one hour but since you have mentioned that you just want to run it only once, I'm suggesting this approach.
来源:https://stackoverflow.com/questions/49317897/apache-nifi-jon-is-not-terminating-automatically