Created 05-22-2019 08:03 PM
I am trying to set up a registry that pulls from a Github repo and allows a connected NiFi instance to import the process groups. I am using version 0.4.0 to do this, as it is the only release implementing NIFIREG-209. There are two obstacles I am facing, one I have a solution for and another I do not:
1. Pulling down a repo and restarting will display the flow files in the Registry UI, but there are no versions and importing the Process Groups is not possible.
Solution: Remove database/nifi-registry-primary.mv.db before restarting. That causes the database to get recreated on startup and allows for Process Groups to be imported in the Nifi workspace
2. Even though the solution in 1 is implemented, I still cannot import a Process Group which uses another Process Group. When I try this I get the error:
The Flow Registry with ID <id> reports that no Flow exists with Bucket <bucket id>, Flow <flow id>, Version Name
Is this something currently being worked on, or does any fix exist that would make it possible to import the nested Process Group?
Created 05-23-2019 01:16 PM
Hey guys, I figured out the solution to obstacle #2. The issue is that PG's with other PG's inside of them will have links to the registry in the snapshot. Pulling these from Github will not replace the registry link, so I wrote a script to do that for me:
#!/bin/bash pushd flow_storage # This registry is only supposed to read changes from the Github repo, so I clear out the repository of any local changes git stash git reset --hard origin/master git pull # Replace old registry urls with the new one for all occurrences in the repo find ./**/* -name "*" -exec sed -i 's/<old registry url>/<new registry url>' \{\} \; # Changes MUST be committed in order for the registry to recognize them git add . git commit -m "Local Change" popd rm database/nifi-registry-primary.mv.db ./bin/nifi-registry.sh restart
Run this script in the nifi-registry root folder to pull in the Github master branch. Note that this script will get rid of any changes you have in the flow_storage folder, so store local commits elsewhere if you need to!
Created 05-23-2019 01:16 PM
Hey guys, I figured out the solution to obstacle #2. The issue is that PG's with other PG's inside of them will have links to the registry in the snapshot. Pulling these from Github will not replace the registry link, so I wrote a script to do that for me:
#!/bin/bash pushd flow_storage # This registry is only supposed to read changes from the Github repo, so I clear out the repository of any local changes git stash git reset --hard origin/master git pull # Replace old registry urls with the new one for all occurrences in the repo find ./**/* -name "*" -exec sed -i 's/<old registry url>/<new registry url>' \{\} \; # Changes MUST be committed in order for the registry to recognize them git add . git commit -m "Local Change" popd rm database/nifi-registry-primary.mv.db ./bin/nifi-registry.sh restart
Run this script in the nifi-registry root folder to pull in the Github master branch. Note that this script will get rid of any changes you have in the flow_storage folder, so store local commits elsewhere if you need to!