Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
Apache NiFi is an extremely versatile tool that can be used in just about ANY streaming/real-time architecture to enable rapid development and efficient monitoring and maintenance. Often times it is easiest to learn by doing something hands on and tangible. With that in mind let's look at something most of us are familiar with. Our irrigation control system. Almost every new home in Texas has one of these systems included, and all commercial land establishments such as Golf Courses, Farms, Parks and Businesses with outdoor landscaping. This can also easily be applied to Fire Safety systems where a hydrant is triggered remotely to minimize damages caused by a fire. To get started we will need to set up our irrigation control system to accept commands remotely. You can skin this cat several different ways including buying a wifi enabled irrigation system, but where is the fun in that. Let's get our hands dirty and kick off with some embedded programming. 
HDFS Snapshots In Part 1 we looked at the basics of HDFS snapshots. In next section we'll look at what happens with managing multiple snapshots in a given directory and what to look out for... primarily phantom data that exists when you delete a dataset that has a snapshot or multiple snapshots linked to it. Working With Multiple Snapshots First lets take a new snapshot on the directory we were previously working on: hdfs dfs -createSnapshot /tmp/snapshot_dir/dir1 20190819v1 Next lets add another file in the same base directory that we have file1.txt in: hdfs dfs -put file2.txt /tmp/snapshot_dir/dir1 Let's pretend that 8 hours later, you take another snapshot of the same directory. Here we named the snapshot v2: hdfs dfs -createSnapshot /tmp/snapshot_dir/dir1 20190819v2 Let's pause and take a look at the size of the directory: hdfs dfs -
Part 2 of Autoscaling MiNiFi on K8S is focused on deploying the artifacts on AKS - Amazon Kubernetes Service. My knew jerk reaction was all Kubernetes as a Service would play well but that is definitely not the case. Hence why GCP Anthos product direction for this space is a key. The net-net of my observation is k8s app deployment on any single cloud vendor would cause deployment complexities any other k8s deployment, cloud or OnPrem.. Vendor lock in theory is ALIVE and WELL. In Azure I leveraged ACS for EFM and NiFi Registry; however, the natural evolution was to deploy EFM and NiFi Registry (NR) on K8S. EFM, NR, and MiNiFi are integrated components (refer to part 1 on architecture). I will leverage several key out of the box k8s components to make this all work together. The good news is, the deployment is super simple! PrerequisitesSome knowledge of Kubernetes and AKSAKS Clusterkubectl clieksctl cliVPC2 public subnets wi
SYMPTOM: We have some alerts about high heap size in datanode in Ambari for production cluster. The maximum of heap size of the datanode is set to 16GERROR: Below is the snapshot ROOT CAUSE: DN operations are IO expensive do not require 16GB of the heap. RESOLUTION: Tuning GC parameters resolved the issue -4GB Heap recommendation : -Xms4096m -Xmx4096m -XX:NewSize=800m -XX:MaxNewSize=800m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:ParallelGCThreads=8
In HDP-2.6/Ambari-2.6, it was not mandatory enable HS2 metrics explicitly. Thus, all metrics would be emitted without defining any configs explicitly. In HDP-3/Ambari-2.7, we will see similar erros in AMS Collector Log:Error : 2019-06-10 02:42:59,215 INFO timeline timeline.HadoopTimelineMetricsSink: No live collector to send metrics to. Metrics to be sent will be discarded. This message will be skipped for the next 20Debug Error shows this :2019-06-14 20:35:29,538 DEBUG main timeline.HadoopTimelineMetricsSink: Trying to find live collector host from : exp5.lab.com,exp4.lab.com 2019-06-14 20:35:29,538 DEBUG main timeline.HadoopTimelineMetricsSink: Requesting live collector nodes : http://exp5.lab.com,exp4.lab.com:6188/ws/v1/timeline/metrics/livenodes 2019-06-14 20:35:29,557 DEBUG main timeline.HadoopTimelineMetricsSink: Unable to connect to collector, http://exp5.lab.com,exp4.lab.com:6188/ws/v1/timeline/metrics/livenodes 2019-06-14 20:35:29,557 DEBUG main timeline.HadoopTimelineMet
This article describes the configuration of the authorizers.xml for using the Composite User Group Provider for both LDAP and File based authentication in Cloudera Manager for CDF 1.0 This article assumes TLS has already been configured for NiFi using either the NiFi CA or your own certs. Here is the Active Directory Structure that I will use for my sync:Here are the groups in the Groups OU:Here are the users in the Users OU:Here are the service users in the ServiceUsers OU: First, I will import my Active Directory root certificate into the NiFi and Java Truststores: keytool -import -file adcert.pem -alias ad -keystore /var/lib/nifi/cert/truststore.jkskeytool -import -file adcert.pem -alias ad -keystore /etc/pki/java/cacerts Now login to Cloudera Manager and proceed to the NiFi Configuration. Update the configuration to use the "composite-user-group-provider" as follows: xml.authorizers.accessPolicyProvider.file-access-policy-provide
HDFS Snapshots HDFS Snapshots are a great way to backup important data on HDFS. It's extremely easy to implement and it helps safeguard your data from instances where a user or admin accidentally deletes data. In the article below, we'll walkthrough some simple examples of using snapshots and some of the gotchas to look out for when implementing them. Part 1: Understanding Snapshots First lets create some files and directories for testing: echo "Hello World" > file1.txtecho "How are you" > file2.txtecho "hdfs snapshots are great" > file3.txthdfs dfs -mkdir /tmp/snapshot_dirhdfs dfs -mkdir /tmp/snapshot_dir/dir1 Next lets put file1.txt in the directory: hdfs dfs -put file1.txt /tmp/snapshot_dir/dir1 Creating a snapshot is a really simple process. You will need a user with superuser permissions to create a snapshottable directory. With this process, we enable the directory to have snapshots but we
MiNiFi (Java Version) is essentially NiFi with a few differences and hence why it runs so darn well on containers/Kubernetes. The use case is to have a single management console (Edge Flow Manager) to manage 0 + many MiNiFi agents which require autoscaling on Kubernetes based on some arbitrary metrics...for example CPU/RAM threshold. EFM and NiFi Registry are required but don't need autoscaling; therefore, these services will be deployed on Azure Container Service. MiNiFi on the other hand often benefits from autoscaling and hence it will be deployed on Azure Kubernetes Service.Required for this demonstrationAzure subscriptionContainer RegistryDemo will leverage Azure Container RegistryKubernetes ServiceDemo will leverage Azure Kubernetes ServiceAzure CLIThe following images need to be stored in Azure Container RegistryEdge Flow Managerhttps://github.com/sunileman/efm1.0.0.0-dockerNiFi Registryhttps://github.com/sunileman/NiFi-Registry-ServiceMiNiFi (Java)https://github.com/sunileman/C
Steps to fix below Database consistency WARNINGs in Ambari 2.7.xWARN - You have config(s): webhcat-site-version1540591929056,webhcat-log4j-version1540591928580,hive-exec-log4j-version1540591929168,webhcat-env-version1540591929289,hive-log4j-version1540591929465,hcat-env-version1540591928892 that is(are) not mapped (in serviceconfigmapping table) to any service!CREATE TEMPORARY TABLE orphaned_configs AS(select config_id,type_name,version_tag from clusterconfig where unmapped != 1 and type_name not in ('cluster-env') and config_id not in (SELECTcc.config_id FROM clusterconfig cc, serviceconfig sc, serviceconfigmapping scmWHERE cc.type_name != 'cluster-env'AND cc.config_id = scm.config_idAND scm.service_config_id = sc.service_config_id));Update clusterconfig set unmapped = 1 where config_id in (select config_id from orphaned_configs);drop table orphaned_configs;If it is 2.6.x then following query can be usedSELECT cc.config_id, cc.type_name, cc.version_tagFROM ambari.clusterconfig cc, amb
I'm going to cover a simple OSS solution to Shredding XML in NiFi, and demonstrate how you can chain simple steps together to achieve common data shredding tasks. Feel free to get in touch if you need to achieve something more complex than these basic steps will allow. We will be covering: Procedurally converting Xml to Json using a fast XSLT 2.0 template Constructing Jolt transforms to extract nested subsections of JSON documents Constructing JsonPath expressions to split multi-record JSON documents Procedurally flattening complex nested JSON for easy querying This process is shown on NiFi-1.2.0, and tested on a variety of XML documents, but most notably a broad collection of GuideWire sample XMLs as part of a Client PoC. The XML examples below have retained the nested structure but anonymised the fields. XML to JSON Here we combine the NiFI TransformXML processor with the excellent BSD-licensed xsltjson procedural converter found at https://github.com/bramstein/xsltjson. Simply chec
LDAP security optionsLDAP over SSLTraditionally, LDAP connection is wrapped with SSL/TLS, and via a separate service port, normally 636. The protocol is ldaps://. To be aware, it’s not just over SSL, depends on configuration, can over TLS as well.LDAP with StartTLSAlternatively, StartTLS extended operation enable encrypted connection after the initial unencrypted connection, via the same plain ldap port, normally 389. If you don’t configure properly, it could be over SSL, not always with TLS. This protocol is new, normally is used to upgrade the plain ldap port 389 to be secure. But not all customer have configured it in AD/LDAP server. Most common cases are still use ldaps for secure ldap connection. So this article is focusing on LDAPS.Components support LDAPSMost of HDP/HDF components support LDAPS. Ambari, NiFi, Ranger Usersync, Ranger Admin, Zeppelin, Knox. But Atlas still only supports LDAP.General Configure LDAPS Steps Verify LDAPS certificateTo connect to ldaps service, first t
Hortonworks Data Flow 2.1 was recently released and includes a new feature which can be used to connect to an Azure Data Lake Store. This is a fantastic use case for HDF as the data movement engine supporting a connected data plane architecture spanning on-premise and cloud deployments.This how-to will assume that you have created an Azure Data Lake Store account and that you have remote access to an HD Insights head node in order to retrieve some dependent JARs. We will make use of the new Additional Classpath Resources feature for the GetHdfs and PutHdfs processors in NiFi 1.1, included within HDF 2.1. The following additional dependencies are required for ADLS connectivity: adls2-oauth2-token-provider-1.0.jar azure-data-lake-store-sdk-2.0.4-SNAPSHOT.jar hadoop-azure-datalake-2.0.0-SNAPSHOT.jar jackson-core-2.2.3.jar okhttp-2.4.0.jar okio-1.4.0.jar The first three Azure-specific JARs can be found in /usr/lib/hdinsight-datalake/ on the HDI head node. The Jackson JAR can be fo
This article describes various "recipes" on how to accomplish certain tasks with the NiFi processor ExecuteScript, with examples given in Groovy, Jython, Javascript (Nashorn), and JRuby. This is Part 2 in the series, I will be discussing reading from and writing to flow file contents, as well as error handling. Part 1 - Introduction to the NiFi API and FlowFiles Getting a flow file from an incoming queue Creating new flow files Working with flow file attributes Transferring a flow file Logging Part 2 - FlowFile I/O and Error Handling Reading from a flow file Writing to a flow file Reading and writing to/from a flow file Error Handling Part 3 - Advanced Features Using Dynamic Properties Adding Modules State Management Accessing Controller Services Introduction to FlowFile I/O Flow files in NiFi are made of two major components, attributes and content. Attributes are metadata about the content / flow file, and we saw how to manipulate them using ExecuteScript in Part 1 of this seri
If Kerberos for Hadoop cluster is implemented using enterprise AD, any Windows machine where users can sign-on using AD credentials has a cached ticket available. This cached ticket is available to any Windows applications by default, but any JAVA applications can't access cached ticket. To access cached ticket from a JAVA application, following registry entry in Windows should be setHKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\ParametersValueName: AllowTGTSessionKeyValueType: REG_DWORDValue:1Using klist command on Windows machine, verify username and REALM are in correct case as specified in kerberos settings on cluster. Then, create a jaas.conf file with following entryClient {com.sun.security.auth.module.Krb5LoginModule requireduseKeyTab=falseuseTicketCache=true;};To access kerborized cluster, JAVA program should be launched with following parameters.-Djava.security.auth.login.config="<path-to-jaas-conf>/jaas.conf"This will allow JAVA program to access cach
I had a hard time finding sample code online that uses the latest HBase 1.1+ Java APIs to connect to HDP 2.3 Sandbox. Here is my version for those that already know the Java basics.public static void main(String[] args) throws IOException { TableName tableName = TableName.valueOf("stock-prices"); Configuration conf = HBaseConfiguration.create(); conf.set("hbase.zookeeper.property.clientPort", "2181"); conf.set("hbase.zookeeper.quorum", "sandbox.hortonworks.com"); conf.set("zookeeper.znode.parent", "/hbase-unsecure"); Connection conn = ConnectionFactory.createConnection(conf); Admin admin = conn.getAdmin(); if (!admin.tableExists(tableName)) { admin.createTable(new HTableDescriptor(tableName).addFamily(new HColumnDescriptor("cf"))); } Table table = conn.getTable(tableName); Put p = new Put(Bytes.toBytes("AAPL10232015")); p.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("close"), Bytes.toBytes(119)); table.put(p); Result r = table.get(new G
Short Description:Spark Hbase Connector (SHC) is currently hosted in Hortonworks repo and published as spark package. Below is simple example how to access Hbase table in Spark shell and Load the data into DataFrame. Once data is in Dataframe we can use SqlContext to run queries on the DataFrame.ArticleThe documentation here leaves out a few pieces in order access HBase tables using SHC with spark shell. Here is the Example accessing Hbase "emp" table in Spark shell. Hbase ShellCreate a simple "emp" Hbase table using Hbase shell and insert sample datacreate 'emp', 'personal data', 'professional data'put 'emp','1','personal data:name','raju'put 'emp','1','personal data:city','hyderabad'put 'emp','1','professional data:designation','manager'put 'emp','1','professional data:salary','50000'Once created exit Hbase shell and run spark shell providing SHC package and hbase-site.xml/usr/hdp/current/spark-client/bin/spark-shell --packages zhzhan:shc:0.0.11-1.6.1-s_2.10 --files /etc/hbase/conf
IntroductionThis wiki page describes the script sqoopTables.sh (GitHub: https://github.com/sourygnahtw/hadoopUtils/blob/master/scripts/sqoop/sqoopTables.sh).The purpose of the script is to sqoop in parallel many tables and to store them into Hive.MotivationsIn a previous project, I needed to download around 400 tables (out of 500) of a SQLserver database.Most of the tables were quite small (less than a few MB), which means that the overhead of fetching the metadata in Sqoop (establishing the connexions, getting the DDL of the table...) is very important compared to the time to do the real job (download the data). Getting the 400 tables could take around 6 hours.To speed up the downloading process, Sqoop usually "splits" a table in 4 parts, to parallelise the downloading process in 4 streams. In my project, such approach was not working: Many tables had not clear primary keys or the distribution of those keys was not uniform. Trying to find better split columns for 400 tables was a wast
Batch Loading with Druid and Hive IntegrationThis brief tutorial will walk through the various ways of ingesting raw data into druid and exposing the data in hive for analytics.For Reference, this tutorial was built with CentOS 7, HDP 3.0.1 w/ LLAP enabled.This tutorial will be divided into 6 sections:Data GenerationDefine the Ingest ScriptSubmit the Ingest SpecAccessing Data in HiveDouble the Data Double the FunLoading Data With HiveWhy Druid?Druid is a distributed columnar data store that is optimized for OLAP style queries. Data loaded into Druid is pre-aggregated based upon selected dimensions and metric fields. The data is further partitioned by time to enable efficient temporal access. This time based partitioning can be as long as a year and as small as a second, depending on what the business needs are.Today, Druid is tightly integrated with Hive which helps bring high speed OLAP analytics to the data lake. While Hive enhancements like LLAP deliver great performance improvement
Objective:Connect source (nifi) and destination (nifi) via site-to-site over SSL (https - 9091 port) Issue:NiFi Site to Site SSLHandShakeException PKIX path building failed - Missing TrustStore CertsRoot cause:Nifi truststores missing certificates of other Nifi Steps Taken:1. Run following command to get the list of Certificates in current Nifi TrustStore keytool -v -list -keystore <trustStoreLocation>2. If no certs that belong to target Nifi are found then we can proceed with installing the target Nifi cert3. Run following command to get the target Nifi public certificate echo -n|openssl s_client -connect <targetNiFiHostName>:9091 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/examplecert.crt3. Run following command to get the target Nifi public certificatekeytool -import -file /tmp/examplecert.crt -alias <targetNiFiCertificate> -keystore <trustStoreLocation> -storepass xxxx -noprompt 3. Verify using Openssl or SSLPoke commands java -Djavax.ne
IntroductionThis wiki page describes the script validationHiveTablesLinuxMode.sh (GitHub: https://github.com/sourygnahtw/hadoopUtils/blob/master/scripts/hive/validationHiveTablesLinuxMode.sh).The purpose of the script is to compare one Hive table with another, typically to validate a table generated by a Hive transformation against a source-of-truth (sqooped) table.MotivationsMy current project is the typical Hadoop project that consists of offloading a ETL process currently done in a relational database (SQLserver) to a Hadoop process.That involves rewriting all the (many) SQL queries in the ETL process to HiveQL queries.Some criteria of success for such project are:is the new Hive ETL workflow faster than the old one?have the output tables of the new workflow exactly the same data as in the original workflow?(does the customer pay less licenses and hardware with this new workflow?)So, getting sure that the HiveQL queries written in such ETL offloading project is a key subject. Hence
IntroductionLet's jump into tutorial 2 from my AI to Edge series!This tutorial details the creation of a Nifi flow executing the ONNX model we trained in my last article.More precisely we will try to feed these 3 handwritten digits and predict their value:Note: as always, all code/files referenced in this tutorial can be found on my github, here.AgendaBelow is an overview of the flow:As you can see, the flow is divided in the following sections:Section 1: Listening to a folder for new png filesSection 2: Resizing these images to 28x28 (size used to train our model)Section 3: Converting these images to CSV (format used to train our model)Section 4: Running our predictive modelSection 1: Listening to a folder for new png filesStep 1: Setup a variable for the root folderThis will be useful when we deploy the flow to a minifi flow. Go to your variables and create the following:Name: root_folderValue: location of your download of my githubStep 2: List files in folderCreate a ListFiles proce
Step 1 : Log into AWS your credentialsStep 2 : From the AWS console go to the following options and create a user in for the demo in AWSSecurity & Identity --> Identity and Access Management --> Users --> Create New UsersStep 3 : Make note of the credentialsawsAccessKeyId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';awsSecretAccessKey = 'yyyyyyyyyyyyyyyyyyyyyyyyyyy';Step 4 : Add the User to the Admin Group by clicking the button “User Actions” and select the option Add Users to Group and add select your user (admin)Step 5 : Assign the Administration Access Policy to the User (admin)Step 6 : In the AWS Console , Go to S3 and create a bucket “s3hdptest” and pick your region Step 7 : Upload the file manually by using the upload button. In our example we are uploading the file S3HDPTEST.csvStep 8 : In the Hadoop Environment create the user with the same name as it is created in the S3 EnvironmentStep 9 : In Ambari do all the below properties in both hdfs-site.xml and hive-site.xml<pro
The Log Search service may use SSL for three things:Encrypt communication between Solr and the Log Search Server / Log FeedersEncrypt communication with the portal by using https protocolEncrypt communication with the Ambari Server for authenticationIn all of these cases the Log Search Server should have a trust store / key store available which should be configured in the logsearch-env.sh file. In case #1 the Log Feeders should also have a trust store / key store available which should be configured in logfeeder-env.sh.How to configure to use SSL in these cases?For all cases you should configure the stores for the Portal (and the Log Feeders in case of #1), see below how to do it.Using SSL for the communication with Solr you should configure your Solr server to use SSL.Using https as the portal protocol you should set the property Advanced logsearch-env / logsearch_ui_protocol to https. If you are not using Ambari you should add (or update the value of) logsearch.protocol=https to the
Apache NiFi evolution from version 1.2 included in HDF 3.0 and version 1.5 included in HDF is significant. This article includes a Matrix that helps developers to take advantage of the latest NiFi processor to improve old and develop new flows. The following is a table of the matrix, arranged alphabetically from K-Z:See here for the Matrix Table from A-DSee here for the Matrix Table E-JNiFi 1.5NiFi 1.4NiFi 1.3NiFi 1.2ListAzureBlobStorageListAzureBlobStorageListAzureBlobStorageListAzureBlobStorageListDatabaseTablesListDatabaseTablesListDatabaseTablesListDatabaseTablesListenBeatsListenBeatsListenBeatsListenBeatsListenGRPCListenGRPCListenHTTPListenHTTPListenHTTPListenHTTPListenLumberjackListenLumberjackListenLumberjackListenLumberjackListenRELPListenRELPListenRELPListenRELPListenSMTPListenSMTPListenSMTPListenSMTPListenSyslogListenSyslogListenSyslogListenSyslogListenTCPListenTCPListenTCPListenTCPListenTCPRecordListenTCPRecordListenUDPListenUDPListenUDPListenUDPListenUDPRecordListenUDPRecor
Apache NiFi evolution from version 1.2 included in HDF 3.0 and version 1.5 included in HDF is significant. This article includes a Matrix that helps developers to take advantage of the latest NiFi processor to improve old and develop new flows. The following is a table of the matrix, arranged alphabetically from E-J:See here for the Table Matrix from A-DSee here for the Table Matrix K-ZNiFi 1.5NiFi 1.4NiFi 1.3NiFi 1.2EncryptContentEncryptContentEncryptContentEncryptContentEnforceOrderEnforceOrderEnforceOrderEnforceOrderEvaluateJsonPathEvaluateJsonPathEvaluateJsonPathEvaluateJsonPathEvaluateXPathEvaluateXPathEvaluateXPathEvaluateXPathEvaluateXQueryEvaluateXQueryEvaluateXQueryEvaluateXQueryExecuteFlumeSinkExecuteFlumeSinkExecuteFlumeSinkExecuteFlumeSinkExecuteFlumeSourceExecuteFlumeSourceExecuteFlumeSourceExecuteFlumeSourceExecuteGroovyScriptExecuteProcessExecuteProcessExecuteProcessExecuteProcessExecuteScriptExecuteScriptExecuteScriptExecuteScriptExecuteSparkInteractiveExecuteSQLExecute
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.