Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
Integrating Darknet YOLOv3 Into Apache NiFi WorkflowsDarknet has released a new version of YOLO, version 3. This one is a faster and perhaps more accurate. It's new and shiny and I had to try it. I am liking the results.Flow to Execute ScriptWe call the shell script, then I route out the empty results. I use SplitText to split into individual lines. I use Extract Text with ([^:]+):(.*) to split into our name, value pairs.We also want to process the images produced by YOLOv3.We grab the newest ones from the output directory. I also add meta data extraction and Tensorflow analysis. This data is stored in attributes and can be saved independently via using AttributesToJSON to build a new flow file that we save off separate probably converting into Apache ORC and storing in HDFS for Apache Hive querying. The image file we can store in the cloud, another file system, send to a front end or save in HDFS. Or even email it to someone.The parsed YOLOv3 results in Apache NiFi Att
By default, hiveserver2 doesn't have an entry in the hive-env.sh that provides a way to change the type of GC. The CMS collector is designed to eliminate the long pauses associated with the full GC cycles of the throughput and serial collectors. CMS stops all application threads during a minor GC, which it also performs with multiple threads.In order to change the type of GC:Ambari > Hive > Configs > Advanced hive-env > hive-env template > Add the follow properties. if [ "$SERVICE" = "hiveserver2" ]; then if [ -z "$DEBUG" ]; then export HADOOP_OPTS="-server -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:ErrorFile=/var/log/hive/$USER/hs_err_pid%p.log -XX:NewSize=200m -XX:MaxNewSize=200m -Xloggc:/var/log/hadoop/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms1024m -Xmx1024m" else export HADOOP_OPTS="-server -XX:P
A quick glance at NiFi’s 252+ processors shows that it can solve a wide array of use cases out of the box. What is not immediately obvious is the flexibility that its attributes and expression language can provide. This allows it to quickly, easily, and efficiently solve complex use cases that would require significant customization to solve in other solutions.For example, sending all of the incoming data to both Kafka and HDFS while sending 10% to a dev environment and a portion to a partner system based on the content of the data (e.g. CustomerName=ABC). These more complex routing scenarios are easily accommodated using UpdateAttribute, RouteOnAttribute, and RouteOnContent. Another example of NiFi’s flexibility is the ability to multiplex data flows. In traditional ETL systems, the schema is tightly coupled to the data as it moves between systems, because transformations occur in transit. In more modern ELT scenarios, the data is often loaded into the destination with minimal transfo
SYMPTOMS: During HDP upgrades, namenode restart would fail leading to upgrade failure. Following errors are usually seen:-Traceback (most recent call last):File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/jmx.py", line 42, in get_value_from_jmxreturn data_dict["beans"][0][property]IndexError: list index out of rangeTraceback (most recent call last):File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 420, in <module>NameNode().execute()File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in executemethod(env)File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 720, in restartself.start(env, upgrade_type=upgrade_type)File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 101, in startupgrade_suspended=params.upgrade_suspended, env=env)File "/usr/lib/python2.6/site-packages/amba
Can not start run livy jobs from Zeppelin The following can be seen in livy log file: INFO: Caused by: org.apache.hadoop.security.authentication.client.AuthenticationException: Authentication failed, URL: http://rangerkms.example.com:9292/kms/v1/?op=GETDELEGATIONTOKEN&doAs=w20524%4542test.tt&renewer=r m%2Fsktudv01hdp02.test.tt%40CCTA.DK&user.name=livy, status: 403, message: ForbiddenRoot Cause: Missing proxy users for livy in kms. The solution is to add the following into Ambari Custom kms-sitehadoop.kms.proxyuser.livy.users=* hadoop.kms.proxyuser.livy.hosts=* hadoop.kms.proxyuser.livy.groups=*
1. Install Java 8. Mac should have the Java 6 installed with the OS. We recommend you switch to Java 8 as Hadoop trunk branch does.2. Install Xcode from the App Store3. Install homebrew, the missing package manager for Mac OS X 4. Install all necessary system tools/libraries (mainly maven, make) brew install maven autoconf automake cmake libtool 5. Install the protobuffer package which is heavily used in Hadoop IPC layer.Install homebrew versions brew tap homebrew/versionsInstall the protobuf package version 2.5 brew install homebrew/versions/protobuf250 6. Clone Hadoop git repository git clone git://git.apache.org/hadoop.git 7. Build the Hadoop project using maven mvn clean package -Pdist,native -Dtar -DskipTests=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true 8. Install IntelliJ IDEA IDE. This is much better than Eclipse. 9. Create a new project using the existing source. Do use the Maven option if asked. 10. Start coding! Bonus followup: there is a known bug in the TestGetTr
Performing a sqoop import using 'hive-import' into a data type char() or varchar() fails with17/06/05 14:04:44 INFO mapreduce.Job: Task Id : attempt_1496415095220_0016_m_000002_0, Status : FAILEDError: java.lang.ClassNotFoundException: org.apache.hadoop.hive.serde2.SerDeException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) Working example. Create the Teradata and hive tables as follows:Terdata> create table td_importme_into_hive (col1 int not null primary key, col2 char(30));Hive> create table td_import (col1 int, col2 char(30)); Executesqoop import --connection-manager {connection info} \ --table td_importme_into_hive --hive-import --hive-table td_import \ -m 1 --split-by col1 This will fail as char / varchar are not supported Hive datatypes for sqoop import from Teradata.Create the hive table with datatype string instead of char() or varchar().
Accessing Feeds from EtherDelta on Trades, Funds, Buys and Sells (Cryptocurrency Analysis)EtherDelta lets you trade Ether or Ethereum-based tokens. Ethereum (https://www.ethereum.org/) is an open-source block chain platform for running smart contracts. They provide a fast web-socket feed of all data coming through the system. We can tap this websocket feed with Apache NiFi to examine and ingest all the trades, funds, buys and sells coming through the system as JSON. Once we ingest, clean up, parse and schematize the data we can run queries on it with Apache Spark SQL and Apache Hive in Apache Zeppelin notebooks. Now the data scientists have a continuing stream of data to play with. Next we will start adding additional feeds from other Ethereum exchanges, Bit Coin APIs and other sources of data. Some of the APIs are REST, some are websockets and some are SDKs. All of these are easy to ingest with Apache NiFi.Initial Ingest from EtherDelta via Web Sockets APIRoute To The
Iy you have deployed and secured your multi-node-cluster with an MIT KDC running on a Linux box (dedicated or not), this can also be applied on a single node cluster.Below is a step by step procedure to grant a group of user(s) on the Edge node with access to services in the cluster. Assumption KDC is running KDC is created KDC user and a master password is available REALM: DEV.COMUsers: user1 to user5Edge node: for users Kerberos Admin user is root or sudoer A good solution security-wise is to copy the generated keytabs to that users' home directory. If these are local Unix users NOT Active directory then create the keytabs in e.g /tmp and later copy them to their respective home directories and make sure to change the correct permissions on the keytabs. A good practice is to ensure a node dedicated to users usually called an EDGE NODE all client software is installed here and not on the Data or Name Nodes! Change directory to tmp# cd /tmp If you have root access, no need for sudo, s
In this article, I'm going to cover a simple solution to control the data processing in NiFi serially or based on an event trigger.This article use Wait and Notify processors and DistributedMapCache controller service to achieve this functionality. Follows the links to the Usage Guide of these processors and Controller Services.Wait ProcessorNotify ProcessorDistributedMapCache ServerDistributedMapCache client serviceNiFi FlowThe flow that I am going to present in this article has a very simple use case. Get the data from the source, at whatever rate, but process it one flow file at a time. Once a flow file is processed, it should trigger the processing of the next flow file. Follows a step by step explanation of what I have implemented to solve this problem.First, the pre-requisites to start the flow.We will be storing the DistributedMapCache to store and retrieve the "signals" to process the flow files and hence we would need the Server and Client Service for that. Follows a quick des
This article is based on the following Kaggle competition: https://www.kaggle.com/arjunjoshua/predicting-fraud-in-financial-payment-services It is a Scala-based implementation of the data science exploration written in Python. In addition to training a model, we also have the ability to batch-evaluate a set of data stored in a file through the trained model. Full configuration, build, and installation instructions can be found at the GitHub repo: https://github.com/anarasimham/anomaly-detection When you execute the model training, you'll get various lines of output as the data is cleaned and the model is built. To view this output, use the link provided by the Spark job console output. This will look like the following: 18/05/10 14:33:58 INFO Client:client token: N/Adiagnostics: N/AApplicationMaster host: <HOST_IP>ApplicationMaster RPC port: 0queue: defaultstart time: 1525962717635final status: SUCCEEDEDtracking URL: http://<SPARK_SERVER_HOST_NAME>:8088/proxy/applicatio
Note: HDP 2.5 is used, but can be updated for HDP 2.6 and beyond.Boot an Amazon Linux instance with at least 16GB of RAMExecute the following. It will take a while ## install dockersudo yum update -ysudo yum install -y docker## fix docker for importing the large sandbox imagesed -i.backup 's/\(^OPTIONS=.*\)"$/\1 --storage-opt=dm.basesize=20G"/' /etc/sysconfig/docker## start dockersudo service docker start## confirm docker is workingsudo usermod -a -G docker ec2-userdocker info## download docker imagecurl -O http://hortonassets.s3.amazonaws.com/2.5/HDP_2.5_docker.tar.gz## load docker imagedocker load -i HDP_2.5_docker.tar.gz## confirm image is availabledocker images## get sandbox docker startup scriptcurl -O https://raw.githubusercontent.com/hortonworks/tutorials/hdp-2.5/tutorials/hortonworks/hortonworks-sandbox-hdp2.5-guide/start_sandbox.sh## start sandboxbash start_sandbox.sh## configure to start at bootecho "bash /root/start_sandbox.sh" >> /etc/rc.local## Print the URL for acce
Automating Social Media: Sending Tweets with Apache NiFi: Building A Smart BotThis is the new processor, PutTwitterProcessor, it will use Twitter4J to send tweets from a parameter you set.This is an example tweet and my reply to it. It's a regular tweet.This is the result of a run. I put the tweet id and datetime stamp in the result attribute.Another example:You need to create a Twitter application and obtain the Consumer Key, Consumer Secret, Access Token and Access secret. If you have a lat and long in your data you can send that. It's optional. The message takes expression language and lets you build a message.JUnit Test of my ProcessorJUnit Run ResultsMost of the code is using the very easy to use Twitter4J library.So what can I do with this? In my flow I am ingesting Tweets and with a streaming SQL query I can retweet ones where there's no existing retweet and the followers of the tweet are more than 1,000. I can also feed all this information to a Hive table and
How to set up a Ranger enabled cluster using Ambari-blueprint.In order to setup a cluster using Ambari blueprints we will need a minimum three node cluster.Lets say this cluster contains three hosts as below:secure-ranger-a.comsecure-ranger-b.comsecure-ranger-c.comPre-requisites: To setup a Ranger enabled cluster we need to install ambari-server on one of the hosts which can be the called the gateway node and ambari-agents should be installed on all the nodes including the gateway node.All the ambari-agents should be configured to point to the ambari-server on the gateway node.Note : The operating system used for this setup is Cent-OS.Lets consider the gateway node to be simple-ranger-a.com, to install ambari-server on this host we need to add ambari repository to the OS repositories.To update the OS repository we add ambari.repo file to /etc/yum.repos.d/ directory.Next we do a refresh of the OS repositories using command yum clean allThen we run the command yum install -y ambari-serve
As an extension to the article mentioned here we are using custom Ambari alerts to monitor the current state of the Journal Node edits health. With the default monitoring that is present in the Ambari, we would not be alerted about the failure of edits that may happen in the one of the JN quorum. In typical HDFS HA env, there are three Journal node daemons that are deployed. If any one of the daemons fails to maintain the edits, then we are at risk of failovers and eventual cluster outage if another journal node hits similar issue as other journal node (Because, if quorum of edits are not maintained, then NN fails to be up). Hence, we need to have necessary alerting mechanism put in place for such failures. Journal Nodes may not get updated due to various reasons such as,1. Disk getting full.2. Corrupt Permissions.3. Exhausted HDFS handlers in JN host, etc..Attached are the artifacts, which contains,1. alerts-test.json 2. jn_edits_tracker.pyjn_edits_tracker.py have preconfigured value
To create a simple Java 8 application to use to extract text from PDFs and then identify people's names, I have create a simple data application. This can be used as part of a larger Data Processing Pipeline or HDF flow by calling it via REST, Command Line or converting it to a NiFi Processor.<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.dataflowdeveloper</groupId> <artifactId>categorizer</artifactId> <packaging>jar</packaging> <version>1.0</version> <name>categorizer</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version>
FlowWe can remove Sentiment if you don't want to install my custom processor:This is what they look like:I grab some fields I like:These are fields I want to save:This is a simple version of the flow to just ingest tweets, run sentiment analysis and store in directory as clean JSON.You can drop the sentiment analysis and do it later. You can also run a python script for that.We could make this simpler and just have GetTwitter then PutFile. This will store the RAW Twitter JSON file which is a very sparse nested JSON file. if you want the raw data, that is an option. It's a pain to work with that format and not perfect for analytics. I flatten it and just grab what I have seen as the core attributes, you can add more or drop some of them easily.This is a simple version that could be used for Art or Personal Projects or anyone who wants to store their own tweets and related items.Get Your Twitter ID: https://tweeterid.com/Documentation: https://developer.twitter.com/en/docs/
Tracking Air Quality with HDP and HDF: Part 1 - Apache NiFi IngestPart 2: Plan Data Storage. Store to Apache Hive, Apache Druid and Apache HBase.Part 3: Query and Visualize Data with Apache Zeppelin and SupersetThere was an Air Quality alert a few days ago near me and I was curious how I could keep track of this important environmental information. So NiFi! This data is different from weather data, but makes a lot of sense for analytics to add in data from Weather, Social and locally captured cameras. It's very easy to ingest these JSON and Camera Images via Apache NiFi. In the next section we will analyze the datasets and determine how we can aggregate and accumulate massive quantities of this data for tracking air quality in various areas over time and use that as a dimension with other relevant data like weather.We are tracking contaminants and particles in the air.These include: pm25, pm10 - atmospheric particulate matterso2 - sulfur dioxideno2 - nitrogen dioxideo3
Summary:While automating setup of Hortoniabank demo, we needed to automate the task of associating Atlas tags to HDP entities like HDFS, Hive, HBase, Kafka using the names of entities (rather than their guids in Atlas). One option is to use Atlas APIs to find the entity you are looking for using qualifiedName attribute and then use the guid to associates tag to it. For components like Hive that already have Atlas hook, the Atlas entities for Hive tables will automatically be created when the table is created. For these, we have just provided the API calls to associate the tags with the entity.For others like Kafka, HDFS, Hbase etc that do not have an Atlas hook (as of HDP 2.6.x), you will need to create the entity first. For these, we have provided both the API call to create the entity and the call to associate the tags with the entity.Code samples:The below code examples assume the tags have already been created. these can be created either manually via Atlas UI or using the API. Her
Short Description:This Tutorial describes how to use DeleteHBaseRow processor to delete one or more row keys in HBase table.Thanks alot @Ed Berezitsky helping out to write this article.Introduction:NiFi 1.6 introduced DeleteHbaseRow processor, based on the row key values provided to this Processor, deletes those row key/s in Hbase table. This processor does deleteall operation on the row key that we intended to delete from the hbase table.This Processor works with row key values are presented as FlowFile Content (or) FlowFile attributes.We can select Row ID Location in this processor one of the below ways, by default this property configured to have FlowFile content as the value.1. FlowFile content -Get the row key(s) from the flowfile content.2. FlowFile attributes -Get the row key from an expression language statement. 2.1. Having one row key value associated with the flowfile.2.2. Having more than one row key values associated with the flowfile.DeleteHBaseRow Processor Params:Clien
Converting CSV Files to Apache Hive Tables with Apache ORC FilesI received some CSV files of data to load into Apache Hive. There are many ways to do this, but I wanted to see how easy it was to do in Apache NiFi with zero code.I read CSV files from a directory of files. Then I can Convert the CSV to AVRO directly with ConvertRecord.I will need a schema, so I use the below settings for InferAvroSchema. if ever file is different, you will need to do this every time.CSV ReaderI use the Jackson CSV parser which works very well. The first line of the CSV is a header. It can figure out the fields from the header.Once I have an Apache AVRO file it's easy to convert to Apache ORC and then store in HDFS.Template:csvprocess.xml
Assume you have a MySQL database server running on mysqlserver.example.com. Summary of the steps MySQL set up Set up a grafana database on mysqlserver.example.com Create a MySQL user called grafana, assign and flush privileges Edit the grafana.ini configuration file to enable use of MySQL (Edit the Advanced ams-grafana-ini section in the Ambari Metrics Config tab in Ambari) Start the Grafana Starting Grafana creates the grafana tables. The session table however does not get created and the grafana docs say to create it for MySQL and postgres - so create the session table as per the grafana docs http://docs.grafana.org/installation/configuration/ Start Grafana - and all should be well Detailed steps On MySQL server (be sure to change the password): mysql> create database grafana;Query OK, 1 row affected (0.01 sec)mysql> GRANT USAGE ON `grafana`.* to 'grafana'@'mysqlserver.example.com' identified by 'grafanamysqlpasswd';Query OK, 0 rows affected (0.00 se
DataWorks Summit (DWS) is the industry’s Premier Big Data Community Event in Europe and the US. The last DWS was in Berlin, Germany, on April 18th and 19th. This was the 6th year occurence in Europe and this year there was over 1200 attendees from 51 different countries, 77 breakouts in 8 tracks, 8 Birds-of-a-Feather sessions and 7 Meetups. I had the opportunity to attend as a speaker this year, where I gave a talk on “Best practices and lessons learnt from Running Apache NiFi”. It was a joint talk with the Big Data squad team from Renault, a French car manufacturer. The presentation recording will be available on the DWS website. In the meantime, I’ll share with you the 3 key takeaways from our talk.NiFi is an accelerator for your Big Data projectsIf you worked on any data project, you already know how hard it is to get data into your platform to start “the real work”. This is particularly important in Big Data projects where companies aim to ingest a variety of data sources ranging f
Issue:This issue has been observed on an HDP cluster running NiFi service with HDF 3.0.1 managed by Ambari 2.6.1.5.HDF 3.0.1 is supported only with Ambari 2.5.1 version. Therefore, in situation where you upgrade Ambari from 2.5.x to 2.6.y HDF services like NiFi won't start & complain the error shared in the below stack trace.To handle this, you have to upgrade HDF mpack from 3.0.1 to 3.0.2 after the Ambari upgrade is complete. This additional activity is required to get the HDF service working with Ambari 2.6.y. Also, this step is independent of the HDF upgrade that you would have planned separatelystderr:Traceback (most recent call last): File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py", line 309, in <module> Master().execute() File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 375, in execute method(env) File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py
ETL With Lookups with Apache HBase and Apache NiFi(Microservices Style ETL)When we are ingesting tabular / record-oriented data, we often want to enrich the data by replacing ids with descriptions or visa-versa. There are many transformations that may need to happen before the data is in a happy state. When you are denormalizing your data in Hadoop and usually building very wide tables you often want descriptions or other data to enhance it's usability. Only one call to get everything you need is nice, especially when you have 100 trillion records.We are utilizing a lot of things built already (https://community.hortonworks.com/articles/146198/data-flow-enrichment-with-nifi-part-3-lookuprecord.html). Make sure you read Abdelkrim's first 3 lookup articles. I added some fields to his generated data for testing. I want to do my lookups against HBase which is a great NoSQL store for lookup tables and generate datasets.First I created an HBase Table to use for lookups.Create HBase
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.