Member since
04-05-2016
139
Posts
143
Kudos Received
16
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
33554 | 02-14-2019 02:53 PM | |
2552 | 01-04-2019 08:39 PM | |
10866 | 11-05-2018 03:38 PM | |
5157 | 09-27-2018 04:21 PM | |
2793 | 07-05-2018 02:56 PM |
03-07-2018
05:58 PM
1 Kudo
Hi @hema moger Could you share your entire flow? Curious to see what is before your PublishKafkaRecord processor? Looks like you haven't set your schema.name attribute.
... View more
03-06-2018
03:25 PM
1 Kudo
Hi @hema moger Sorry if I'm misunderstanding your questions, but I think you're asking how to see the results in the last screenshot (20-kafka-consumer.png). The kafka command I used was: ./kafka-console-consumer.sh --zookeeper localhost:2181 --topic Movies --from-beginning
... View more
02-27-2018
06:30 PM
2 Kudos
Hi @Daniel Emery There isn't currently a way to pin a processor/process group. This has been suggested before as an improvement (https://issues.apache.org/jira/browse/NIFI-955).
... View more
02-23-2018
05:33 PM
Hi @spdvnz It looks like you ran into a bug that should have been addressed in NiFi 1.5.0 (https://issues.apache.org/jira/browse/NIFI-4717): If QueryRecord fails to parse data properly with the configured reader, it may roll back the session instead of routing to failure, leading the FlowFile being stuck on the queue. This includes an error message indicating that the FlowFile has an active callback or input stream that hasn't been closed. If you are able to, can you provide a template of your flow and the data file (input.csv)? Perhaps you found a scenario that was missed by NIFI-4717. Providing your template and data, will also help to diagnose if your schema is correct. As a side note, since this article was written using NiFi 1.3.0, I tried it out in NiFi 1.5.0 just to make sure and the flow worked successfully. Thanks!
... View more
02-23-2018
02:44 PM
@Kunal Gaikwad Great! Glad you got your flow working.
... View more
02-22-2018
04:50 PM
2 Kudos
@Kunal Gaikwad I used PutDatabaseRecord with a CSVReader, but have a slightly different flow that uses an UpdateAttribute processor to set the schema. So the flow is GetFile-->UpdateAttribute-->PutDatabaseRecord. Here it is as an attachment: csv-to-mysql.xml UpdateAttribute adds the attribute "schema.name" with the value of "test". CSVReader: AvroSchemaRegistry: PutDatabaseRecord: Here are the results in my database:
... View more
02-20-2018
03:10 PM
2 Kudos
@Bala S
I'm sorry I didn't realize this earlier, but I believe I know the cause of your issue as I have reproduced it.
You need to configure a localhost user in your registry. I covered this in the section "Localhost User Configuration in Registry" in this HCC article:
https://community.hortonworks.com/articles/171173/setting-up-a-secure-nifi-to-integrate-with-a-secur.html
Localhost user needs to have the following privileges:
-Read to all buckets is necessary because NiFi itself checks the status of all the flows in NiFi to determine if they are in sync with the Registry. For example, checking whether a new version of flow is available for upgrade.
-Proxy privileges are needed because when versioned flow actions occur, NiFi proxies the end user over to the Registry. For example, when saving a version to the Registry it will be done as the actual user who performed this action in NiFi. If this solves your problem, please accept this as answer so others running into it can find this solution. Thanks!
... View more
02-17-2018
01:45 AM
@Bala S
I've seen a similar error:
Unable to obtain listing of buckets: java.net.ConnectException: Connection refused
when the URL of the Registry Client (Under the top-right Global Menu-->Controller Settings-->Registry Clients tab) is incorrect.
Is there more in your Registry log (nifi-registry-app.log) Is your NiFi Registry secured? Other things to check:
-that you have buckets in your Registry
-that your user has privilege to access the buckets in your Registry
I wrote a couple articles regarding the Registry that might be useful:
https://community.hortonworks.com/articles/166802/versioned-dataflows-with-apache-nifi-15-and-apache.html
https://community.hortonworks.com/articles/170966/setting-up-a-secure-apache-nifi-registry.html
https://community.hortonworks.com/articles/171173/setting-up-a-secure-nifi-to-integrate-with-a-secur.html
... View more
02-13-2018
05:28 PM
6 Kudos
Objective
This tutorial walks you through how to secure a NiFi instance using client certificates, configure access policies in NiFi, and then how to integrate it with a secured NiFi Registry to utilize versioned flows. A video version of this tutorial can be seen here: https://youtu.be/DSO12fhnZ90
Note: This tutorial assumes you have completed Setting Up a Secure Apache NiFi Registry which resulted in a NiFi Registry instance that has been secured with client certificates for two users: "sys_admin" and "test_user". Environment
This tutorial was tested using the following environment and components:
Mac OS X 10.11.6
Apache NiFi 1.5.0
Apache NiFi Registry 0.1.0
Apache NiFi Toolkit 1.5.0 Secure NiFi Configuration Download & Extract NiFi Tarball
Download the tarball for the 1.5.0 Apache NiFi release:
nifi-1.5.0-bin.tar.gz
Extract the tar:
tar xzvf nifi-1.5.0-bin.tar.gz
NiFi Configuration
From the article
Setting Up a Secure Apache NiFi Registry, the TLS Toolkit was used to generate the following in the target directory:
CN=sys_admin_OU=NIFI.p12
CN=sys_admin_OU=NIFI.p12.password
CN=test_user_OU=NIFI.p12
CN=test_user_OU=NIFI.p12.password
localhost
nifi-cert.pem
nifi-key.key
and the following files in the
localhost directory:
keystore.jks
nifi.properties
truststore.jks
Copy the keystore, nifi.properties and trustore to the
conf directory of your NiFi install.
Verify that in
nifi.properties , the HTTP and HTTPS web properties are as follows:
nifi.web.http.host=
nifi.web.http.port=
nifi.web.https.host=localhost
nifi.web.https.port=9443
In the same NiFi
conf directory, modify authorizers.xml in two places. In the userGroupProvider section, add the "sys_admin" DN to the "Initial Admin Identity 1" property:
<property name="Initial User Identity 1">CN=sys_admin, OU=NIFI</property>
Then in the
accessPolicyProvider section, add the "sys_admin" DN to the "Initial Admin Identity" property:
<property name="Initial Admin Identity">CN=sys_admin, OU=NIFI</property>
Note: During this step, it is crucial that you specify the exact DN string used when the TLS Toolkit was invoked. A common error is entering "CN=sys_admin,OU=NIFI" which will not work as it has a missing space after the comma. Start NiFi and Open UI
In a terminal window, navigate to the directory where NiFi was installed and run:
./bin/nifi.sh start
Note: The "sys_admin" and "test_user" .p12 certificates should have already been added to the Keychain.
Navigate to the NiFi UI in your web browser (Chrome used in the following examples):
https://localhost:9443/nifi
When prompted, select the "sys_admin" cert to add to your browser:
You should now be able to view the NiFi UI as the "CN=sys_admin, OU=NIFI" user:
Setup NiFi Access Policies for Sys_Admin
The "sys_admin" user can view the NiFi UI, but has no permissions to make any changes. To correct this, select "Access Policies" (key icon) from the Operate Palette to modify the policies on the Root Process Group:
For the "view the component" policy, select "Create" to create a new policy and add "sys_admin" to the policy:
Do the same for the "modify the component" policy:
Close the Access Policies window and the NiFi components toolbar is now enabled:
Setup NiFi for Test_User
The "test_user" also requires some setup to enable that user to access the NiFi UI.
First go to the Global Menu in the top-right corner of the UI and select "Users":
Add "CN=test_user, OU=NIFI" as a NiFi User:
Close the "NiFi Users" dialog and select "Policies" from the Global menu:
and add "test_user" to the "view the user interface" policy:
Finally, similar to what was done previously for "sys_admin", select "Access Policies" from the Operate Palette and add "test_user" to the "view the component" policy:
as well as to the "modify the component" policy:
Navigate to the NiFi UI in another web browser (Safari used in the following examples):
https://localhost:9443/nifi
When prompted, select the "test_user" cert to add to your browser:
You should now be able to view the NiFi UI as the "CN=test_user, OU=NIFI" user:
Connect NiFi Registry
Now we will connect our secure Registry to our secure NiFi instance.
Return to the browser where you are logged into NiFi as the "sys_admin" user. Select "Controller Settings" from the top-right Global menu:
Select the Registry Clients tab and the "+" button to add a new Registry Client. Enter a name and the URL of the Registry instance (https://localhost:18443):
Localhost User Configuration in Registry
The last configuration step is to add "CN=localhost, OU=NIFI" as a user in the Registry and configure its privileges.
Log in to your secured Registry instance as "sys_admin".
Note: As mentioned at the beginning of this tutorial, it is assumed that you have a secured NiFi Registry instance running already with "sys_admin" and "test_user" users from completing Setting Up a Secure Apache NiFi Registry.
Select the Settings icon (
) in the top right corner of the screen. Select "Users" at the top and then select the "Add User" button.
Enter "CN=localhost, OU=NIFI" for the Identity/Username and select "Add":
Select the pencil icon (
) next to the "CN=localhost, OU=NIFI" user:
In the side nav that appears, check the privileges "Read" buckets and "Can proxy user requests":
Read to all buckets is necessary because NiFi itself checks the status of all the flows in NiFi to determine if they are in sync with the Registry. For example, checking whether a new version of flow is available for upgrade. Proxy privileges are needed because when versioned flow actions occur, NiFi proxies the end user over to the Registry. For example, when saving a version to the Registry it will be done as the actual user who performed this action in NiFi.
You are now ready to start using NiFi and NiFi Registry together. NiFi and NiFi Registry Interaction
Return to the browser where "sys_admin" is the NiFi user. "Sys_admin" has full registry bucket privileges. Create a new process group "PG_SA":
Right click on the process group and select "Version-->Start version control":
Since "sys_admin" has full privleges to buckets, the bucket "ABC" is is available to save the versioned flow to. Add the flow name "PG_SA_Flow" and select "Save":
The process group is now under version control as evidenced by the green checkmark icon on the component:
Now go to the browser where "test_user" is the NiFi user. "Test_user" only has read privileges to registry buckets. To demonstrate, create a process group "PG_TU":
Right click on the process group and select "Version-->Start version control". However, in the "Save Flow Version" dialog, you will see that there are no available buckets to save the flow to:
Close the dialog and drag a process group onto the canvas. Select "Import". In the Import Version dialog, the "ABC" bucket is accessible and the "PG_SA_Flow" in that bucket can be imported:
Select Version 1 and then the "Import" button. A copy of "PG_SA_Flow" is added to the canvas:
With the "sys_admin" having full access to the registry settings/administration, you can further explore the effects in NiFi after changing the privileges for "test_user". Additional Help
If you would like to learn more about NiFi Registry functionality and working with versioned flows in NiFi, see the following articles:
Versioned DataFlows with Apache NiFi 1.5 and Apache NiFi Registry 0.1.0
Apache NiFi - How do I deploy my flow?
Or documentation:
Apache NiFi Registry User Guide
Apache NiFi Registry System Administrator's Guide
Versioning a DataFlow (Apache NiFi User Guide)
... View more
Labels:
02-09-2018
03:28 PM
@Ramkrishna Utpat, That's great to hear! Glad you were able to get the tutorial working.
... View more