Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
Apache NiFi provides several processors for receiving data over a network connection, such as ListenTCP, ListenSyslog, and ListenUDP. These processors are implemented using a common approach, and a shared framework for receiving and processing messages.When one of these processors is scheduled to run, a separate thread is started to listen for incoming network connections. When a connection is accepted, another thread is created to read from that connection, we will call this the channel reader (the original thread continues listening for additional connections). The channel reader starts reading data from the connection as fast as possible, placing each received message into a blocking queue. The blocking queue is a shared reference with the processor. Each time the processor executes it will poll the queue for one or more messages and write them to a flow file. The overall setup looks like the following:There are several competing activities taking place: The data producer is writin
When running Apache NiFi behind a proxy there are a couple of key items to follow during deployment. 1) NiFi is comprised of a number of web applications (web ui, web api, documentation, custom ui's, data viewers, etc). So the mapping needs to be configured for the root path. That way all context paths are passed through accordingly. For instance, if only the /nifi context path was mapped, the custom ui for UpdateAttribute will not work since it's available at /update-attribute-ui-<version>. 2) NiFi's REST API will generate URI's for each component on the graph. Since requests are coming through a proxy, certain elements of the URI's being generated need to be overridden. Without overriding the users will be able to view the dataflow on the canvas but will be unable to in modify existing components. Requests will be attempting to call back directly to NiFi, not through the proxy. The elements of the URI can be overridden by adding the following HTTP headers when the proxy gener
If you have not attended a DataWorksSummit, I highly recommend it. It is an amazing event held at three locations a year and is a great community experience. The content is deep and highly technical and you will learn about the current state of the art and what is coming next. It's not just Big Data, but AI, Streaming, Microservices, Containers, Cloud and many other topics that startups and enterprises alike need to know.My topic was a simple talk on using Apache NiFi to ingest and transform various data types.There is a small group forming around my quickly released Inception V3 TensorFlow Apache NiFi Processor, I encourage you to try it and provide feedback, pull requests, bug reports, documentation, unit tests, examples and more. The Java API for TensorFlow is new so this is really basic. Thanks to @Simon Elliston Ball for a major cleanup on it.https://github.com/tspannhw/nifi-tensorflow-processorWhat do we want to do?MiniFi ingests camera images and sensor data Run TensorFl
HDFS per-user Metrics aren't emitted by default. Kindly exercise caution before enabling them and make sure to refer to the details of client and service port numbers.To be able to use the HDFS - Users dashboard in your Grafana instance as well as to view metrics for HDFS per user, you will need to add these custom properties to your configuration.Step-by-step guidePresumption for this guide:This is a HA environment with dfs.internal.nameservices=nnha and dfs.ha.namenodes.nnha=nn1,nn2 in Ambari, HDFS > Configs > Advanced > Custom hdfs-site1. In Ambari, HDFS > Configs > Advanced > Custom hdfs-site - Add the following properties.dfs.namenode.servicerpc-address.<dfs.internal.nameservices>.nn1=<namenodehost1>:8050dfs.namenode.servicerpc-address.<dfs.internal.nameservices>.nn2=<namenodehost2>:8050ipc.8020.callqueue.impl=org.apache.hadoop.ipc.FairCallQueueipc.8020.backoff.enable=trueipc.8020.scheduler.impl=org.apache.hadoop.ipc.DecayRpcScheduleripc
DescriptionLearn how to consume real-time data from the Satori RTM platform using NiFi.BackgroundSatori is a cloud-based live platform that provides a publish-subscribe messaging service called RTM, and also makes available a set of free real-time data feeds as part of their Open Data Channels initiative:https://www.satori.com/docs/using-satori/overviewhttps://www.satori.com/opendata/channelsThis article steps through how to consume from Satori's Open Data Channels in NiFi, using a custom NiFi processor. Note - the article assumes you already have a working version of NiFi up and running.Link to code on github: https://github.com/laurencedaluz/nifi-satori-bundleInstalling the custom processorTo create the required nar file, simply clone and build the following repo with maven:git clone https://github.com/laurencedaluz/nifi-satori-bundle.gitcd nifi-satori-bundlemvn clean installThis will make the following .nar file under the nifi-satori-bundle-nar/target/ directory:nifi-satori-bundle-n
Log Search is a log analysis / monitoring tool which is shipped with Ambari. Log Search has 2 components: Log Search Portal (server + web) and Log Feeder. The second one is responsible to monitor specific log files and ship the parsed log lines into Solr. To define which files should be monitored and how the parsing should work for those files, you will need input config descriptors (list of the input config descriptors are located in /etc/ambari-logsearch-logfeeder/conf/logfeeder.properties, all of them are defined in logfeeder.config.files configuration property, on ambari managed Log Search service, those can be found in logfeeder-properties/logfeeder.config.files configuration entry)If you have a specific custom service (see: https://cwiki.apache.org/confluence/display/AMBARI/Custom+Services), to support that inside Log Search application you will need a *-logsearch-conf.xml (* can be a custom name, Ambari will generate input.config-*.json file based on the name inside /etc/ambari-
Understanding scale issues in AMS (Why does it hapen)The Metrics Collector component is the central daemon that receives metrics from ALL the service sinks and monitors that sends metrics. The collector uses HBase as its store and phoenix as the data accessor layer.In a high level, the metrics collector performs 2 operations related to scale in a continuos basis. Handle raw writes - A raw write is a bunch of metric data points received from services written onto HBase through phoenix. There is no read or aggregation involved. Periodically aggregate data - AMS aggregates data across cluster and across time. Cluster Aggregator - Computing the min,max,avg and sum of memory across all hosts is done by a cluster aggregator. This is called a 'TimelineClusterAggregatorSecond' which runs every 2 mins. In every run it reads the entire last 2 mins data and calculates aggregates and writes back. The read is expensive since it has to read non-aggregated data, while the write volume is smaller s
Working with airbnb's SupersetThis is a very cool open source Analytics platform based on some cool Python.I installed this on a CentOS 7 edge node.sudo yum upgrade python-setuptoolssudo yum install gcc libffi-devel python-devel python-pippython-wheel openssl-devel libsasl2-devel openldap-develpip install virtualenvvirtualenv venv. ./venv/bin/activatepip install --upgrade setuptools pippip install mysqlclient pip install pyhivepip install supersetfabmanager create-admin --app superset2017-01-27 18:15:37,864:INFO:flask_appbuilder.security.sqla.manager:Created PermissionView: menu access on Query Search2017-01-2718:15:37,885:INFO:flask_appbuilder.security.sqla.manager:Added Permission menuaccess on Query Search to role AdminRecognized Database Authentications.2017-01-2718:15:37,907:INFO:flask_appbuilder.security.sqla.manager:Added user adminAdmin User admin created.superset db upgradesuperset load_examplessuperset initsuperset runserver -p 8088The main things you will need are PythonBrow
Installing the Alarm Fatigue Demo via Cloudbreak:There are multiple ways to deploy the Alarm Fatigue Demo via Cloudbreak. Below are four options:1) Deploy via the Cloudbreak UILogin to https://cbdtest.field.hortonworks.comb) Select your credentials – if you credentials don’t exist, create them under “Manage Credentials”c) Once your credentials are selected, click “Create Cluster”d) Make-up a cluster name and choose the Availability Zone (SE) and then click “Setup Network and Security"e) “fieldcloud-openstack-network” should be selected and click “Choose Blueprint”f) Select the Blueprint called “alarm_fatigue_v2”Host Group 1 (Select Ambari Server, alarm-fatigue-demo and pre-install-java8)Host Group 2 (select pre-install-java8)Host Group 3 (select pre-install-java8)g) Click on “Review and Launch”e) Click on “Create and start cluster” (After clicking, the deployment via Cloudbreak will likely take 30-50 minutes, go get a coffee)2) Deploy via Bash Script (specifying configuration file)Crea
A colleague recently asked me how to create a custom function for Hive using Python. You can pretty much create a function in any language and plug it into your Hive query using the Hive TRANSFORM clause. TRANSFORM lets you add your own mappers and/or reducers to process the data. The example in this article is working code that I wrote a few years ago using an early version of Hive to demonstrate how to add a custom function. In earlier versions of Hive we had to implement our own functions to hash sensitive data for PII compliance. Beginning with Hive 1.3 the SHA2 UDF was added to calculate a hash using SHA-224, SHA-256, SHA-384, or SHA-512. In my example below I create a custom UDF using Python to calculate the SHA-256 hash for social security number. Keep in mind that when I did this there were no out of the box Hive UDF’s available. This example is to only demonstrate how to write your own custom functions for Hive using Python. First, we need to write some python code that will r
If the cluster has only one queue at root level named 'default' and is consuming 100% of the capacity, Ambari will create a queue named 'llap' when HSI is enabled for the 1st time, which is set to (depends on which value is smaller) either : - the minimum required %age for LLAP to work, or - at 20% of cluster's capacity. --------------------------------------------------------------------------------------------------------------------------------------------------------------------If this is not the case, where there are more than one queue in cluster, user will have to create/set the queue capacity %age in order to be used for LLAP app. Starting with minimum required for queue capacity (shown below), one can increase the queue %age size in order to add up the LLAP nodes in the cluster, as queue size is one of the primary drivers of how many Node Managers nodes will be running LLAP.Reference code for calculating minimum queue size.Following calculations can be a good reference in orde
Objective This tutorial demonstrates how to use the QueryDatabaseTable and PutKudu processors to read data from a MySQL database and put into Kudu. Thanks to @Cam Mach for his assistance with this article. Note: The PutKudu processor was introduced in NiFi 1.4.0.Environment This tutorial was tested using the following environment and components: Mac OS X 10.11.6 Apache NiFi 1.4.0 Apache Kudu 1.5.0 MySQL 5.7.13PutKudu (AvroReader)Demo ConfigurationMySQL Setup In your MySQL instance, choose a database ("nifi_db" in my instance) and create the table "users": unix> mysql -u root -punix> Enter password:<enter>mysql> use nifi_db;mysql>CREATE TABLE `users` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, `title` text, `first_name` text, `last_name` text, `street` text, `city` text, `state` text, `zip` text, `gender` text, `email` text, `username` text, `password` text, `phone` text, `cell` text, `ssn` text, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCRE
I've seen several systems with 400+ million objects represented in the Namenode without issues. In my opinion, that's not the "right" question though. Certainly, the classic answer to small files has been the pressure it put's on the Namenode but that's only a part of the equation. And with hardware / cpu and increase memory thresholds, that number has certainly climbed over the years since the small file problem was documented.The better question is: How do small files "impact" cluster performance? Everything is a trade-off when dealing with data at scale. The impact of small files, beyond the Namenode pressures, is more specifically related to "job" performance.Under classic MR, the number of small files controls the number of mappers required to perform a job. Of course, there are tricks to "combine" inputs and reduce this, but that leads to a lot of data back planing and increased cluster I/O chatter. A mapper in the classic sense, is a costly resource to allocate. If the actual ta
By definition, Atlas provides a scalable and core foundational services for Data Governance - enabling enterprises to efficiently and effectively meet their compliance requirements with their Hadoop eco system. However, it is a complex application, which is built using the integration of various components in the Hadoop eco system. Below are the components involved in the Architecture: AtlasRangerHiveHBaseAmbari InfraKafkaThe intention of this article is to provide troubleshooting tips if Ambari install is not functioning correctly.Install validation and troubleshooting tips: Make sure Atlas Metadata Server and Atlas Metadata clients are installed from Ambari.Install Ranger Tagsync component if you wish to do authorization control using Atlas Tags in Ranger.Make sure the below Kafka topics are created in Kafka: ATLAS_HOOKATLAS_ENTITIES You can check this by using the following command on any of the kafka brokers: (In Kerberized cluster you need kafka key tab to run this command)/usr/hd
Update Feb 2018 - Updated article for HDF 3.1: https://community.hortonworks.com/articles/173816/automate-deployment-of-hdf-31-clusters-using-ambar.htmlSummary:Ambari blueprints can be used to automate setting up clusters. With Ambari support being added to HDF 2.0, the same can be done for HDF clusters running Nifi, Storm, Kafka. This article shows how you can use ambari-bootstrap project to easily generate a blueprint and deploy HDF clusters to both either single node or development/demo environments in 5 easy steps. If you prefer, a script is also provided at the bottom of the article that automates these steps, so you can deploy the cluster in a few commands. Tested with HDF 2.x and 3.0There is also a single node HDF 2.1 demo cluster available on AWS as an AMI which can be brought up in 10 min. Details herePrerequisite: A number of freshly installed hosts running CentOS/RHEL 6 or 7 where HDF is to be installedReminder: Do not try to install HDF on a env where Ambari or HDP are alre
Apache Ranger let's you control the users who can submit the jobs to Yarn queues. Demo 1 ) Default queue User demouser can submit jobs to default queue and can be controlled from Ranger UI Demo 2) Non-Default queue User demouser can submit jobs to spark queue and can be controlled from Ranger UI Happy Hadooping!! More information
Scenario: The cluster is using both Hive and Atlas components.Sometimes a simple query like 'show databases' fails with the error stack shown below:beeline> show databases;Getting log thread is interrupted, since query is done!Error: Error while processing statement: FAILED: Hive Internal Error: java.util.concurrent.RejectedExecutionException(Task java.util.concurrent.FutureTask@e871c01 rejected from java.util.concurrent.ThreadPoolExecutor@5b868755[Running, pool size = 1, active threads = 1, queued tasks = 10000, completed tasks = 14807]) (state=08S01,code=12)java.sql.SQLException: Error while processing statement: FAILED: Hive Internal Error: java.util.concurrent.RejectedExecutionException(Task java.util.concurrent.FutureTask@e871c01 rejected from java.util.concurrent.ThreadPoolExecutor@5b868755[Running, pool size = 1, active threads = 1, queued tasks = 10000, completed tasks = 14807])at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:282)at org.apache.hive.beeline.Co
When starting spark-shell, it tries to bind to port 4040 for the SparkUI.If that port is already taken because of another spark-shell session active, it tries then to bind on 4041, then 4042, etc.Each time the binding didn't suceed, there's a huge WARN stack trace which could be filtered[user@serv hive]$ SPARK_MAJOR_VERSION=2 spark-shell SPARK_MAJOR_VERSION is set to 2, using Spark2 Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). 17/09/20 11:49:43 WARN AbstractLifeCycle: FAILED ServerConnector@2d258eff{HTTP/1.1}{0.0.0.0:4040}: java.net.BindException: Address already in use java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.spark_project.jetty.server
Please follow below steps for running SparkR script via Oozie.1. Install R packages on all the node managersyum -y install R R-devel libcurl-devel openssl-devel.2. Keep your R script readyHere is the sample scriptlibrary(SparkR) sc <- sparkR.init(appName="SparkR-sample") sqlContext <- sparkRSQL.init(sc) localDF <- data.frame(name=c("ABC", "blah", "blah"), age=c(39, 32, 81)) df <- createDataFrame(sqlContext, localDF) printSchema(df) sparkR.stop() .3. Create workflow.xmlHere is the working example:<workflow-app xmlns='uri:oozie:workflow:0.5' name='SparkFileCopy'> <global> <configuration> <property> <name>oozie.launcher.yarn.app.mapreduce.am.env</name> <value>SPARK_HOME=/usr/hdp/2.5.3.0-37/spark</value> </property> <property> <name>oozie.launcher.mapred.child.env</name> <value>SPARK_HOME=/usr/hdp/2.5.3.0-37/spark</value> </property> </configuration> </global> <start to='spa
When the FSImage file is large (like 30 GB or more), sometimes due to other contributing factors like RPC bandwidth, network congestion, request queue length etc, it can take a long time to upload/download. This in turn can leads the Zookeeper to believe that the NameNode is not responding. It displays the SERVICE_NOT_RESPONDING status. Thereafter, it triggers a failover transition.The logs display the following statements:2017-09-04 05:02:26,017 INFO namenode.TransferFsImage (TransferFsImage.java:receiveFile(575)) - "Combined time for fsimage download and fsync to all disks took 237.14s. The fsimage download took 237.14s at 141130.21 KB/s. Synchronous (fsync) write to disk of /opt/hadoop/hdfs/namenode/image/current/fsimage.ckpt_0000000012106114957 took 0.00s. Synchronous (fsync) write to disk of /var/hadoop/hdfs/namenode/image/current/fsimage.ckpt_0000000012106114957 took 0.00s..2017-09-04 05:02:26,018 WARN client.QuorumJournalManager (IPCLoggerChannel.java:call(388)) - Remote journal
Two YARN Queues have been setup - default, llap Whichever queue is marked as Hive LLAP Queue (Interactive Query Queue), that queue does not process any queries/jobThe following are the steps to reproduce the issye: There are two YARN Queues setup.In Ambari, default queue is selected for LLAP from the Interactive Query Queue drop down (Ambari > Hive > Configs > Interactive Query Queue dropdown).Any job/query submitted to default queue does not run. However, all queries submitted to LLAP queue runs successfully. Using the same process listed above, change the Interactive Query Queue to LLAP.Any query/job submitted to LLAP queue does not run. However, all queries submitted to default queue runs successfully.Basically, at any time, the LLAP queue does not run any job/query.Root Cause:This issue occurs when there is an issue with queue prioritization, where both queues have priority set to 0 which means both are of equal priority. This can be viewed from Ambari > Yarn Queue Man
Scenario 1: Only one instance of Spark Thrift Server is neededApproach:If you are installing the Spark Thrift Server on a Kerberos-secured cluster, the following instructions apply: The Spark Thrift Server must run in the same host as HiveServer2, so that it can access the hiveserver2 keytab.Edit permissions in /var/run/spark and /var/log/spark to specify read/write permissions to the Hive service account. /var/run/spark and /var/log/spark should be able read/write to hive. So, just seeing contents as user hive is not enough, you need to be able to write to those folders. One way is to give 77x permissions on these folders. Since spark:hadoop is owner:group and hive belongs to group hadoop, it will have write access with this setup.Use the Hive service account to start the thriftserver process.It is recommend that you run the Spark Thrift Server as user hive instead of user spark. This ensures that the Spark Thrift Server can access Hive keytabs, the Hive metastore, and data in HDFS th
1) Download the Ambari Integration module and HDFS transparency connector. You can get it here.2) Stop all the services from Ambari. Ambari -> Actions -> Stop All3) After successfully stopping all the services, Go to Spectrum Scale service and Unintegrate transparency. SpectrumScale -> Service Actions -> Unintegrate TransparencyThis step will replace the HDFS transparency modules with native HDFS and add back Secondary Namenode.4) Delete the Spectrum Scale service. Type "delete" to confirm deletion. SpectrumScale -> Service Actions -> Delete Service5) Extract the tar file downloaded in Step 1 in your Ambari Server node and run the mPack uninstaller../SpectrumScaleMPackUninstaller.pyThe uninstaller prompts for few values such as Ambari IP, username etc. Enter them.6) Performing above steps will delete the service from Ambari. Restart Ambari server and Start all services.Ambari -> Actions -> Start AllIf you were using a existing ESS clusters, the nodes would be st
Hadoop Auth [1] is a Java library which enables Kerberos SPNEGO authentication for HTTP requests. It enforces authentication on protected resources, after successful authentication Hadoop Auth creates a signed HTTP Cookie with an authentication token, username, user principal, authentication type and expiration time. This cookie is used for all subsequent HTTP client requests to access a protected resource until the cookie expires. Given Apache Knox's pluggable authentication providers it is easy to setup Hadoop Auth with Apache Knox with only few configuration changes. The purpose of this article to describe this process in detail and with examples. Assumptions: Here we are assuming that we have a working Hadoop cluster with Apache Knox ( version 0.7.0 and up [2] ) moreover the cluster is Kerberized. Kerberizing the cluster is beyond the scope of this article. Setup: To use Hadoop Auth in Apache Knox we need to update the Knox topology. Hadoop Auth is configured as a provider so
This article shows a simple NiFi data flow from the web to HDFS that demonstrates several fundamental capabilities of NiFi, including:iterating the flow from an external configuration filegroovy scripting to transform contentgroovy scripting that imports an external jar libraryNiFi expression languageThe article may be particularly useful for newcomers to NiFi.OverviewThe NiFi flow is shown below. At a very high-level, an InvokeHTTP processor will retrieve in sequence the RSS feeds from a list of URLs that are configured locally. RSS feeds return XML content and one feed URL returns multiple XML item elements, each representing one news story and structured by child elements like title, description, etc. A groovy script will transform each XML-formatted feed response to produce a set or records. Each record is one news story (item element) with title, description etc extracted from the XML as tab-separated values. Additionally, HTML formatting is stripped from those values. The t
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.