You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by "783725554@qq.com.INVALID" <78...@qq.com.INVALID> on 2021/09/11 11:15:11 UTC

nifi-1.13.2-can't auto load nar in k8s

hi,developers of nifi project,
I try to run nifi in k8s,and mount path /opt/nifi/nifi-current/extensions to nfs dir.
but it can't auto load nar in this path.
To solve this problem 。I and an sh script to docker images and add one line command to run it. It's realy work. 
So,i wonder whether another one who run nifi in k8s will  also meet this problem.
this is my sh script. It will copy nars from my dir to ./extensions dir, so auto load working.
when nifi is starting, this bash script will copy nar to ./extensions before nifi starting.
and when nifi is runing, it will copy nar into ./extensions ever ten second.

# copynar.sh
#/bin/bash
# author paulzhu
basedir="/opt/customnar/"
targetdir="/opt/nifi/nifi-current/extensions"
while true;do
  for entry in `ls $basedir`; do
   if [ ! -e $targetdir$entry ];then
     cp $basedir$entry $targetdir
   fi;
  done;
  sleep 10;
done;


add one line command  in ../script/start.sh

"${NIFI_HOME}/bin/copynar.sh" &

# Continuously provide logs so that 'docker logs' can    produce them
"${NIFI_HOME}/bin/nifi.sh" run &
nifi_pid="$!"



 my dockerfile


FROM apache/nifi:1.13.2
COPY copynar.sh ./bin/
COPY nifi-server-nar-1.13.2.nar /opt/nifi/nifi-current/lib
VOLUME ["/opt/customnar"]
COPY start.sh ../scripts/






your's paul.
783725554@qq.com