Support Questions

Find answers, ask questions, and share your expertise

Steps to deploy custom Nars

avatar
Contributor

Hi All,

Is there any steps we have to deploy custom nars because i am facing the below errors when deploying custom nars in default lib dir.

https://community.hortonworks.com/questions/97610/nifi-javalangnosuchmethoderror.html

Please advice.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Anishkumar Valsalam

In a Nifi cluster you need to make sure you have uploaded you new custom component nars to every node in the cluster.

I do not recommend adding your custom nars directly to the existing NiFi lib directory. While this works, it can become annoying to manage when you upgrade NiFi versions. NiFi allows you to specify an additional lib directory where you can place your custom nars. Then if you upgrade, the new version can just get pointed at this existing additional lib dir.

Adding additional lib directories to your NiFi is as simple adding an additional property to the nifi.properties file.

for example:

nifi.nar.library.directory.lib1=/nars-custom/lib1
nifi.nar.library.directory.lib2=/nars-custom/lib2

Note: Each prefix must be unique (i.e. - lib1 and lib2 in the above examples). These lib directories must be accessible by the user running your NiFi instance.

Thanks,

Matt

View solution in original post

2 REPLIES 2

avatar
Super Guru

@Anishkumar Valsalam

Once you have developed a custom NAR file, you simply have to drop it in /usr/hdf/current/nifi/lib/ folder and restart Nifi. Once Nifi is restarted, you should be able to see your new custom processor along with other processors.

avatar
Master Mentor

@Anishkumar Valsalam

In a Nifi cluster you need to make sure you have uploaded you new custom component nars to every node in the cluster.

I do not recommend adding your custom nars directly to the existing NiFi lib directory. While this works, it can become annoying to manage when you upgrade NiFi versions. NiFi allows you to specify an additional lib directory where you can place your custom nars. Then if you upgrade, the new version can just get pointed at this existing additional lib dir.

Adding additional lib directories to your NiFi is as simple adding an additional property to the nifi.properties file.

for example:

nifi.nar.library.directory.lib1=/nars-custom/lib1
nifi.nar.library.directory.lib2=/nars-custom/lib2

Note: Each prefix must be unique (i.e. - lib1 and lib2 in the above examples). These lib directories must be accessible by the user running your NiFi instance.

Thanks,

Matt