Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
1.0. OverviewMonitoring enterprise applications and platforms is key responsibility of operations teams. Hortonworks HDP platform uses Ambari for monitoring and alerting, but it is unrealistic, in an enterprise environment, for operations teams to monitor each instance’s monitoring interface in its own front-end. For instance, some operations teams have to monitor 10s or 100s of HDP clusters as well as other systems, including infrastructure related systems, third party applications and databases. Monitoring each Ambari instance’s alerting GUI would be tedious. Therefore, a central dashboard is often used to monitor a broad set of clusters, platforms and applications.SNMP (Standard Network Management Protocol) provides a mechanism to achieve this goal of monitoring a broad set of applications, platforms and infrastructure, and Ambari supports SNMP alerting. This article provides a brief overview of SNMP and a guide for how to integrate HDP platform monitoring with OpenNMS. OpenNMS is a
This article describes how to add a new custom script and execute the script through Ambari. In this article, I took a simple use case to install kerberos packages through custom scripts.1) Below is the code to install kerberos packages (install_kerberos_package.py)#!/usr/bin/env pythonfrom resource_management import Script, Execute, formatfrom ambari_commons.os_check import OSCheckfrom resource_management.core import shellfrom resource_management.core.logger import Loggerclass InstallKerberosPackage(Script): def actionexecute(self, env): config = Script.get_config() structured_output = {} cmd = self.get_install_cmd() Logger.info("Installing Kerberos Package") code, output = shell.call(cmd, sudo = True) if 0 == code: structured_output["install_kerberos_package"] = {"exit_code" : 0, "message": format("Packages installed successfully")} else: structured_output["install_kerberos_package"] = {"exit_code": code, "message": "Failed to install packages! {0}".fo
Objective This tutorial walks you through how to install and setup a local Apache NiFi Registry to integrate with Apache NiFi and start using versioned NiFi dataflows. It assumes basic experience with NiFi but little to no experience with NiFi Registry.A video version of this tutorial can be seen here: https://youtu.be/X_qhRVChjZYEnvironment This tutorial was tested using the following environment and components: Mac OS X 10.11.6 Apache NiFi 1.5.0 Apache NiFi Registry 0.1.0 Note: Apache NiFi 1.5.0 is the first NiFi release to support integration with the NiFi Registry. Nifi Registry 0.1.0 is the first and currently only version of the application.Apache NiFi Registry ConfigurationRegistry Installation Download the tarball of the 0.1.0 Registry release: nifi-registry-0.1.0-bin.tar.gz Extract the tar: tar xzvf nifi-registry-0.1.0-bin.tar.gzStart the RegistryIn a terminal window, navigate to the directory where NiFi Registry was installed. Run: bin/nifi-registry.sh startOpen
In previous post we have seen how to install multi node HDP cluster using Ambari Blueprints. In this post we will see how to Automate HDP installation with Namenode HA using Ambari Blueprints..Note - For Ambari 2.6.X onwards, we will have to register VDF to register internal repository, or else Ambari will pick up latest version of HDP and use the public repos. please see below document for more information. For Ambari version less than 2.6.X, this guide will work without any modifications.Document - https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.0.0/bk_ambari-release-notes/content/ambari_relnotes-2.6.0.0-behavioral-changes.html.Below are simple steps to install HDP multinode cluster with Namenode HA using internal repository via Ambari Blueprints..Step 1: Install Ambari server using steps mentioned under below linkhttp://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Installing_HDP_AMB/content/_download_the_ambari_repo_lnx6.html.Step 2: Register ambari-agent manuallyInstall
Ranger plugins send their audit event (whether access was granted or not and based on the policy) directly to the configured sink for audits, which can be HDFS, Solr or both. Ranger Audit is a highly customizable event queue system that can be tailored to suit the needs of production environments. When the plugin is enabled and no specific policy is in place for access to some object, the plugin will fall back to enforcing the standard component level Access Control Lists (ACL’s). For HDFS, that would be the user: rwx / group: rwx / other: rwx ACL’s on folders and files. Once this defaulting to component ACL’s happens, the audit events show a ‘ - ‘ in the ‘Policy ID’ column instead of a policy number. If a Ranger policy was in control of allowing/ denying, the policy number is shown. Key Things to Remember Access decisions taken by Ranger (to allow/ deny user) are based on a combination of three things: resource - that is being accessed user/group - who is trying to access opera
This article is an extension to the official HDP document.Apart from following the steps listed in this document, you must perform the following checks to ensure the hook is configured correctly and does not result in errors when you start executing queries in Hive.1. In hive-site.xml, verify hive.server2.async.exec.threads is not set to 1. If so, then increase to 100.2. In hive-site.xml, verify the max thread pool size is not set to 1. Increase it to 5 to begin with and you may need to increase it further depending on the load.Recommended values: <property> <name>atlas.hook.hive.maxThreads</name> <value>5</value></property><property> <name>hive.server2.async.exec.threads</name> <value>100</value></property>
Summary Enabling SSL encryption for the Web UIs that make up Hadoop is a tedious process that requires planning, learning to use security tools, and lots of mouse clicks through Ambari's UI. This article aims to simplify the process by presenting a semi-automated, start-to-finish example that enables SSL for the below Web UIs in the Hortonworks Sandbox: Ambari HBase Oozie Ranger HDFSPlanning There is no substitute for reading the documentation. If you plan on enabling SSL in a production cluster, then make sure you are familiar with SSL concepts and the communication paths between each HDP component. In addition, plan on cluster downtime. Here are some concepts that you should know well: Certificate Authority (CA) A Certificate Authority is a company that others trust that signs certificates for a fee. On a Mac you can view a list of CAs that your computer trusts by opening up the "Keychain Access" application and clicking on "System Roots". If you don't want to pay one of
WARNING: this is a workaround and does not mean is a certifiable solution from Hortonworks. In certain scenarios, customers are required to run client and services on different OS versions and flavors. I will only cover clients for Pig and Hive, certainly this procedure can be applied to services but it's more involved. It is advised that you contact Hortonworks support if you go down this path.Setup scenario:3 node Ubuntu 12.04 cluster with HDP 2.4.2 and Ambari 2.2.2.01 node Centos 6 and no Ambari.on the centos6 node, download and install Java, preferably the same as on other nodes. I followed this document to install Oracle JDK 8 as that's what is running on my Ubuntu cluster. https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedoraon the centos6 node, download the hdp repowget http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.2.0/hdp.repocp hdp.repo /etc/yum.repos.dyum install hadoop pig hive-hcatalog hive-webhcat tezcopy the /etc/hado
In an Apache NiFi cluster, every node runs the same dataflow and data is divided between the nodes. In order to leverage the full processing power of the cluster, the next logical question is - "how do I distribute data across the cluster?". The answer depends on the source of data. Generally, there are sources that can push data, and sources that provide data to be pulled. This post will describe some of the common patterns for dealing with these scenarios. Background A NiFi cluster is made up of a NiFi Cluster Manager (NCM) and one or more nodes. The NCM does not perform any processing of data, but manages the cluster and provides the single point of access to the UI for the cluster. In addition, one of the processing nodes can be designated as a Primary Node. Processors can then be schedule to run on the Primary Node only, via an option on the scheduling tab of the processor which is only available in a cluster. When connecting two NiFi instances, the connection is made with
Periodically, and when there are no regions in transition, a load balancer will run and move regions around to balance the cluster’s load. See Balancer for configuring this property. The Load Balancer ensures that the region replicas are not co-hosted in the same region servers and also in the same rack (if possible).The HDFS balancer attempts to spread HDFS blocks evenly among DataNodes. HBase relies on compactions to restore locality after a region split or failure. These two types of balancing do not work well together.In the past, the generally accepted advice was to turn off the HDFS load balancer and rely on the HBase balancer, since the HDFS balancer would degrade locality. HDFS-6133 provides the ability to exclude favored-nodes (pinned) blocks from the HDFS load balancer, by setting thedfs.datanode.block-pinning.enabled property to true in the HDFS service configuration.HBase can be enabled to use the HDFS favored-nodes feature by switching the HBase balancer class (conf: hbase
Problem There are time we would want to remove a ZK node in a secure cluster which is ACL protected. Something as below ACLs[zk: xyz.com:2181(CONNECTED) 0] getAcl /infra-solr 'sasl,'infra-solr : cdrwa 'world,'anyone : r [zk: xyz.com:2181(CONNECTED) 0] rmr /testAuthentication is not valid : /testHere only read privilege is available to rest. Soln Goto zookeeper home. for e.x cd /usr/hdp/current/zookeeper-serverRun below commandjava -cp "./zookeeper.jar:lib/slf4j-api-1.6.1.jar" org.apache.zookeeper.server.auth.DigestAuthenticationProvider super:password SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. super:password->super:DyNYQEQvajljsxlhf5uS4PJ9R28= Copy the super:DyNYQEQvajljsxlhf5uS4PJ9R28= text and login to Ambari and goto zookeeper config.Add below to zookeeper-env template configexport SERVER_JVMFLAGS="$SERVER_JVMFLAGS
Steps to enable SSL for Grafana from the keystore file.1. First create keystore file using below command.$JAVA_HOME/bin/keytool -genkey -keyalg RSA -alias grafana -keystore keystore.jks -validity 360 -keysize 20482. Now export cert from JKS filekeytool -export -alias grafana -file server.cer -keystore keystore.jks3. Convert cert from DER to PEM formatopenssl x509 -in server.cer -inform der -outform pem -out cert.pem4. Export privatekey to PKCS12 filekeytool -v -importkeystore -srckeystore keystore.jks -srcalias ambari -destkeystore myp12file.p12 -deststoretype PKCS125. Now export private key from PKCS12 to PEM format.openssl pkcs12 -in myp12file.p12 -clcerts -nodes -nocerts | openssl rsa > private.keyNote: private.key should be unencrypted file. it should be like -----BEGIN RSA PRIVATE KEY-----xxxx-----END RSA PRIVATE KEY-----Should be not having like "-----BEGIN ENCRYPTED PRIVATE KEY-----"The reason for using un encrypted key is because Grafana does not have any option to take
Hive metastore DB Connection verification from Command line:-You can run the following on any node where ambari agent installed on the cluster,You need the following information to run this test.You can use this to validate if the password stored in ambari and the actual mysql db password are same.1. mysql db hostname2. mysql db port number3. mysql database name which hive metastore uses4. mysql username5. mysql passwordSyntax:-java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://<mysql db hostname>:<mysql db port number>/<mysql database name>" "<mysql username>" "<mysql password>" com.mysql.jdbc.DriverExample:-/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.
Below steps are for taking backup of ranger audits and then restore them back to new collection which will be using updated manage-schema fix given in RANGER-1938. Note: Steps are only for Solr version 5.x and Ranger service managed by Ambari. 1) Backup existing ranger_audits collection: curl -X GET "http://${SOLR_HOST}:${SOLR_PORT}/solr/ranger_audits/replication?command=backup&location=/tmp" 2) Download existing managed-schema from Zookeeper: /usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/zkcli.sh --zkhost "${ZK_HOST}:${ZK_PORT}/${SOLR_ZNODE}" -cmd getfile /configs/ranger_audits/managed-schema /tmp/managed-schema 3) Upload updated managed-schema given here to Zookeeper: /usr/lib/ambari-infra-solr/server/scripts/cloud-scripts/zkcli.sh --zkhost "${ZK_HOST}:${ZK_PORT}/${SOLR_ZNODE}" -cmd putfile /configs/ranger_audits/managed-schema managed-schema 4) Delete existing ranger_audits collection: curl -i "http://${SOLR_HOST}:$
For certain large environments, it's very easy to for Spark History Server to get overwhelmed by the large number of applications being posted and number of users / developers viewing history data. Spark jobs create an artifact called the history file which is what is parsed by the Spark History Server (SHS) and served via the UI. The size of this file has a huge impact in driving the load on the SHS also note that the size of history file is determined by the number of events generated by the SHS (small executor heart beat interval)Workaround:If you are still interested in analyzing performance issues with these large history files, one option is to download these files and browse them from a locally hosted SHS instance. To run this:Download Spark 1.6 https://spark.apache.org/downloads.htmlUnpackCreate a directory to hold the logs called spark-logsCreate a properties file called test.propertiesInside test.properties add spark.history.fs.logDirectory=<path to the spark-logs director
Initial Login to ODroid XU4GPS Command Line CheckWiFi Signal StrengthInstall Ubuntu ExtrasAbove is our device with GPSThe ODroid XU4 is a powerful little inexpensive IoT device. It is similar to a Raspberry PI and compatible with many of the libraries. I chose to install ARMBIAN Ubuntu which is a good OS. It is very easy to add GPS libraries, Apache MiniFi, JDK 8 and Python for processing.Apache NiFi processing flowApache MiniFi Flow on DeviceApache NiFi ProcessingSee: https://community.hortonworks.com/content/kbentry/155604/iot-ingesting-camera-data-from-nanopi-duo-devices.htmlSource Codehttps://github.com/tspannhw/odroidxu4-gps-python-minifiSoftwaresudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade armbian-configsudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installer -ysudo apt-get install oracle-java8-set-default -yblkidswapon /dev/sda1sudo apt-get install gpsd gpsd-clientssudo dpkg-reconfigure gpsdsudo gpsmo
This is pretty close to a Raspberry Pi Zero. This inexpensive box is another useful IoT device for ingesting some data very inexpensively.Machine Browsingroot@NanoPi-Duo:/home/pi# cpu_freqINFO: HARDWARE=sun8iCPU0 online=1 temp=48092 governor=ondemand cur_freq=312000CPU1 online=1 temp=48092 governor=ondemand cur_freq=312000CPU2 online=1 temp=48092 governor=ondemand cur_freq=312000CPU3 online=1 temp=48092 governor=ondemand cur_freq=312000Source Code for Python and Shell Scripthttps://github.com/tspannhw/nifi-nanopi-duoHardwareThe FA-CAM202 is a 200M USB camera.512MB RAM Ubuntu 16.04.3 LTS 4.11.2Similar SBC to Raspberry PIARMSoftware Setupsudo apt-get install fswebcam -ysudo apt-get install libv4l-dev -ysudo apt-get install python-opencv -ysudo npi-configsudo apt-get update sudo apt-get install libcv-dev libopencv-dev -ypip install psutil pip2 install psutilcurl http://192.168.1.193:8080/nifi-api/site-to-site/ -vinferred.avro.schema { "type" : "record", "name" : "NANO", "fields" : [ { "
package com.big.data.sparkserver2;import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.security.UserGroupInformation;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import java.io.IOException;import java.sql.*;public class SparkServer2Client { private static final Logger LOGGER = LoggerFactory.getLogger(SparkServer2Client.class); private static String HIVESERVE2DRIVER = "org.apache.hive.jdbc.HiveDriver"; public static void main(String[] args) throws SQLException, IOException { // set the configurationConfiguration conf = new Configuration(); conf.set("hadoop.security.authentication", "Kerberos"); UserGroupInformation.setConfiguration(conf); // /etc/security/keytab/hive.service.keytab is from local machine, This is the user which is executing the commandUserGroupInformation.loginUserFromKeytab("hive/hostname.com@FIELD.HORTONWORKS.COM", "/etc/security/keytab/hive.service.keytab"); // load the drivertry { Class.
package com.big.data.hiveserver2;import org.apache.hadoop.conf.Configuration;import org.apache.hadoop.security.UserGroupInformation;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import java.io.IOException;import java.sql.*;public class HiveServer2Client { private static final Logger LOGGER = LoggerFactory.getLogger(HiveServer2Client.class); private static String HIVESERVE2DRIVER = "org.apache.hive.jdbc.HiveDriver"; public static void main(String[] args) throws SQLException, IOException { // set the configuration Configuration conf = new Configuration(); conf.set("hadoop.security.authentication", "Kerberos"); UserGroupInformation.setConfiguration(conf); // /etc/security/keytab/hive.service.keytab is from local machine, This is the user which is executing the command UserGroupInformation.loginUserFromKeytab("hive/cluster20182.field.fieldorg.com@REALM_NAME", "/etc/security/keytab/hive.service.keytab"); // load the driver
Hive is very powerful, but sometimes you need to add some procedural code for a special circumstance such as complex parsing of a field. Hive provides the ability to easily create User Defined Table Functions (UDFT’s). These allow you to transform your Hive results, pass them through the UDTF and return data as a set of rows that can then be used like any other Hive result set. These can be written in Java or Python, and we will use Python for this article. However, the techniques here are applicable to both with some syntax changes.There are a lot of great articles on building these such as https://community.hortonworks.com/articles/72414/how-to-create-a-custom-udf-for-hive-using-python.html.These pretty much work as advertised, but don’t get into how to debug or troubleshoot your code. However, when you get into any significant logic (and sometimes not so significant!), you are likely to create a few bugs. This can be an issue parsing, or in the case of Python, can even be syntax err
Oracle -> GoldenGate -> Apache Kafka -> Apache NiFi / Hortonworks Schema Registry -> JDBC Database Sometimes you need to process any number of table changes sent from tools via Apache Kafka. As long as they have proper header data and records in JSON, it's really easy in Apache NiFi. Requirements: Process Each Partition Separately Process Records in Order as each message is an Insert, Update or Delete to an existing table in our receiving JDBC store. Re-process if data lost For The Main Processor for Routing, It must only run on the Primary Node. Enforcing Order We use the Kafka.Offset to order the records, which makes sense in Apache Kafka topics. After Insert, Update, Delete queries are built, let's confirm and enforce that strict ordering. To further confirm processing in order, we make each connection in the flow FirstInFirstOutPrioritizer. To Route, We Route Each Partition to A Different Processor Group (One Local, The Other Remote) Let's Store Some Da
Processing Voice DataUsing a Raspberry Pi 3 with Google AIY Voice Kit is an easy way to control data flows in an organization.The AIY Voice Kit is a good way to prototype voice ingest. It is not perfect, but for low end inexpensive hardware it is a good solution for those that speak clearly and are willing to repeat a phrase a few times for activation.I was able to easily add a word for it to react to. I also have it waiting for someone to press the button to activate.Setup and Run Steps1. Install box 2. Setup GCP Account 3. As Pi User ~/bin/AIY-voice-kit-shell.sh src/assistant_library_demo.py 4. Download and Unzip Apache MiniFi 5. Custom Action controlx 6. Run it pi@raspberrypi:~/AIY-voice-kit-python/src $ ./controlx.py 7. start minifi 8. Apache MiniFi will tail the command file and look for audio filesCode Added to Google Example elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED and event.args: print('You said:', event.args['text
Author: Gerdan Rezende dos Santos - https://community.hortonworks.com/users/12342/gerdan.html Co-author: Pedro Drummond - https://community.hortonworks.com/users/10987/pedrodrummond.html 1 - PREREQUISITES Before you begin, you need to have: 1. HDP 2.4 kerberized cluster; 2. Configured repos for HDPSearch; 3. Java + JCE installed with defined JAVA_HOME; 4. Knowledge of you kerberos’ REALM. 2 - KERBEROS CONFIGURATION 2.1 - “Principal” Definition It’s a Kerberos term which defines an entity by means of an address, user or service. This address is commonly divided into 3 parts: The first part contains the username or the service name; The second part contains the hostname if one is defining a service, or left in blank if one is defining a user; The third part contains the REALM. ◦Ex: user1/solr.community.hortonworks.com@LOCAL.COM 2.2 - Installing Kerberos Client
Adding a Movidius NCS to a Raspberry Pi is a great way to augment your deep learning edge programming. Hardware Setup Raspberry Pi 3 Movidius NCS PS 3 Eye Camera 128GB USB Stick Software Setup Standard NCS Setup Python 3 sudo apt-get update sudo apt-get install python-pip python-dev sudo apt-get install python3-pip python3-dev sudo apt-get install fswebcam sudo apt-get install curl wget unzip sudo apt-get install oracle-java8-jdk sudo apt-get install sense-hat sudo apt-get install octave -y sudo apt install python3-gst-1.0 pip3 install psutil Apache MiniFi https://www.apache.org/dyn/closer.lua?path=/nifi/minifi/0.3.0/minifi-0.3.0-bin.zip git clone https://github.com/movidius/ncsdk.git git clone https://github.com/movidius/ncappzoo.git Run Example ~/workspace/ncappzoo/apps/image-classifier Shell Script /root/workspace/ncappzoo/apps/image-classifier/run.sh #!/bin/bashDATE=$(date +"%Y-%m-%d_%H%M")fswebcam -r 1280x720 --no-banner /opt/demo/images/$DATE.jpgpython3 -W ig
There is an open source model server for Apache MXNet that I recently tried. It's very easy to install and use. You must have Apache MXNet and Python installed. Installation and Setup To install the Model Server it's a simple. I am using Pip3 to make sure I install to Python3 as I also have Python 2.7 installed on my laptop. pip3 install mxnet --pre --userpip3 install mxnet-model-serverpip3 install imdbpypip3 install dataset http://127.0.0.1:9999/api-description { "description": { "host": "127.0.0.1:9999", "info": { "title": "Model Serving Apis", "version": "1.0.0" }, "paths": { "/api-description": { "get": { "operationId": "api-description", "produces": [ "application/json" ], "responses": { "200": { "description": "OK", "schema": { "properties": { "description": { "type": "string"
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.