Find and share helpful community-sourced technical articles
Recently active
Many times we find that the operations (like start/stop/restart ...etc) are failing from ambari UI. In such cases if we want to troubleshoot what Ambari UI did to perform that operation or How the commands were executed. Then we can manually execute those same operations from the individual host with the help of "/var/lib/ambari-agent/data/command-xxx.json" file.- When we perform any operation from ambari UI like (Starting / Stopping Datanode) then we will notice that ambari shows the operation progress in the UI. There we can see basically the following two files.Example: stderr: /var/lib/ambari-agent/data/errors-952.txtstdout: /var/lib/ambari-agent/data/output-952.txt- Apart from the above files there is one more important file which ambari agent uses to execute the instructions/commands that are sent by the AmbariServer. We can find that specific file in the ambari-agent's "/var/lib/ambari-agent/data/command-xxx.json" file. /var/lib/ambari-agent/data/command-952.json - Here the "c
[Related Article On Ambari Server Tuning : https://community.hortonworks.com/articles/131670/ambari-server-performance-tuning-troubleshooting-c.html ]-The jcmd utility comes with the JDK and is present inside the "$JAVA_HOME/bin". It is used to send diagnostic command requests to the JVM, where these requests are useful for controlling Java Flight Recordings, troubleshoot, and diagnose JVM and Java Applications. Following are the conditions for using this utility. - 1. It must be used on the same machine where the JVM is running - 2. Only a user who own the JVM process can connect to is using this utility. This utility can help us in getting many details about the JVM process. Some of the most useful information's are as following: Syntax: jcmd $PID $ARGUMENT Example1: Classes taking the most memory are listed at the top, and classes are listed in a descending order./usr/jdk64/jdk1.8.0_60/bin/jcmd $PID GC.class_histogram > /tmp/22421_ClassHistogram.txt Example2: Generate Hea
Origin: http://henning.kropponline.de/2015/05/19/hivesink-for-flume/With the most recent release of HDP (v2.2.4) Hive Streaming is shipped as technical preview. It can for example be used with Storm to ingest streaming data collected from Kafka as demonstrated here. But it also still has some serious limitations and in case of Storm a major bug. Nevertheless Hive Streaming is likely to become the tool of choice when it comes to streamline data ingestion to Hadoop. So it is worth to explore already today.Flume's upcoming release 1.6 will contain a HiveSink capable of leveraging Hive Streaming for data ingestion. In the following post we will use it as a replacement for the HDFS sink used in a previous post here. Other then replacing the HDFS sink with a HiveSink none of the previous setup will change, except for Hive table schema which needs to be adjusted as part of the requirements that currently exist around Hive Streaming. So let's get started by looking into these restrict
IntroductionMany organizations have come to rely on Hadoop for dealing with the ever-increasing quantities of data that they gather. Today, it is clear what problems Hadoop can solve, however, cloud is still not the first choice for Hadoop deployment. Pros and cons for Hadoop in the cloud have been shared across multiple blogs and books, but the question is always coming-up in discussions with enterprises considering Hadoop in the Cloud. Thus, I thought it would be useful to collate together a few pros and cons, as well as mention a pragmatic approach to consider a hybrid cloud for organizations that have made significant investments on-prem. For organizations going to Hadoop for the first time, Cloud is probably a better bet especially if they don't have a lot of IT expertise and a great stream of revenue exists and needs to be exploited immediately.Pro CloudLack of space. You don’t have space to keep racks of physical servers, along with the necessary power and cooling.Flexibility. I
As part of this article we will see that sometimes we get the following very common error while accessing some services (in the following case while running very basic "hdfs" commands).While running the command we see the error as following:[root@kjss1 ~]# su - hdfs[hdfs@kjss1 ~]$ hdfs dfs -ls /user/admin16/12/16 12:28:27 WARN ipc.Client: Exception encountered while connecting to the server : 16/12/16 12:28:27 WARN retry.RetryInvocationHandler: Exception while invoking GetUserMappingsProtocolClientSideTranslatorPB.getGroupsForUser over kjss2.example.com/10.20.169.238:8020. Not retrying because failovers (15) exceeded maximum allowed (15)java.io.IOException: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]; Host Details : local host is: "kjss1.example.com/172.26.69.237"; destination host is: "kjss2.example.com":8020; at org.apa
- In this article we will see that in general how ambari makes use of the Python "urllib2" and "json" (simplejson) module to query and parse the API data. - We will need to install the "simplejson" python module on our system. - Now we can simply write following kind of python script "/tmp/NameNodeMetricsDetails.py"import timeimport jsonimport urllib2import base64import pprint # Ambari Admin credentials.USERNAME = "admin"PASSWORD = "admin"# NameNode metrics.query = "http://kjss1:8080/api/v1/clusters/JoyCluster/services/HDFS/components/NAMENODE"connection_timeout = 30.0def get_json_beans(query, connection_timeout): response = None try: raw = "%s:%s" % (USERNAME, PASSWORD) auth = 'Basic %s' % base64.b64encode(raw).strip() request = urllib2.Request(query) request.add_unredirected_header('Authorization', auth) response = urllib2.urlopen(request, timeout=connection_timeout) data = response.read() data_dict = json.loads(data) return data_dict finally: if response is not None
HDFS Snapshots are read-only point-in-time copies of the file system. Snapshots can be taken on a subtree of the file system or the entire file system.Snapshots are very efficient because they only copy data that are changed. We can restore the data to any previous snapshot. Some common use cases of snapshots are Data backup and Disaster recovery.HDFS Snapshot Extension:Falcon will support HDFS snapshot-based replication through HDFS Snapshot extension. Using this feature,create and manage snapshots on source/target directories.Mirror data from source to target for disaster recovery using these snapshots.Perform retention on the snapshots created on source and target.Snapshot replication will only work from single source directory to single target directory.For snapshot to work, we expect users to do the followingBoth source and target clusters must have a version of Hadoop 2.7.0 or higher.The user submitting and scheduling the falcon extension should have permissions on both source a
Introduction Recently worked with use case which required heavy xml processing. Instead of writing complex custom code end up achieved everything easily with NiFi. I thought this will be useful of someone interested for XML processing in NiFi. The document in general covers the following. Base64 Encoding and Decoding of XML message.Character Set conversion from UTF to Ascii ISO-8859-1XML validation against the XSD.Split the XML into smaller chunks.Transform XML to JSON.Extract the content and outputs into unique files based on content. This is very generic XML processing flow which can be leveraged across many business use cases which process xml data. Apache NiFi Flow In the sample demo scenario, External system sends the Base64 encoded XML data in file format which is read through GetFile processor. Next Base64EncodeContent processor decoded the Base64 content.Incoming data in UTF-8 format with leading BOM bytes which gets converted to the ISO-8859-1 format using the ConvertCha
I have a Phoenix PutSQL that worked in the past, but not today. From the error box, not much help. Thought maybe Hbase or Phoenix was done. Turned out one field was missing. How to investigate this issue? Digging through the logs I quickly found it: Caused by: java.sql.SQLException: ERROR 218 (23018): Constraint violation. DRONEDATA1.DATEKEY may not be null That would be nice in the error listed in NiFi.If something seems like an odd error, dig into the logs for more detailed descriptions.Also the Summary Screen is pretty awesome and will let you find a lot of information for debugging and fixing problems.The Connections tab will let you sort by Queue Size and you can see if things are backed up.If you click the system diagnostics link you will see two tabs of useful information. The first has memory usage and garbage collection.The System tab has your usage for FlowFile and Content Repositories, processors and process load.For more details, check out the following reference
1. WASB --> https://blogs.msdn.microsoft.com/cindygross/2015/02/04/understanding-wasb-and-hadoop-storage-in-azure/WASB is a storage model which allows storage of data in Blobs within storage accounts/ containers in Azure cloud. 2. DASH --> http://sequenceiq.com/cloudbreak-deployer/latest/azure_pre_prov/ --> This link describes a few scale-out related limits of WASB, and proposes DASH as the solution. DASH is not supported as a storage option, and there are scalability limitations on the number of storage accounts. To quote, "When WASB is used as a Hadoop filesystem the files are full-value blobs in a storage account. It means better performance compared to the data disks and the WASB filesystem can be configured very easily but Azure storage accounts have their own limitations as well. There is a space limitation for TB per storage account (500 TB) as well but the real bottleneck is the total request rate that is only 20000 IOPS where Azure will start to throw errors when
Prior to Version 1.6.2-rc.8 version of Cloudbreak, provisioning of HDP Clusters on Azure was by Public IP only. This article describes provisioning of a cluster based on Private IP. While creating a Network within Cloudbreak, there are options to 1. Create a New Network and a new subnet2. Use an existing subnet in an existing virtual networkUnder the Option 2 "Use an existing subnet in an existing virtual network" There are 2 options added , a) Don't create public IPsb) Don't create new firewall rulesUpon selecting these options ( and using Private IP "export PUBLIC_IP=xx.xx.xx.xx" in the Profile file for Cloudbreak, ), Cloudbreak can install clusters using Private IP only in Azure cloud. A screen shot of this feature is attached here --> networkoptions.png
A usual query that comes up is on using snappy and other compression codes when loading data from hdfs using the nifi puthdfs component. A common error that users come across is "java.lang.UnsatisfiedLinkError". This error occurs because snappy and other compression codecs, which are part of the native linux binaries and which the java libraries for these codecs utilize to do the actual compression, are not in the path of the JVM. Since the JVM cannot find them the bindings fails and you get a java.lang.UnsatisfiedLinkError.Follow the following steps to resolve this issue.1. copy the native folder containing the compression libraries, from one of your hadoop nodes. cd /usr/hdp/x.x.x.x-xx/hadoop/lib/tar -cf ~/native.tar native/2. scp the native.tar from your hadoop node to your NiFi node, untar to a location of your choice. in my case i use /home/myuser/hadoop/ cd ~ mkdir hadoop cd hadoop tar -cf /path/to/native.tar3. go to your nifi folder , and open conf/bootstr
To upgrade JDK across all HDP services on all nodes using Ambari, the following instructions have proven to be helpful. This requires downtime on ALL HDP components.a. Use the 'Stop all' from the Actions button off the main Ambari dashboard to shut down all HDP components. b. Using Clush/Pdsh/Cluster scripting tool of choice, confirm that ALL Java processes are fully stopped across ALL cluster nodes (excluding Ambari), killing any orphaned processes that Ambari was unable to stop. c. Run the following from Ambari master node (as root) to stop the Ambari-agent and Ambari-server processes. service ambari-agent stop service ambari-server stop d. Run the following from Ambari-server master node (as root): ambari-server setup (and follow the prompts, example provided below) e.g.: [root@sandbox conf]# ambari-server setup Using python /usr/bin/python2.6 Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? n Adjusting a
Ambari REST APIs to add a component in kerberized cluster. I tried and tested these in Ambari 2.4.1 versionHere is an example to install SECONDARY_NAMENODE1. API to Add a Componentcurl -s -H "X-Requested-By:ambari" --user admin:admin -i -X POST -d '{"host_components":[{"HostRoles":{"component_name":"SECONDARY_NAMENODE"}}]}' http://AMBARIHOST:8080/api/v1/clusters/CLUSTERNAME/hosts?Hosts/host_name=COMPONENTHOST2. API to install the Above added component.curl -s -H "X-Requested-By:ambari" --user admin:admin -i -X PUT -d '{"RequestInfo":{"context":"Install SECONDARY_NAMENODE","operation_level":{"level":"HOST_COMPONENT","cluster_name":"test","host_name":"COMPONENTHOST","service_name":"HDFS"}},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://AMBARIHOST:8080/api/v1/clusters/CLUSTERNAME/hosts/COMPONENTHOST/host_components/SECONDARY_NAMENODE3. API to provide kerberos credentials.curl -s -H "X-Requested-By:ambari" --user admin:admin -i -X POST -d '{ "Credential" : { "principal" : "admin/admi
Status, Icons, and Color:The Apache Nifi 1.0 release brought its users a welcome refresh of the UI with emphasis on a flatter more modern design that included muting the color palette. While these updates have been well received the community around Apache Nifi requested that we "bring some color back". Well we listened and in Apache Nifi 1.1 we have introduced more color in the UI for easier recognition of status changes and necessary user actions!One area (identified by the community) where color makes sense are the icons. In many cases in the Nifi UI icons provide valuable feedback worthy of drawing the attention from the user. However not all icons meet this requirement. To differentiate it was decided that wherever icons are reporting status or require the user to take an action then the icon should receive color and if an icon invokes an action in the UI then it should not.Let's take a look at the canvas:At first glance you will notice the red bulletins and yellow warning icons "
If you wish to reference a file in S3 from a pig script you might do something like this:set fs.s3n.awsSecretAccessKey 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';set fs.s3n.awsAccessKeyId 'xxxxxxxxxxxxxxxxxxxxx';A = load 's3n://<bucket>/<path-to-file>' USING TextLoader;If you're on HDP 2.2.6, you'll likely see this error:Error: java.io.Exception, no filesystem for scheme: s3nThe following steps resolve this issue:In core-site.xml add:<property><name>fs.s3n.impl</name><value>org.apache.hadoop.fs.s3native.NativeS3FileSystem</value><description>The FileSystem for s3n: (Native S3) uris.</description></property>Then add to the MR2 and/or TEZ class path(s):/usr/hdp/${hdp.version}/hadoop-mapreduce/*These configs ensure 2 things:That the worker YARN containers spawned by pig have access to the hadoop-aws.jar fileThat the worker YARN containers know which class implements the file system type identified by "s3n://"References: Apache Mailing Lis
1. Install MySQL data Directories on a Non-root partition (Not /var/lib) 2. Create a dedicated least privileged account for Mysql deamon3. Disable MySQL Command History, Command History may contain passwords which is viewable by other users4. Disable interactive Login5. Disable login from nodes other than the those used by hive services6. Provide only hive user permission to the Hive metadata database within MySQL7. During installation do not specifify passwords in command line8. Ensure Data Directories for Mysql has appropriate permissions and ownerships9. Ensure only DBA administrators have full database access10. Ensure that database logging is enabled for error logs and log files are maintained on a non system partition11. Ensure that old passwords is not set to 1 12. Ensure secure_auth is set to ON13. Consider if your Component can work with the MYSQL "Connect using SSL" option
Objective The objective of this tutorial is to walk you through process of updating your Cloudbreak Deployer on Amazon AWS from 1.3 to 1.4. Once this is complete, you can now deploy an HDP 2.5 TP cluster. Prerequisites You should have deployed Cloudbreak 1.3 on Amazon AWS using the instructions found here: Cloudbreak Documentation 1.3 - AWS. You should add TCP port 443 to the security group on Amazon AWS as Cloudbreak 1.4+ appears to proxy requests from port 443 now. Do not run cbd start. Note: This process will update the Cloudbreak Deployer to the latest available version. At the time of initial writing, this was 1.4. As of September 1, 2016, the latest version is 1.6. Steps 1. Connect to your Cloudbreak Amazon AWS instance You should have access to your key file from amazon. Log into your Cloudbreak deployer instance using: ssh -i <amazon key file> cloudbreak@<amazon instance public ip> Note: If you have permission issues connecting via ssh, make sure you
- One approach can be to check the Ambari Blueprint to see what changes are made by comparing last two results. Following approach can be integrated inside a shell script (cronjob) to poll the config changes at some regular interval and to find the "diff" between current and last output files "/tmp/cluster-`date +'%Y%m%d%H%M'`.txt"Example: curl -o "/tmp/cluster-`date +'%Y%m%d%H%M'`.txt" -u admin:admin -H "X-Requested-By: ambari" -X GET http://c6401.ambari.apache.org:8080/api/v1/clusters/ClusterDemo?format=blueprint .- Users can also check the output of below REST call to browse "service_config_versions"curl -u admin:admin -i -H 'X-Requested-By: ambari' -X GET http://c6401.ambari.apache.org:8080/api/v1/clusters/ClusterDemo/configurations/service_config_versions.Above would list the service config versions of all services. At any time users make the above call, it would provide the complete history of service config changes. For more information on this please refer to: https://cwiki.
Maintenance Mode supports suppressing alerts and skipping bulk operations for specific services, components and hosts in an Ambari-managed cluster.There are many scenarios when we may want to turn on Maintenance Mode specially when we are performing hardware or software maintenance, changing configuration settings, troubleshooting, decommissioning, or removing cluster nodes. In such scenario we can place a service, component, or host object in Maintenance Mode before we start to perform necessary maintenance or troubleshooting tasks. In maintenance mode following things happen: 1. It causes suppression of alerts, warnings and status change indicators generated for the object. 2. It exempts an object from host-level or service-level bulk operations. Although it can be done from the ambari UI, However here in this article we will see how to manage the maintenance mode for some Services like HBase using the APIs.Turning ON Maintenance Mode for any specific component (like: region server o
Many times it is needed to monitor the ambari memory usage. JConsole and JVisualVM are the JDK provided JMX client utilities that can be used for the same. Here in this demo we will see how to monitor ambari server's JVM memory using $JAVA_HOME/bin/jvisualvm (same steps will be applicable for jconsole as well)Step-1). We will need to add the "com.sun.management.jmxremote" related JVM remoted jmx options to the "/var/lib/ambari-server/ambari-env.sh" as following.export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -Djava.security.auth.login.config=/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=4444 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'For more information on JVMs standard jmxremote options please refer to : http://docs.oracle.com/javase/7/docs/technotes/guides/management
Steps to configure ambari-server to archive log files.1. Open /etc/ambari-server/conf/log4j.properties file,log4j.appender.file=org.apache.log4j.RollingFileAppenderlog4j.appender.file.File=${ambari.log.dir}/${ambari.log.file}log4j.appender.file.MaxFileSize=80MBlog4j.appender.file.MaxBackupIndex=60log4j.appender.file.layout=org.apache.log4j.PatternLayoutlog4j.appender.file.layout.ConversionPattern=%d{DATE} %5p [%t] %c{1}:%L - %m%ntolog4j.appender.file=org.apache.log4j.rolling.RollingFileAppenderlog4j.appender.file.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy log4j.appender.file.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy log4j.appender.file.File=${ambari.log.dir}/${ambari.log.file}log4j.appender.file.triggeringPolicy.MaxFileSize=10485760log4j.appender.file.layout=org.apache.log4j.PatternLayoutlog4j.appender.file.layout.ConversionPattern=%d{DATE} %5p [%t] %c{1}:%L - %m%nlog4j.appender.file.rollingPolicy.FileNamePattern=${ambari.log.dir}/${amba
This has been observed for Ambari 1.7. I know Ambari 1.7 is very old now however if some people are still using it and facing same issue then this post can save your lot of time! 🙂.We know that Ambari 1.7 has Ganglia for reporting metrics..Our issue was, we were unable to get service metrics for YARN service, below was the exact scenario:1. In Ganglia UI, I was able to get graphs for the YARN Metrics.2. In Ambari UI, I was able to see metrics for other services like HDFS etc.3. This issue was observed on one of our customer's cluster.4. I did setup same cluster on my local system however I was not able to reproduce this issue.5. Only difference in customer's and my cluster was, customer was having RM HA and I had installed single node instance.6. There was no error while getting metrics, please see below screenshot when metrics were not visible..How to troubleshoot:1. Click on any of the metrics, say 'Nodemanagers' --> This will open graph in big window.2. Open the developer tools
Apache Knox provides a gateway to HiveServer2 which can be used to proxy connections to Hive from BI tools like Tableau Desktop. With a secure cluster HiveServer2 is kerberized, which usually means the client must have a valid TGT in their ticket cache in order to authenticate to HiveServer2.The Knox gateway can simplify this in many environments, by supporting client authentication to kerberized Hive without a TGT. The client authenticates to Knox via, say, LDAP authentication, and HiveServer2 trusts Knox to proxy connections on behalf of this user. Another benefit of using Knox is that client doesn't need to know where HiveServer2 is hosted, so if an administrator needs to move it to another master node, this is transparent to the applications connecting via Knox.In the environment for this walkthrough, I have Tableau Desktop 10.0.1 installed, and I'll be using HDP 2.5. The first step is to ensure you have the latest Hortonworks ODBC Driver for Apache Hive, 2.1.5 at the time of this
Sqoop OverviewSqoop is a tool designed to transfer data between Hadoop and relational databases or mainframes. You can use Sqoop to import data from a relational database management system (RDBMS) such as MySQL or Oracle or a mainframe into the Hadoop Distributed File System (HDFS), transform the data in Hadoop MapReduce, and then export the data back into an RDBMS.Sqoop automates most of this process, relying on the database to describe the schema for the data to be imported. Sqoop uses MapReduce to import and export the data, which provides parallel operation as well as fault tolerance.Sqoop Performance Tuning Best PracticesTune the following Sqoop arguments in JDBC connection or Sqoop mapping to optimize performance batch•split-by and boundary-query•direct•fetch-size•num-mapper•2.Inserting Data in BatchesSpecifies that you can group the related SQL statements into a batch when you export data. The JDBC interface exposes an API for doing batches in a prepared statement with multiple
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.