Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Restarting NiFi in NiFi

Restarting NiFi in NiFi

New Contributor

As anyone aware of a solution to restart within a NiFi flow or the UI? I do not see any options available through the UI. I've tried using the stream command processor but it does not disown the commands.

4 REPLIES 4

Re: Restarting NiFi in NiFi

Master Guru
@John Huntley

I am trying to understand the use case where you would want to restart NiFi from within your dataflow? Can you provide more detail on what you are trying to accomplish? The NIFi UI does not provide a means for executing a NiFi start, stop or restart.

Matt

Re: Restarting NiFi in NiFi

New Contributor

When a custom processor is added to a cloud directory we pull the file and place in processor directory, which requires a restart. I’m aware I could look for another solution that doesn’t rely on NiFi itself for this use case but our current deployment setup makes this easy (except the restart).

Re: Restarting NiFi in NiFi

Master Guru

@John Huntley

I can't think of a way to accomplish this. The issue you run into is the that NiFi processors in general need to complete their task before committing the FlowFile that triggered that task to the success relationship. What you are trying to do is use the ExecuteStreamCommand or even ExecuteScript to trigger a NiFi restart. The problem is NiFi is restarted before the command or script can return, so the FlowFile task never completes and gets committed to success relationship. So when NiFi did restart, it would try to reprocess that FlowFile. I fear you would trigger a non stop restart scenario.

As far as the NiFi API goes, Anything you can do via the UI, you can do via direct class to to the rest-api. The rest-api does not provide a means to restarting the NiFi application.

What i think you need here is a process totally outside of NiFi that monitors for your new nars, moves them to your custom NiFi lib directory and triggers a NiFi restart.

Matt

Re: Restarting NiFi in NiFi

New Contributor

@Matt Thanks for replying. I was able to get it working by using the api to start and stop the execute processor, with a script that nohups the restart script after a delay.

Don't have an account?
Coming from Hortonworks? Activate your account here