Member since
04-27-2016
218
Posts
133
Kudos Received
25
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
3207 | 08-31-2017 03:34 PM | |
6599 | 02-08-2017 03:17 AM | |
2777 | 01-24-2017 03:37 AM | |
9731 | 01-19-2017 03:57 AM | |
5310 | 01-17-2017 09:51 PM |
11-30-2016
07:30 PM
thanks for pointing this out. One way I was able to achieve this is by stopping the docker container. I wont recommend that to anyone though.
... View more
11-28-2016
03:13 PM
Can someone please point out where the web server is running for cloud controller? I would like to start and stop HDC cloud controller from command line.
... View more
11-28-2016
03:45 AM
I have NiFi flow exposed as REST endpoint using ListenHTTP processor. I am able to access the REST endpoint using java client with no issues but when I tried accessing the same endpoint using web application (html/javascript) I am getting following exception. Cross-Origin
Request Blocked: The Same Origin Policy disallows reading the remote
resource at <REST end point>.
(Reason: CORS header 'Access-Control-Allow-Origin' missing).
... View more
Labels:
- Labels:
-
Apache NiFi
11-24-2016
03:59 AM
1 Kudo
@Greg Keys NiFi is also running on sandbox. It was issue with my hive table. I see the PutHiveStreaming is successful and the files are getting written successfully. When I select from hive table it doesn't show any data, not sure why?
... View more
11-23-2016
10:01 PM
1 Kudo
I am getting following exception while invoking the putHiveStreaming processor. 016-11-23 04:16:43,024 ERROR [Timer-Driven Process Thread-4] o.a.n.processors.hive.PutHiveStreaming PutHiveStreaming[id=8f50a88f-0158-1000-4941-4b83f9b57917] Hive Streaming connect/write error, flow file will be penalized and routed to retry
2016-11-23 04:16:43,025 ERROR [Timer-Driven Process Thread-4] o.a.n.processors.hive.PutHiveStreaming
org.apache.nifi.util.hive.HiveWriter$ConnectFailure: Failed connecting to EndPoint {metaStoreUri='thrift://sandbox.hortonworks.com:9083', database='default', table='store_order', partitionVals=[] }
at org.apache.nifi.util.hive.HiveWriter.<init>(HiveWriter.java:80) ~[nifi-hive-processors-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
at org.apache.nifi.util.hive.HiveUtils.makeHiveWriter(HiveUtils.java:45) ~[nifi-hive-processors-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
at org.apache.nifi.processors.hive.PutHiveStreaming.makeHiveWriter(PutHiveStreaming.java:827) ~[nifi-hive-processors-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
at org.apache.nifi.processors.hive.PutHiveStreaming.getOrCreateWriter(PutHiveStreaming.java:738) ~[nifi-hive-processors-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
... View more
Labels:
- Labels:
-
Apache Hive
-
Apache NiFi
11-22-2016
10:22 PM
2 Kudos
sudo docker exec -i <container-id-or-name> passwd
... View more
11-22-2016
07:15 PM
I have changed the root password for docker sandbox which I have forgotten now. How can I reset it?
... View more
Labels:
- Labels:
-
Hortonworks Data Platform (HDP)
11-14-2016
09:08 PM
Yeah I figured that out in a hard way :). Thank you for clarifying.
... View more
11-14-2016
02:11 PM
I have installed solr using Ambari. It was working fine initially but after restarting the VM i am not able to start the solr service. It's throwing following exception. p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545; min-height: 14.0px} 2016-11-14 14:00:35,271 - call returned (0, 'Found 1 Solr nodes: \n\nSolr process 15690 running on port 8886\n{\n "solr_home":"/opt/ambari_infra_solr/data",\n "version":"5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:44:11",\n "startTime":"2016-11-14T13:54:33.221Z",\n "uptime":"0 days, 0 hours, 6 minutes, 1 seconds",\n "memory":"67.3 MB (%3.4) of 981.4 MB",\n "cloud":{\n "ZooKeeper":"sandbox.hortonworks.com:2181/infra-solr",\n "liveNodes":"1",\n "collections":"4"}}') 2016-11-14 14:00:35,271 - Solr status output: Found 1 Solr nodes: Solr process 15690 running on port 8886 { "solr_home":"/opt/ambari_infra_solr/data", "version":"5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:44:11", "startTime":"2016-11-14T13:54:33.221Z", "uptime":"0 days, 0 hours, 6 minutes, 1 seconds", "memory":"67.3 MB (%3.4) of 981.4 MB", "cloud":{ "ZooKeeper":"sandbox.hortonworks.com:2181/infra-solr", "liveNodes":"1", "collections":"4"}} 2016-11-14 14:00:35,271 - Solr is running, it cannot be started again Command failed after 1 tries
... View more
Labels:
11-08-2016
05:24 PM
5 Kudos
Introduction
Recently worked
with use case which required heavy xml processing. Instead of writing complex
custom code end up achieved everything easily with NiFi. I thought this will be
useful of someone interested for XML processing in NiFi. The document in
general covers the following.
Base64 Encoding and Decoding of XML
message. Character Set conversion from UTF to
Ascii ISO-8859-1 XML validation against the XSD. Split the XML into smaller chunks. Transform XML to JSON. Extract the content and outputs into
unique files based on content.
This is very generic XML processing flow which can be leveraged across
many business use cases which process xml data.
Apache NiFi Flow
In the sample demo scenario,
External
system sends the Base64 encoded XML data in file format which is read through
GetFile processor. Next
Base64EncodeContent processor decoded the Base64 content. Incoming
data in UTF-8 format with leading BOM bytes which gets converted to the ISO-8859-1
format using the ConvertCharacterSet processor. XML content
is validated against the XML schema using ValidateXML processor. The
validated XML fragment splits at the root’s children level into smaller XML
chunks. The split
xml is converted into JSON object using the XSLT and further written into
individual files. Every file
is named based on the unique identifier from the flow content.
Processor Configurations
Base64EncodeContent ConvertCharacterSet ValidateXml: Value :/Users/mpandit/jdeveloper/mywork/ClaimProcess/ClaimProcess/Initiate_App.xsd SplitXml: TransformXMLToJSON: EvalutateJsonPath UpdateAttribute
Sample Input and Outputs
Input Base64 Encoded XML:
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8+DQo8cGVyc29ucyB4bWxuczp4 c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6bm9OYW1l c3BhY2VTY2hlbWFMb2NhdGlvbj0iaGVhZGVyLnhzZCI+DQogIDxwZXJzb24+DQogICAgPGZ1bGxf bmFtZT5NUDwvZnVsbF9uYW1lPg0KICAgIDxjaGlsZF9uYW1lPkFCPC9jaGlsZF9uYW1lPg0KICA8 L3BlcnNvbj4NCiAgPHBlcnNvbj4NCiAgICA8ZnVsbF9uYW1lPkdQPC9mdWxsX25hbWU+DQogICAg PGNoaWxkX25hbWU+Q0Q8L2NoaWxkX25hbWU+DQogIDwvcGVyc29uPg0KICA8cGVyc29uPg0KICAg IDxmdWxsX25hbWU+SlA8L2Z1bGxfbmFtZT4NCiAgICA8Y2hpbGRfbmFtZT5FRjwvY2hpbGRfbmFt ZT4NCiAgPC9wZXJzb24+ICANCjwvcGVyc29ucz4=
Base64 Decoded XML through NiFi:
<?xml
version="1.0" encoding="UTF-8" ?> <persons
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="header.xsd"> <person> <full_name>MP</full_name> <child_name>AB</child_name> </person> <person> <full_name>GP</full_name> <child_name>CD</child_name> </person> <person> <full_name>JP</full_name> <child_name>EF</child_name> </person> </persons>
Output split XML fragments:
Message 1: <?xml
version="1.0" encoding="UTF-8"?><person
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <full_name>MP</full_name> <child_name>AB</child_name> </person> Message 2: <?xml
version="1.0" encoding="UTF-8"?><person
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <full_name>GP</full_name> <child_name>CD</child_name> </person> Message 3: <?xml
version="1.0" encoding="UTF-8"?><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <full_name>JP</full_name> <child_name>EF</child_name> </person>
JSON output Files:
File output 1: {
"person" : { "full_name" :
"GP", "child_name" : "CD" }} File
output 2: {
"person" : {
"full_name" : "MP",
"child_name”: "AB" }} File
output 3: {
"person" : {
"full_name" : "JP",
"child_name" : "EF" }}
Testing NiFi DataFlow
Drop the
base 64 encoded XML file which will be processed and split into smaller JSON
representation of xml data into individual files.
Apache NiFi Benefits
In built NiFi processors
significantly eliminates the need for custom code to process XML messages. Handles multi byte character
sets efficiently expanding range of character set support. The generic XML processing flow
templates can accelerate the overall development process.
Document References
https://nifi.apache.org/docs/nifi-docs/
... View more
Labels: