You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Jeff Zemerick <jz...@apache.org> on 2018/06/15 13:43:49 UTC

NiFi as a service

Hi all,

Running NiFi 1.6.0 on Ubuntu 16.04 and I installed it as a service and it
worked great. On the same box, I then installed MongoDB (via apt-get). The
MongoDB installation failed because of errors indicating a loop in the
services:

insserv: There is a loop between service nifi and mountdevsubfs if started
insserv:  loop involving service mountdevsubfs at depth 2
insserv:  loop involving service udev at depth 1
insserv: Starting nifi depends on plymouth and therefore on system facility
`$all' which can not be true!

My knowledge around services is pretty limited. I removed the NiFi service
and the MongoDB install finished ok. Wondering if there is anything I
should do differently? If other information is needed please let me know.

Thanks,
Jeff

Re: NiFi as a service

Posted by Tim Dean <ti...@gmail.com>.
Jeff,

We ran into the exact same problem after trying to install as a service on
Ubuntu. Once the service is installed, all subsequent apt-based installs
fail with the message you are seeing.

We worked around it by writing our own script to install the service in the
correct way for Ubuntu. I've been meaning to file this as an issue with
NiFi and to submit our workaround as a possible fix for the issue, but
haven't gotten around to that. The following should give you an idea of how
to do it though:

1) Create a nifi.service file. Ours looks like this:


[Unit]
; General Service Metadata
Description="Apache NiFi"
Documentation=http://nifi.apache.org/docs.html

; Dependencies
After=network.target

[Service]
Type=forking

User=nifi
Group=nifi

; Service runtime should use the nifi shell scripts
ExecStart=%NIFI_BIN_DIR%/nifi.sh start
ExecStop=%NIFI_BIN_DIR%/nifi.sh stop

; Service should restart whenever something fails
Restart=on-abnormal

[Install]
WantedBy=multi-user.target


2)  In our install script, we set templateFile to the location of the above
file, and set nifiDir to the location where NiFi has been installed. Then
we do this:

sed -e "s;%NIFI_BIN_DIR%;${nifiDir}/bin;g" ${templateFile} >
/etc/system/system/nifi.service
systemctl daemon-reload
systemctl enable nifi.service &> /dev/null
systemctl start nifi.service


I'm copying this a little bit out of context rather than sharing our entire
system's install script, of which this is one small part. My apologies if
I've missed anything when extracting these details from the larger script.





On Fri, Jun 15, 2018 at 8:43 AM, Jeff Zemerick <jz...@apache.org> wrote:

> Hi all,
>
> Running NiFi 1.6.0 on Ubuntu 16.04 and I installed it as a service and it
> worked great. On the same box, I then installed MongoDB (via apt-get). The
> MongoDB installation failed because of errors indicating a loop in the
> services:
>
> insserv: There is a loop between service nifi and mountdevsubfs if started
> insserv:  loop involving service mountdevsubfs at depth 2
> insserv:  loop involving service udev at depth 1
> insserv: Starting nifi depends on plymouth and therefore on system
> facility `$all' which can not be true!
>
> My knowledge around services is pretty limited. I removed the NiFi service
> and the MongoDB install finished ok. Wondering if there is anything I
> should do differently? If other information is needed please let me know.
>
> Thanks,
> Jeff
>
>

Re: NiFi as a service

Posted by Jeff Zemerick <jz...@apache.org>.
Tim, thanks a lot! I will give that a try.

Mike, I used the "nifi.sh install" as Tim described. My workaround was just
to remove /etc/init.d/nifi but your docker suggestion will help, too.

Thanks!
Jeff


On Fri, Jun 15, 2018 at 1:55 PM Tim Dean <ti...@gmail.com> wrote:

