Find and share helpful community-sourced technical articles
Recently active
Step1: Please allow below ports from your OS firewall for Ambari.https://ambari.apache.org/1.2.5/installing-hadoop-using-ambari/content/reference_chap2_7.html.Step2: Please go though the required component and allow below ports from your OS firewall for HDP.https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_HDP_Reference_Guide/content/accumulo-ports.html.Step 3: In order to allow YARN jobs to run successfully, we need to add custom TCP port range to the YARN configuration.Login to Ambari UI --> Select Mapreduce2 --> Configs --> Customer mapred-site --> Add/Modify below propertyyarn.app.mapreduce.am.job.client.port-range=32000-65000 Notes: 1. 32000-65000 is the port range which will be used by Application Master to connect to Node Managers. .2. You can increase the number of ports based on job volume. .How to add exception in Centos7 firewall?Example for Step 3.#firewall-cmd --permanent --zone=public --add-port=32000-65000/tcp#firewall-cmd --reload Please comment i
HDP Sandbox comes pre-installed with SparkR and R . First let's setup the R Studio on the HDP Sandbox: To download and install RStudio Server open a terminal window and execute the commands corresponding to get the 64-bit version wget https://download2.rstudio.org/rstudio-server-rhel-0.99.893-x86_64.rpmsudo yum install --nogpgcheck rstudio-server-rhel-0.99.893-x86_64.rpmsudo rstudio-server verify-installationsudo rstudio-server stopsudo rstudio-server start Now setup a local user on the hdp sandbox, to access the rstudio: useradd alexpasswd xxxx Next launch web-browser and point to : http://sandbox.hortonworks.com:8787/ Login using the local account created earlier above. Next lets initialize the sparkr in "yarn-client" mode Sys.setenv(SPARK_HOME="/usr/hdp/current/spark-client/").libPaths(c(file.path(Sys.getenv("SPARK_HOME"),"R","lib"),.libPaths()))library(SparkR)sc <- SparkR::sparkR.init(master = "yarn-client") Run the code in rstudio , you should get the following output:
Note: I used TinyCert to generate my own certificate authority and certificates. Probably the easiest way to generate new certificates Create your own certificate authority. Fill in your own values. Create 2 new certificates. One is your client certificate (in this case, bbukacek) and a server certificate which will be used for the NiFi keystore.Client CertificateServer Certificate Download the certificate authority, the client and server certificates and upload to your NiFi environment.Note: Easiest way is to download the client and server certificates in PKCS12 format Create a TrustStore We will use the certificate authority to create the TrustStore. Use the following syntax to create the TrustStore:> keytool -import -file <ca_file>.pem -alias cacert -keystore truststore.jks -storepass <password> Configure NiFi Now that the TrustStore is created we can configure NiFi Keystore and TrustStore.Under $NIFI_HOME/conf, open the nifi.properties.Set the web properties First an
ProblemUsing rhive with following parameters to connect to hivelibrary(RHive)Sys.setenv(HADOOP_CONF_DIR="/etc/hadoop/conf")Sys.setenv(RHIVE_HIVESERVER_VERSION="2")Sys.setenv(HIVE_HOME="/usr/hdp/current/hive-client")Sys.setenv(HADOOP_HOME="/usr/hdp/current/hadoop-client")rhive.init()> rhive.connect()2016-10-26 13:06:22,836 INFO [main] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated(1173)) - fs.default.name is deprecated. Instead, use fs.defaultFS2016-10-26 13:06:23,720 WARN [main] util.NativeCodeLoader (NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable2016-10-26 13:06:24,631 WARN [main] shortcircuit.DomainSocketFactory (DomainSocketFactory.java:<init>(117)) - The short-circuit local reads feature cannot be used because libhadoop cannot be loaded.2016-10-26 13:06:25,237 INFO [Thread-5] jdbc.Utils (Utils.java:parseURL(309)) - Supplied authorities: 127.0.0.1:10000
Step1). Get all the properties from the below command: (Here : "http://jss1:8080" is the URL where ambari server is running)curl --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://jss1:8080/api/v1/clusters/JoyCluster/configurations?type=cluster-env\&tag=version1Step2). Save the output from above command to a file. Or just open the URL in browser and save it to a file:http://jss1:8080/api/v1/clusters/JoyCluster/configurations?type=cluster-env&tag=version1.For example here i got the following output from the above URL:{ "href" : "http://jss1:8080/api/v1/clusters/JoyCluster/configurations?type=cluster-env&tag=version1", "items" : [ { "href" : "http://jss1:8080/api/v1/clusters/JoyCluster/configurations?type=cluster-env&tag=version1", "tag" : "version1", "type" : "cluster-env", "version" : 1, "Config" : { "cluster_name" : "JoyCluster", "stack_id" : "HDP-2.4" }, "properties" : { "fetch_nonlocal_groups"
One of the great things about Apache NiFi is its ability to consume and transform many formats of data, however a particular area of complexity has been around the transformation of JSON data received (i.e. JSON-to-JSON transformation). Take the case of the GetTwitter processor that provides access to Twitter data streams (either from a filtered search, sample set, or firehose endpoints). For anyone who has worked with Twitter’s JSON schema it is very rich with detailed information for an individual tweet. There are cases where a lot of this data isn’t required for analytics and data flow managers or analysts are looking to pare it down to the necessities. There are also instances where incoming JSON data simply needs to be formatted or re-labeled for use in another system or repository, such as Hive, HBase, or MongoDB. Outside of NiFi, JSON-to-JSON transformation has been simplified in the Jolt Java library which offers a declarative approach to defining JSON output. Jolt provi
Objectives Upon completion of this tutorial, you should have a 3 node cluster of NiFi running on CentOs 7.2 using Vagrant and VirtualBox.Prerequisites You should already have installed VirtualBox 5.1.x. Read more here: VirtualBox You should already have installed Vagrant 1.8.6. Read more here: Vagrant NOTE: Version 1.8.6 fixes an annoying bug with permissions of the authorized_keys file and SSH. I highly recommend you upgrade to 1.8.6. You should already have installed the vagrant-vbguest plugin. This plugin will keep the VirtualBox Guest Additions software current as you upgrade your kernel and/or VirtualBox versions. Read more here: Vagrant vbguest plugin You should already have installed the vagrant-hostmanager plugin. This plugin will automatically manage the /etc/hosts file on your local mac and in your virtual machines. Read more here: Vagrant hostmanager pluginScope This tutorial was tested in the following environment: Mac OS X 10.11.6 (El Capitan) VirtualB
Observed in Teradata's distribution of Hortonworks, when ACID is enabled via Ambari, following error can show up.Error: java.lang.AbstractMethodError: Method org/postgresql/jdbc3/Jdbc3ResultSet.isClosed()Z is abstract (state=,code=0)org.apache.hive.service.cli.HiveSQLException: java.lang.AbstractMethodError: Method org/postgresql/jdbc3/Jdbc3ResultSet.isClosed()Z is abstract at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:258) at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:244) at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:247) at org.apache.hive.beeline.Commands.execute(Commands.java:848) at org.apache.hive.beeline.Commands.sql(Commands.java:713) at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:983) at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:718) at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:767) at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:485) at org.apache.hive.beeline.BeeLine.main(Be
SYMPTOM: Hive query through knox fails quickly with a a 500 error. ERROR: You will find something like this in the gateway-audit.logdispatch|uri|http://<hostname>:10000/cliservice?doAs=dav|success|Response status: 500 ROOT CAUSE: Size of query being sent is larger than default replayBufferSize. RESOLUTION: Change your topology to contain the following parameter in the service that is having the issue.<param><name>replayBufferSize</name><value>16</value></param> For example if I had this issue in hive it would look something like:<service> <role>HIVE</role> <url>$HTTP_SCHEME://$HIVE_HOST:10001/cliservice</url> <param><name>replayBufferSize</name><value>16</value></param> </service> The Value of the replayBufferSize is in KB and has a default of 8KB. Make sure the value is larger than your largest query size in order to get past this issue.
SysDigSysDig (Github) is an open source tool that allows for the exploration, analysis and trouble shooting of Linux systems and containers. It is well documented and very easy to install and use. It can be used for container and Linux system diagnostics, security analysis, monitoring and basic system information capture. Remember that sysdig can produces thousands of lines of messages and can continue doing so forever depending on the options selected. Check out the examples and read through all the options, you can monitor a ton of data really fast and also check for security anomalies.NiFi Ingesting SysDigSysdig can produce amazing amounts of logs. I chose to ingest 1 second chunks as ASCII JSON. I selected those options and listed them below. The results are arrays of JSON. I decided it's best to save them as a large JSON files for now and convert them to ORC later for Hive analysis in Zeppelin. You could also split them into individual JSON rows and process those.
A few weeks ago, we announced the availability of Hortonworks Connected Data Cloud for AWS Technical Preview. We have just updated the Technical Preview (to RC#36) with the following new features:Ability to manage cluster templates to make re-using cluster configurations a whole lot easierAbility to set custom properties on cluster create to fine-tune your cluster configurationCheckout the Release Notes for more details:http://hortonworks.github.io/hdp-aws/releasenotes/Get Started and Launch Hortonworks Cloud in your AWS environment:http://hortonworks.github.io/hdp-aws/Check it out. You can provide feedback and ask questions here at the Hortonworks Community Connection:http://hortonworks.github.io/hdp-aws/feedback/#how-to-create-a-questionHave fun!
Below are the steps for Oozie database migration from Derby to Mysql. Step 1 - Have MySQL server installed and ready to be configured. .Step 2 - Stop Oozie service from Ambari UI. .Step 3 - On Ambari Server, run below command ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar Note - Please pass appropriate driver if /usr/share/java/mysql-connector-java.jar does not exists. . .Step 4 - Login to Mysql server as root user and create a blank 'oozie' database and grant required permissions to the 'oozie' user. #create database oozie; #grant all privileges on oozie.* to 'oozie’@‘<oozie-server>' identified by 'oozie’; Note - 'oozie' is your oozie database password, if you want you can change it in above command . .Step 5 - Add mysql database server details in Oozie configuration via Ambari UI..Step 6 - Make sure that you have mysql connector jar under Oozie libext (/usr/hdp/<version>/oozie/libext/mysql-connector-java.jar), if not then cop
We just updated Hortonworks Data Cloud for AWS to Technical Preview #3. This update includes the following new features: Ability to use an Existing VPC for the Cloud Controller and your clusters.Centrally manage your Hive Metastore database instances, to make re-using the Metastore between clusters much easier.Optionally receive an email notification once your cluster is ready.Checkout the Release Notes for more details:http://hortonworks.github.io/hdp-aws/releasenotes/Get Started and Launch Hortonworks Data Cloud in your AWS environment:http://hortonworks.github.io/hdp-aws/Check it out. You can provide feedback and ask questions here at the Hortonworks Community Connection:http://hortonworks.github.io/hdp-aws/feedback/#how-to-create-a-questionHave fun!
IntroductionHow many times we've heard that a problem can't be solved if it isn't completely understood? However, all of us, even when having a lot of experience and technical skill, we still tend to jump to the solution workspace by-passing key steps in the scientific approach. We just don’t have enough patience and, quite often, the business is on our back to deliver a quick fix. We just want to get it done! We found ourselves like that squirrel in the Ice Age chasing for the acorn just using our experience and minimal experiment, dreaming that the acorn will fall on our lap. This article is meant to re-emphasize a repeatable approach that can be applied to tune Storm topologies starting from understanding the problem, forming a hypothesis, testing that hypothesis, collecting the data, analyzing the data, drawing conclusions based on facts and less on empirical. Hopefully it helps to catch more acorns!Understand the ProblemUnderstand the functional problem resolved by the topology; q
SYMPTOM : Immediately after exporting HDFS directories via NFS , some of the directories start throwing permission denied errors to authorized users added in Ranger policies.ROOT CAUSE : NFS neither honors Ranger policies nor HDFS ACLs. If a directory has HDFS permission bits such as 000 and access is controlled fully via Ranger, this directory won’t be exported at all. Messages such as below can be seen in NFS gateway logs :- 2016-07-27 17:35:19,071 INFO mount.RpcProgramMountd (RpcProgramMountd.java:mnt(127)) - Path /test1 is not shared. 2016-07-27 17:35:37,297 INFO mount.RpcProgramMountd (RpcProgramMountd.java:mnt(127)) - Path /test2 is not shared. 2016-07-27 17:39:34,581 INFO mount.RpcProgramMountd (RpcProgramMountd.java:mnt(144)) - Giving handle (fileId:12345) to client for export /Even if the directory gets exported due to some available permissions, effective permission bits are only from HDFS and not from Ranger policies.
SYMPTOMS : Errors such as "KeeperErrorCode = NoAuth for /config/topics"ROOT CAUSE : Errors such as above are reported while trying to create or delete topic from an ordinary user because only the process owner of Kafka service such as root can write to zookeeper znodes i.e. /configs/topics.Ranger policies do not get enforced when a non privileged user creates a topic is because kafka-topics.sh script talks directly to zookeeper in order to create the topics. It will add entries into the zookeeper nodes and the watchers on the broker side will monitor and create topics accordingly. Due to this process involving zookeeper, the authorization cannot be done through the ranger plugin. NEXT STEPS : If one would want to allow users to be able to create topics, We have a script called kafka-acls.sh which would help allow or deny users on topics and many such options. The details are elaborated in the document mentioned below :- http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_secure-
SizingThere's no simple rule of thumb for this, it's as much an art as it is a science, as it depends on the workloads and how chatty they are with your current ZKs.One way to look at this is:If you have 3 ZKs you can afford to lose one, if you have 5 you can afford to lose two.If your IT is aggressively applying security patches and other upgrades, like firmware, kernel, Java, other packages used by Hadoop tools, and taking nodes down to do the job, then during those upgrades with 3 ZKs, you ZK runs with only two nodes, and if you are unlucky and one of them goes down, then your whole cluster will go down. So, in this case 5 are better.Warning: the more ZK nodes you have, the slower the ZK becomes for writes.PlacementZookeeper is a master node, as such it can be collocated with other master services. Ideally, you would not want to collocate it with an HA service. It is quite light on memory and CPU requirements, but since is disk intensive, don't collocate it with disk-intensive servi
Disable Transparent Huge Pages (THP)Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages.However THP feature is known to perform poorly in Hadoop cluster and results in excessively high CPU utilization.Disable THP to reduce the amount of system CPU utilization on your worker nodes. This can be done by ensuring that both proc entries are set to [never] instead of [always].Use Recommended File System TypesSome file systems offer better performance and stability than others. As such, the HDFS dfs.datanode.data.dir and YARN yarn.nodemanager.local-dirs should be configured to use mount points that are not formatted with the most optimal file systems. Take a look at this article on file system choices: https://community.hortonworks.com/articles/14508/best-practices-linux-file-systems-for-hdfs.htmlDisable Host SwappinessThe Linux kernel pr
Linux ACLs are implemented in such a way that setting default ACLs on parent directory shall automatically get inherited to child directories and umask shall have no influence in this behavior. However HDFS ACLs have slightly different approach here, they do take into account umask set in hdfs-site.xml in parameter "fs.permissions.umask-mode" and enforce ACLs on child folders based on these two parameter with umask taking precedence over the other.Let's try and reproduce this case :- [gaurav@test ~]$ fs -mkdir /tmp/acltest [gaurav@test ~]$ fs -setfacl -m default:mask::rwx /tmp/acltest [gaurav@test ~]$ fs -setfacl -m mask::rwx /tmp/acltest [gaurav@test ~]$ fs -setfacl -m default:user:adam:rwx /tmp/acltest [gaurav@test ~]$ fs -setfacl -m user:adam:rwx /tmp/acltest Let's see what ACLs are implemented :- [gaurav@test~]$ fs -getfacl /tmp/acltest # file: /tmp/acltest # owner: gaurav# group: hdfs user::rwx user:adam:rwx group::r-x mask::rwx other::r-x default:user::rwx default:user:adam:rwx d
Below are the steps to run Hive(TEZ) query in a shell script using Oozie shell action.1. Configure job.propertiesExample:#*************************************************# job.properties#*************************************************nameNode=hdfs://<namenode-fqdn>:8020jobTracker=<resourcemanager-host-fqdn>:8050queueName=defaultexamplesRoot=examplesoozie.use.system.libpath=trueoozie.wf.application.path=${nameNode}/user/${user.name}/.2. Configure Workflow.xmlExample:<?xml version="1.0" encoding="UTF-8"?><workflow-app xmlns="uri:oozie:workflow:0.4"name="test-shell-with-kerberos-wf"> <global> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </property> <property> <na
HiveServer2 does not expose jmx or equivalent metrics but often we require to monitor the Hiveserver2 process to know cpu usage, heap usage and state of various thread along with some other params like no of class loaded by hs2 jvm. it is also very useful if you want to run some cpu/memory sampling to profile hiveserver2.Step 1: login into Ambari and open hive advanced configurationStep 2: expand advanced hive-env settings and add the following configuration in hive-env templateif [ "$SERVICE" = "hiveserver2" ]; then export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8008"fiStep 3: Restart HiveServer2Step 4: on client machine open jvisualvm($JAVA_HOME/bin), once open go to File -> Add JMX Connection -> enter hostname and port no(it's 8008 in this case) and you are good to go.
If you are not using any Hive Authorization like SQL Standard Authorization or Ranger and you don't want other to read/write data and allow the only owner to read & write, and allowing the group to read.Changing the warehouse directory permission.1.From the command line in the Ambari server node, edit the file/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.pySearch for hive_apps_whs_dir which should go to this block: params.HdfsResource(params.hive_apps_whs_dir, type="directory", action="create_on_execute", owner=params.hive_user, group=params.user_group, mode=0755 ) Modify the value for mode from 0755 to the desired permission, for example, 0777.Save and close the file.Restart the Ambari server to propagate the change to all nodes in the cluster:ambari-server restartIt may take a few seconds to update the file in the Ambari agents on all nodes. To verify if the change has been applied on a particular node, check the content of
I recently ran into a situation where I had enabled HDFS HA and later had to change the value of dfs.nameservices. So basically during HA setup I set the value for dfs.nameservices to "MyHorton", but a couple hours later realized I should have used "MyCluster" instead.This article explains how you can change the dfs.nameservices value after HDFS HA has been enabled already. Background: What is the purpose of dfs.nameservices? Its the logical name of your HDFS nameservice. Its important to remember that there are several configuration parameters that have a key, which includes the actual value of dfs.nameservices, e.g. dfs.namenode.rpc-address.[nameservice id].nn1Preparation: Put your HDFS in safemode and backup the namespace (https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#dfsadmin; dfsadmin -safemode enter; dfsadmin -saveNamespace); Stop Namenode service Backup Hive Metastore (mysqldump hive > /tmp/mydir/backup_hive.sql) Change Configuration
Although it is a simple solution, there is not much reference to this exact problem in the www.We have seen people doing multiple projection, flattening and group by to get the data into shape for storing into the final table using pig after the aggregation and group operations.Source Table:CREATE EXTERNAL TABLE IF NOT EXISTS source(pk1 string,pk2 string,agg1 INT,agg2 INT)STORED AS ORC tblproperties("orc.compress"="ZLIB");Data:Target Table:CREATE EXTERNAL TABLE IF NOT EXISTS target_aggregated(pk1 string,pk2 string,sum_agg1 BIGINT,sum_agg2 BIGINT)STORED AS ORC tblproperties("orc.compress"="ZLIB");Pig Script:--Load the data in pig relationsstaging = LOAD 'DEFAULT.SOURCE' USING org.apache.hive.hcatalog.pig.HCatLoader();--Group the datagroup_staging = group staging BY (pk1,pk2);--Flatten the grouped data and generate aggregates with same attribute names as the target tablecalculate_group_staging = FOREACH group_staging GENERATE FLATTEN(group) AS(pk1,pk2),SUM(staging.agg1) as sum_agg1, SU
Pre-requisite :Remove the incubator-ranger project from eclipse if it's already there and close the eclipse. Clone incubator-ranger repo in the local machine from GitHub. Ignore this step if you have already cloned the required ranger branch. To check out the code from Apache Incubator-ranger GIT repository refer below command. For example :git clone https://github.com/apache/incubator-ranger.git Set JAVA_HOME in the environment variable.For example : export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64 Install maven 3.3.9 or higher. Ignore this step if required version of maven is already installed. To get the installed maven version try command : mvn -versionFor example : cd /usr/local wget http://mirror.fibergrid.in/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz tar xvf apache-maven-3.3.9-bin.tar.gzSet maven command line tool in the system path environment variable:For example : export M2_HOME=/usr/local/apache-maven-3.3.9export M2=$M2_HOME/binexport PATH=$M2:
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.