Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
Building an Apache NiFi processor is super easy. I have seen/read several articles on how to get started by executing maven commands via CLI. This article is geared towards individuals who like to use an IDE (specially IntelliJ) to do the imports instead of running via CLI.On IntelliJ click on create project, Check "Create from archetype", click on "ADD Archetype" and enter the followingGroupId: org.apache.nifiArtifactId: nifi-processor-bundle-archetypeVersion: <YourVersionOfNifi>and then click "OK"Now your new NiFi Archetype has been created. Select itEnter GroupId, ArtifactId, and Version of your choiceA final attribute we need to add is artifactBaseName. This is mandatory. Click on "+" and enterName: artifactBaseNameValue: whatEverYouLikeNow a project ready to build a custom processor.Enjoy!
Following are the steps to connect to Phoenix tables using Spark2.1) Create a symlink of hbase-site.xml in spark2 confln -s /etc/hbase/conf/hbase-site.xml /etc/spark2/conf/hbase-site.xml2) Launch spark-shell using phoenix spark jars in extra classpath.spark-shell --conf "spark.executor.extraClassPath=/usr/hdp/current/phoenix-client/phoenix-4.7.0.2.6.3.0-235-spark2.jar:/usr/hdp/current/phoenix-client/phoenix-client.jar" --conf "spark.driver.extraClassPath=/usr/hdp/current/phoenix-client/phoenix-4.7.0.2.6.3.0-235-spark2.jar:/usr/hdp/current/phoenix-client/phoenix-client.jar"3) Create a phoenix connection and query the tables.scala> import org.apache.spark.sql.SQLContextimport org.apache.spark.sql.SQLContextscala> val sqlContext = new SQLContext(sc)sqlContext: org.apache.spark.sql.SQLContext = org.apache.spark.sql.SQLContext@495e8a3scala> val df = sqlContext.load("org.apache.phoenix.spark",Map("table" -> "TABLE1", "zkUrl" -> "localhost:2181"))df: org.apache.spark.sql.DataFr
UPDATE: This article has been vetted against HDF 2.0 - HDF 3.2. Minor updates have been made for additional clarity on use of NiFi CA for establishing trust with Ranger. Prerequisites NiFi has been installed running with SSL enabled (with certificates manually installed or using the NiFi Certificate Authority). You will need the keystore/truststore names, locations, aliases, identity (DN) and passwords used when enabling SSL for NiFi. Ensure that all nodes have the same keystore/truststore passwords applied and like named locations in order to apply ranger nifi plugin configurations consistently via Ambari. Ranger has been installed and configured with security enabled. For instructions on setting up SSL for Ranger please review Configure Ambari Ranger SSL . Note the name, location, aliases, identity (DN) and passwords used when creating keystores and truststores for Ranger If Kerberos will be used recommend that this is enabled for the HDF cluster before proceeding. Part 1 - Estab
To enable HTTPS for web HDFS, do the following: Step 1: Get the keystore to use in HDFS configurations.a) In case cert is getting signed by CA, do the following:1. Generate a keystore for each host. Make sure the common name portion of the certificate matches the hostname where the certificate will be deployed.keytool -genkey -keyalg RSA -alias c6401 -keystore /tmp/keystore.jks -storepass bigdata -validity 360 -keysize 20482. Generate CSR from above keystorekeytool -certreq -alias c6401 -keyalg RSA -file /tmp/c6401.csr -keystore /tmp/keystore.jks -storepass bigdata3. Now get the singed cert from CA - file name is /tmp/c6401.crt4. Import the root cert to JKS first. (Ignore if it already present)keytool -import -alias root -file /tmp/ca.crt -keystore /tmp/keystore.jksNote: here ca.crt is root cert5. Repeat step4 for intermediate cert if there is any.6. Import signed cert into JKSkeytool -import -alias c6401 -file /tmp/c6401.crt -keystore /tmp/keystore.jks -storepass bigdata7. I
IntroductionBefore the official release of Cloudera Data Flow (ex. Hortonworks Data Flow), you may want to play with Nifi and Hive on CDH.However, because CDH 5 is using a fork of Hive 1.1, the HiveQL processors and controller services included on the official Apache release will not work, so you need to have your own, as explained in this article: Connecting NiFi to CDH Hive.This article is awesome, but does not focus on Kerberos/SSL; since I had to do the configuration myself, I thought I would share the knowledge.Note: You could use a DBCP connection to connect to Cloudera Hive but it will not allow you to use the proper authentication.Pre-RequisitesTo connect to Hive with SSL and Kerberos, you will need the following:A running version of Nifi (I used Apache 1.9 in this example)A Kerberized CDH cluster with Hive on SSL (I used CDH 5.15 in this example)The certificate to add to your keystore for SSL connectionA keytab for a specific user authorized in the clusterThe krb5 configuratio
In the previous article, we saw how to stream tweets using NiFi, Kafka, Tranquility, Druid and Superset ...https://community.hortonworks.com/articles/177561/streaming-tweets-with-nifi-kafka-tranquility-druid.html You have to implement in that previous article, the part of Druid datasource and Nifi flow to carry on here. But life already is hard enough, why not simplify it? The idea here is to perform the same streaming but now integrating Nifi directly to Druid. So, our new diagram would look like this: As we saw in that article, we have Tranquility as an integrating factor between Kafka and Druid. Some people asked me: Why not use Kafka Indexing Service instead of Tranquility? My answer: because Tranquility as a framework, can be used flexibly, doing integration of almost any component to the Druid. Thus, on this nifi-druid integration, we will build a custom Nifi processor, which uses Tranquility to integrate data directly into Druid. Ok, it’s time to hands on! Let
In NiFi/HDF, it is possible to create a kind of lookup table of key/value pairs using a DistributedMapCacheServer. The DistributedMapCacheServer is used by various processors such as GetHBase and DetectDuplicate. It can also be leveraged by users in their flows, with the PutDistributedMapCache and FetchDistributedMapCache processors, by specifying a corresponding DistributedMapCacheClientService.Sometimes, however, it might be the case that the user would like to interact with the DistributedMapCacheServer programmatically (and external to NiFi), say for removing specific entries, inserting/populating entries, etc. To that end I have written a Groovy script (dcachegroovy.txt, rename to dcache.groovy) to allow manipulation of the entries in a DistributedMapCacheServer from the command-line, e.g.The usage is as follows:Usage: groovy dcache.groovy <hostname> <port> <command> <args> Where <command> is one of the following: get: Retrieves the values for the key
IntroductionTime for the tutorial 1 of a series detailing how to go from AI to Edge!Note: all code/files referenced in this tutorial can be found on my github, here.AgendaThis tutorial is divided in the following sections:Section 1: Create a custom Docker container running Jupyter for CDSWSection 2: Automate Jupyter launch in a CDSW projectSection 3: Train and save a model reading MNSIT databaseSection 1: Create a custom Docker container running Jupyter for CDSWThis is fairly straight forward to implement, as it is detailed in the official documentation.Note: make sure that dock is signed in with your Dockerhub username/password (not email) otherwise the docker push will not work.Step 1: Create a repository in docker hubGo to docker hub and sign in with your account. Create a new repository as follows:You should see something like this:Step 2: Creating a custom docker fileGo to a folder on your computer can create this docker file (saving it as Dockerfile😞FROM docker.repository.cloude
IntroductionMachine Learning and Artificial Intelligence frameworks are numerous and their impact on the future of computer science need no emphasis. However, deploying these models can be complex and fairly manual without the appropriate multi-function ecosystem, especially when deploying these models to the edge.Luckily, Cloudera comprehensive data management suite make this endeavor very easy.During this series, I will present how to create a Deep Learning model trained to read digits from the MNIST database and deploy it to the edge.This article is an introduction to the architecture and pre-requisites necessary for this tutorial. It will refer to sub articles that will be tutorials that anyone can follow to implement understand how to take an AI model and operationalize it to the edgeArchitecture overviewThe figure below gives a highlight of my hybrid cloud platform:As you can see, it is comprised of the three main functions:Cloudera Data Science Workbench: data science hub used t
Introduction Parquet is a famous file format used with several tools such as Spark. NiFi can be used to easily convert data from different formats such as Avro, CSV or JSON to Parquet. This article explains how to convert data from JSON to Parquet using the PutParquet processor. Implementation Define a schema for the source data In this article I'll be using JSON data source with the following structure: {"created_at" : "Tue Oct 10 21:47:12 CEST 2017","id_store" : 4,"event_type" : "store capacity","id_transaction" : "6594277248900858122","id_product" : 319,"value_product" : 1507664832649} Since we will be using a record based processor, we need to define a schema for our data. This will be an Avro schema but it can be used with other types as well. It's only "a common langage" that helps us describe a schema. The Avro Schema for my data is the following: { "namespace": "nifi", "name": "store_event", "type": "record", "fields": [ { "name": "created_at", "type": "string" }, { "name": "
Objective This tutorial walks you through a NiFI flow that utilizes the ConvertRecord processor and Record Reader/Writer controller services to easily convert a CVS file into JSON format. Additionally, the flow is modified to also convert the CSV file to Avro and XML formats. Note: The record-oriented processors and controller services were introduced in NiFi 1.2.0. As such, the tutorial needs to be done running Version 1.2.0 or later.Environment This tutorial was tested using the following environment and components: Mac OS X 10.11.6 Apache NiFi 1.3.0Convert CSV to JSONSupport Files Here is a template of the flow discussed in this tutorial: convert-csv-to-json.xml Here is the CSV file used in the flow: users.txt (Change the extension from .txt to .csv after downloading) Note: The CSV data originated from the site, RandomUser. This useful site provides a free API to pull down randomly generated user data. For example: https://randomuser.me/api/0.6/?results=10&forma
Cloudbreak 2.9.1 maintenance release is now available.If you are using an earlier version of Cloudbreak, you can upgrade now to pick up the latest bug fixes.If you are new to Cloudbreak, you can get started by launching Cloudbreak on AWS, Azure, GCP, or OpenStack from a template.Useful links:Release notesUpgrade stepsGet started on AWSGet started on AzureGet started on GCP
Below properties can be used to configure the log4j settings for size based compressed backup.Here is an example for Hive service. log4j.appender.DRFA.layout=org.apache.log4j.PatternLayoutlog4j.appender.DRFA=org.apache.log4j.rolling.RollingFileAppenderlog4j.appender.DRFA.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy log4j.appender.DRFA.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy log4j.appender.DRFA.rollingPolicy.ActiveFileName =${hive.log.dir}/${hive.log.file}.loglog4j.appender.DRFA.rollingPolicy.FileNamePattern=${hive.log.dir}/${hive.log.file}-.%i.log.gzlog4j.appender.DRFA.triggeringPolicy.MaxFileSize=10000log4j.appender.DRFA.rollingPolicy.maxIndex=10For some reason maxfilesize is not working if used like 1MB like that - so use live above.Note: please check console log (.out or .err) for any WARNINGS if does not work
In this article we will be creating a flow to read files from hdfs and insert the same into hive using the putHiveStreaming processor.Before going to NiFi we need update some configurations in Hive.To enable Hive streaming we need to update the following properties hive.txn.manager = org.apache.hadoop.hive.ql.lockmgr.DbTxnManagerhive.compactor.initiator.on = truehive.compactor.worker.threads > 0Coming to NiFi we will be making use of the following processors : 1.ListHdfs + FetchHdfs processor – While configuring the List and Fetch HDFS processors we need to make sure that both these processors run on the primary node only so that the flow files are not duplicated across nodes2.Convert Json to Avro processor – PutHiveStreaming processor supports input in the Avro format only. So any Json input needs to be converted to avro format3.PutHiveStreaming processorLets construct the Nifi flow as below : ListHDFS--> FetchHDFS--> ConvertJsonToAvro-->PutHiveStreamingConfiguring the Put
AbstractTensorflow-serving with Apache Hadoop 3.1 and YARN resource management. YARN manages the startup, control and destroys the Tensorflow-serving Docker container in a Hadoop cluster. Client applications using RESTful API calls to communicate with the ML application, i.e. to make predictions. Infrastructure SetupAllocate a Centos 7.4 virtual machine and install:- Docker CE Installation and start Docker- Installation of required packages: amber, curl, wget, unzip, git - Install and Download HDP Sandbox version see this Article Docker on Yarn - Sandboxwget https://github.com/SamHjelmfelt/Amber/archive/master.zipunzip master.zipcd Amber-master./amber.sh createFromPrebuiltSample samples/yarnquickstart/yarnquickstart-sample.iniOutput snippet:...Verifying ambari-agent process status...Ambari Agent successfully startedAgent PID at: /run/ambari-agent/ambari-agent.pidAgent out at: /var/log/ambari-agent/ambari-agent.outAgent log at: /var/log/ambari-agent/ambari-agent.logWaiting for agent he
Sometimes Ambari Metrics stops displaying data in the dashboards.Or You may be getting time out issues that were not solved (see https://community.hortonworks.com/questions/4726/ambari-metric-collector-error-sending-metric-to-se.html)At other times, especially on a new install you may receive this error in the Collector Log2016-01-25 15:33:31,195 WARN org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultPhoenixDataSource: Unable to connect to HBase store using Phoenix.org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table undefined. tableName=SYSTEM.CATALOG.This is usually due to AMS Data being corrupt. Shut down Ambari Monitors, and Collector via Ambari Cleared out the /var/lib/ambari-metrics-collector dir for fresh restart From Ambari -> Ambari Metrics -> Config -> Advanced ams-hbase-site get the hbase.rootdir and hbase-tmp directory Delete or Move the hbase-tmp and hbase.rootdir directories to an archive folder Started
PurposeUtility helps to collect and compare the hadoop configurations between two or more clusters.Source https://github.com/karthikhw/ambari/blob/master/bin/compare.shUsage ./compare.shInputsHow many clusters you want to compare :Ambari Username :Ambari Password :Hostname :Ambari Server Port :Clustername :Is ambari URL secure (y/n)? (HTTPS/HTTP):Note Run it in ambari serverService configurations are retrieved from ambari via the curl request.
As a Hadoop Admin it’s our responsibility to perform Hadoop Cluster Maintenance frequently. Let’s see what we can do to keep our big elephant happy! 😉1. FileSystem Checks We should check health of HDFS periodically by running fsck command sudo -u hdfs hadoop fsck / This command contacts the Namenode and checks each file recursively which comes under the provided path. Below is the sample output of fsck command sudo -u hdfs hadoop fsck /FSCK started by hdfs (auth:SIMPLE) from /10.0.2.15 for path / at Wed Apr 06 18:47:37 UTC 2016Total size: 1842803118 BTotal dirs: 4612Total files: 11123Total symlinks: 0 (Files currently being written: 4)Total blocks (validated): 11109 (avg. block size 165883 B) (Total open file blocks (not validated): 1)Minimally replicated blocks: 11109 (100.0 %)Over-replicated blocks: 0 (0.0 %)Under-replicated blocks: 11109 (100.0 %)Mis-replicated blocks: 0 (0.0 %)Default replication factor: 3Average block replication: 1.0Corrupt blocks: 0Missing replicas: 22232 (66.6
My blood recently turned from green to blue (after the Hortonworks-Cloudera merger) and I couldn't be more excited to play with new toys. What I am particularly excited about is Cloudera Data Science Workbench. But, like in everything I do, I am very lazy. So here is a quick tutorial to install Altus Director, and use it to deploy a CDH 5.15 + CDSW cluster.Step 1: Install Altus DirectorMany ways to do that, but the one I chose was the AWS install, detailed here: https://www.cloudera.com/documentation/director/latest/topics/director_aws_setup_client.htmlThe installation documentation is very well done, but here are the important excerptsCreate a VPC for your Altus instanceFollow the documentation.Few important points:In the name of laziness I also recommend to add a 0-65535 rule from your personal IP.Your VPC should have an internet gateway associated with it (you could do it without, but would require you manually pulling the CM/CDH software down and make internal repositories within y
IntroductionCFM is out for CDH and that's awesome. While the install documentation is very thorough, I thought I'd share a screenshot based tutorial, avoiding some of the gotchas of the installationPre-RequisitesHealthy CDH 6.2 clusterAdmin privileges on the cluster and its nodeswget installedOpen JDK 1.8 installed (see doc)Zookeeper service installed (see doc)Step 1: Get the CFM CSD FilesConnect to your Cloudera Manager node as root, and enter the following:cd /opt/cloudera/csdwget http://archive.cloudera.com/CFM/csd/1.0.0.0/NIFI-1.9.0.1.0.0.0-90.jarwget http://archive.cloudera.com/CFM/csd/1.0.0.0/NIFICA-1.9.0.1.0.0.0-90.jarwget http://archive.cloudera.com/CFM/csd/1.0.0.0/NIFIREGISTRY-0.3.0.1.0.0.0-90.jarchown cloudera-scm:cloudera-scm NIFI*.jar chmod 644 NIFI*.jar service cloudera-scm-server restartAfter restart, log to CM and restart the Cloudera Management Service:Wait for the restart to finish:Step 2: Get the CFM ParcelGo to the parcels configuration (parcel icon top right):Go to
Customers have asked me about wanting to review ranger audit archive logs stored on HDFS as the UI only shows the Last 90 days of data using Solr infra. I decided to approach the problem using Zeppelin/Spark for a fun example.1. Prerequisites - Zeppelin and Spark2 installed on your system. As well as ranger with ranger audit logs being stored in HDFS. Create a policy in ranger for HDFS to allow your zeppelin user to read and execute recursively for /ranger/audit directory.2. Create your notebook in Zeppelin and create some code like the following example:%spark2.spark// --Specify service and date if you wish//val path = "/ranger/audit/hdfs/20190513/*.log"// --Be brave and map the whole enchiladaval path = "/ranger/audit/*/*/*.log"// --read in the json and drop any malformed jsonval rauditDF = spark.read.option("mode", "DROPMALFORMED").json(path)// --print the schema to review and show me top 20 lines.rauditDF.printSchema()rauditDF.show(20,false)// --Do some spark sql on the data and lo
If Ambari wrongly shows as "Add Service Wizard in Progress", starting from Ambari-2.5.x you can fix this reset the UI state.here is the steps.1. Go to http://AMBARI-HOST:8080/#/experimental 2. Click on "Reset UI state" button3. Now login and check the UI. it will be showing all the service options.Note: This is applicable only from Ambari-2.5.x
This article will demonstrate how to install anaconda on an HDP 3.0.1 instance and the configuration to enable Zeppelin to utilize the anaconda python libraries to use with apache spark.Pre-requisites:bzip2 library needs to be installed prior to installing anacondaStep 1. Download and Install Anacondahttps://www.anaconda.com/download/#linuxFrom the following link, download the anaconda installer. It will be a large bash script around 600MB in size. Please land this file in an appropriate directory like /tmp.Once downloaded, provide the installer with executable permissions.One completed, the installer can be executed. Please execute with a user with sudo privileges. Follow the prompts and accept the license agreements. As a best practice, please install anaconda in a separate directory than the default. /opt is the default for my installations.At the very end of the installation it will prompt the user to initialize the install in the installing users basrc file.If you have a mulit-no
Oozie job submit fails in HDP-3.0 with below error:Error: E0723 : E0723: Unsupported action type, node [hive] type [org.apache.oozie.service.ActionService].It looks like failure is because Oozie is not aware of Hive action type. When I checked value of oozie.service.ActionService.executor.ext.classes in oozie-site.xml, I found that it was set to below value:<property> <name>oozie.service.ActionService.executor.ext.classes</name> <value> org.apache.oozie.action.email.EmailActionExecutor, org.apache.oozie.action.hadoop.ShellActionExecutor, org.apache.oozie.action.hadoop.SqoopActionExecutor, org.apache.oozie.action.hadoop.DistcpActionExecutor</value></property>Note - Hive action type and other supported action types like Spark/Spark2 is missing in this. I'm still working with our engineering to find out why this is happening with recent Oozie version, earlier it used to work without any issues. I will keep you posted on this..To fix this issue:
In the previous articles, we showed how to deploy an HDF 2.0 cluster, enable SSL for Nifi and setup the Ranger Nifi plugin. Now we will build on the same cluster and show how to enable kerberos from Ambari using MIT KDC.Summary To achieve this, the high level steps we will follow are:Setup MITC KDCRun Ambari security wizardCreate principal for nifiadmin user in KDCCreate Ranger policy for nifiadmin userDelete certificate from browserLogin to Nifi using KDC principal credentialsSteps 1. Setup MIT KDCHigh level steps to setup KDC:Install KDC rpmsConfigure KDC (krb5.conf)Create KDC databaseStart krb5kdc/kadmin servicesCreate admin principalMake user an administrator by adding to kadm5.aclRestart krb5kdc/kadmin servicesScript to automate KDC setup (run below on Ambari node)export realm=HORTONWORKS.COMexport domain=hortonworks.comexport kdcpassword="BadPass#1"curl -sSL https://gist.github.com/abajwa-hw/f8b83e1c12abb1564531e00836b098fa/raw | sudo -E shTest KDC is up by running below on Amba
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.