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.
[email protected]

Reply via email to