> Mike -
>
> The standard build of NiFi includes the bin/nifi.sh script, and one of
> the options for that script is the install command. When executed, that
> command writes a file called /etc/init.d/nifi and also manipulates a few
> links. I believe that something within that file and link creation causes
> subsequent apt-based commands to fail on Ubuntu - or at least on Ubuntu
> 16.04. I'm not well-versed enough in different Linux startup variations to
> know exactly where this is going wrong, but the workaround I provided in a
> previous response is how we've avoided using the built-in install command.
>
> On Fri, Jun 15, 2018 at 9:52 AM, Mike Thomsen <mi...@gmail.com>
> wrote:
>
>> Jeff,
>>
>> How did you get install NiFi as a service? I'm not aware of us offering
>> any systemd configurations for NiFi as part of the standard build from
>> Apache.
>>
>> In the mean time, I would suggest using Docker to run Mongo with NiFi if
>> this is a blocker for you and the goal here is to get a development
>> environment set up. If you want to do that, this is all you need:
>>
>> docker run -d -p 27017:27017 --name mongo1 mongo:latest
>>
>> docker exec -it mongo1 mongo DB_NAME_HERE
>>
>> Thanks,
>>
>> Mike
>>
>>
>> On Fri, Jun 15, 2018 at 9:44 AM Jeff Zemerick <jz...@apache.org>
>> wrote:
>>
>>> Hi all,
>>>
>>> Running NiFi 1.6.0 on Ubuntu 16.04 and I installed it as a service and
>>> it worked great. On the same box, I then installed MongoDB (via apt-get).
>>> The MongoDB installation failed because of errors indicating a loop in the
>>> services:
>>>
>>> insserv: There is a loop between service nifi and mountdevsubfs if
>>> started
>>> insserv:  loop involving service mountdevsubfs at depth 2
>>> insserv:  loop involving service udev at depth 1
>>> insserv: Starting nifi depends on plymouth and therefore on system
>>> facility `$all' which can not be true!
>>>
>>> My knowledge around services is pretty limited. I removed the NiFi
>>> service and the MongoDB install finished ok. Wondering if there is anything
>>> I should do differently? If other information is needed please let me know.
>>>
>>> Thanks,
>>> Jeff
>>>
>>>
>

Re: NiFi as a service

Posted by Tim Dean <ti...@gmail.com>.
Mike -

The standard build of NiFi includes the bin/nifi.sh script, and one of the
options for that script is the install command. When executed, that command
writes a file called /etc/init.d/nifi and also manipulates a few links. I
believe that something within that file and link creation causes subsequent
apt-based commands to fail on Ubuntu - or at least on Ubuntu 16.04. I'm not
well-versed enough in different Linux startup variations to know exactly
where this is going wrong, but the workaround I provided in a previous
response is how we've avoided using the built-in install command.

On Fri, Jun 15, 2018 at 9:52 AM, Mike Thomsen <mi...@gmail.com>
wrote:

> Jeff,
>
> How did you get install NiFi as a service? I'm not aware of us offering
> any systemd configurations for NiFi as part of the standard build from
> Apache.
>
> In the mean time, I would suggest using Docker to run Mongo with NiFi if
> this is a blocker for you and the goal here is to get a development
> environment set up. If you want to do that, this is all you need:
>
> docker run -d -p 27017:27017 --name mongo1 mongo:latest
>
> docker exec -it mongo1 mongo DB_NAME_HERE
>
> Thanks,
>
> Mike
>
>
> On Fri, Jun 15, 2018 at 9:44 AM Jeff Zemerick <jz...@apache.org>
> wrote:
>
>> Hi all,
>>
>> Running NiFi 1.6.0 on Ubuntu 16.04 and I installed it as a service and it
>> worked great. On the same box, I then installed MongoDB (via apt-get). The
>> MongoDB installation failed because of errors indicating a loop in the
>> services:
>>
>> insserv: There is a loop between service nifi and mountdevsubfs if started
>> insserv:  loop involving service mountdevsubfs at depth 2
>> insserv:  loop involving service udev at depth 1
>> insserv: Starting nifi depends on plymouth and therefore on system
>> facility `$all' which can not be true!
>>
>> My knowledge around services is pretty limited. I removed the NiFi
>> service and the MongoDB install finished ok. Wondering if there is anything
>> I should do differently? If other information is needed please let me know.
>>
>> Thanks,
>> Jeff
>>
>>

Re: NiFi as a service

Posted by Mike Thomsen <mi...@gmail.com>.
Jeff,

How did you get install NiFi as a service? I'm not aware of us offering any
systemd configurations for NiFi as part of the standard build from Apache.

In the mean time, I would suggest using Docker to run Mongo with NiFi if
this is a blocker for you and the goal here is to get a development
environment set up. If you want to do that, this is all you need:

docker run -d -p 27017:27017 --name mongo1 mongo:latest

docker exec -it mongo1 mongo DB_NAME_HERE

Thanks,

Mike


On Fri, Jun 15, 2018 at 9:44 AM Jeff Zemerick <jz...@apache.org> wrote:

> Hi all,
>
> Running NiFi 1.6.0 on Ubuntu 16.04 and I installed it as a service and it
> worked great. On the same box, I then installed MongoDB (via apt-get). The
> MongoDB installation failed because of errors indicating a loop in the
> services:
>
> insserv: There is a loop between service nifi and mountdevsubfs if started
> insserv:  loop involving service mountdevsubfs at depth 2
> insserv:  loop involving service udev at depth 1
> insserv: Starting nifi depends on plymouth and therefore on system
> facility `$all' which can not be true!
>
> My knowledge around services is pretty limited. I removed the NiFi service
> and the MongoDB install finished ok. Wondering if there is anything I
> should do differently? If other information is needed please let me know.
>
> Thanks,
> Jeff
>
>