Created 08-21-2018 04:10 PM
This repo in github indicates that I can setup nifi docker to use environment variables.
https://github.com/apache/nifi/blob/master/nifi-docker/dockerhub/README.md
I have setup NIFI_ZK_CONNECT_STRING environment variable in openshift as shown in screenshot below.
This setup is however not working as the openshift pod for Nifi fails to start.
Does nifi.properties support environment variables? The GitHub code indicates it would, but below blog post says it would not.
Can you please clarify is this is possible?
Created 08-21-2018 05:50 PM
The answer that tells that environment variables are not possible is from 1 year ago, the latest docker image of Apache Nifi at the docker hub is 1 month old. I might be wrong, but the startscript in the container seems to set the variables in the config file, so both might be true, the nifi.properties still doesn't allow environment vars, but the docker image does it.
Anyway my assumption is that your error isn't related to the environmental variables, but to something more basic, as the errors says "0: illegal option -", and we need to figure it out. Does your start-script screenshot show the $NIFI_HOME/bin/nifi-env.sh from the docker image?
Created 08-21-2018 05:50 PM
The answer that tells that environment variables are not possible is from 1 year ago, the latest docker image of Apache Nifi at the docker hub is 1 month old. I might be wrong, but the startscript in the container seems to set the variables in the config file, so both might be true, the nifi.properties still doesn't allow environment vars, but the docker image does it.
Anyway my assumption is that your error isn't related to the environmental variables, but to something more basic, as the errors says "0: illegal option -", and we need to figure it out. Does your start-script screenshot show the $NIFI_HOME/bin/nifi-env.sh from the docker image?
Created 08-22-2018 08:33 PM
@Harald Berghoff
It appears that the start.sh script had to be changed to Unix format. I thought about this late in the day today and that fixed the issue. The NiFi pod is now up and running in openshift with environment variables set-up for ZK connect string.
Created 08-23-2018 04:33 PM
web tutorial in welookups.com
Created 01-15-2019 09:33 PM
@Prachi Sharma Would you might sharing your findings on github. I am facing something similar issue.
Created 01-16-2019 04:48 PM
I was able to follow the github link I have posted above and setup environment variable in openshift and apply them in the script start.sh
The only thing I had to do is convert the script to the Unix format in my text editor as openshift was having trouble running it when deploying the pod and starting nifi.
If you are having a specific issue I could help with that but currently its all working as described in github.