How to import a flow to NiFi registry in CDP Cloud
$ ssh -i [path_to_private_key] cloudbreak@[your_nifi_host]
Next, copy and authorize the key and trust stores:
$ sudo su
$ cp /var/lib/cloudera-scm-agent/agent-cert/cm-auto-host_keystore.jks /tmp
$ cp /var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks /tmp
$ chmod a+rw /tmp/cm-auto-host_keystore.jks
$ chmod a+rw /tmp/cm-auto-global_truststore.jks
Step 2: Create a registry.properties file
Go to /tmp (for instance) and create the following file - registry.properties file:
baseUrl=https://fod-nifi-cluster-gateway0.fod-cdp.a465-9q4k.cloudera.site:18433
keystore=/tmp/cm-auto-host_keystore.jks
keystoreType=JKS
keystorePasswd=[YOUR_KEYSTORE_PWD]
keyPasswd=[YOUR_KEYSTORE_PWD]
truststore=/tmp/cm-auto-global_truststore.jks
truststoreType=JKS
truststorePasswd=[YOUR_TRUSTSTORE_PWD]
proxiedEntity=[YOUR_USER_AUTHORIZED_IN_RANGER]
Notes:
- I'm not going to expose the method to get your password for keystore and truststore
- It is important that you add a proxied entity with your workload user that is authorized in ranger to use the registry (find your user in the CDP management console)
Next, download the flow you want to import, for instance:
wget https://raw.githubusercontent.com/paulvid/datasets/master/hybrid-demo/nifi-flow/NiFi_Flow.json
Step 3: Run the import
Run these command lines:
$ /opt/cloudera/parcels/CFM-2.0.6.0/TOOLKIT/bin/cli.sh
Apache (_) .' ..](_) ,
_ .--. __ _| |_ __ )\
[ `.-. | [ |'-| |-'[ | / \
| | | | | | | | | | ' '
[___||__][___][___] [___]', ,'
`'
CLI v1.11.4.2.0.6.0-27
Type 'help' to see a list of available commands, use tab to auto-complete.
Session loaded from /home/pvidal/.nifi-cli.config
#> registry create-bucket -p registry.properties --bucketName hybrid-cloud
dfc33699-0317-4893-82c4-8a12ad6ed822
#> registry create-flow -p registry.properties -b dfc33699-0317-4893-82c4-8a12ad6ed822 -fn hybridflow
8d2e7f87-f176-4f34-9788-72be034e4a3f
#> registry import-flow-version -p registry.properties -f 8d2e7f87-f176-4f34-9788-72be034e4a3f -i NiFi_Flow.json
1
#> exit
Step 4: Import the flow in the UI
- Navigate to the NiFi UI, and add a processor group. Then, click Import:

- Select the bucket and flow we just imported using CLI:

- After clicking Import, your flow is successfully available!


