Find and share helpful community-sourced technical articles
Recently active
STEPS :Take a backup of your Ambari database before executing the below command as you are issuing a delete command.curl --insecure -u admin:<password> -H 'X-Requested-By: ambari' -X DELETE http://<ambari-server-fqdn>:8080/api/v1/groups/<group name you wanted to delete>
An OutputCommitter that commits files specified in job output directory i.e. ${mapreduce.output.fileoutputformat.outputdir}. in mapred-site.xml The file output committer algorithm version valid algorithm version number: 1 or 2 default to 1 The file output committer has three phases 1.Commit task Recover task Commit Job If you choose version value to be Version 1 : 1. Commit task will rename the directory from $joboutput/_temporary/$appAttemptID/_temporary/$taskAttemptID/ to $joboutput/_temporary/$appAttemptID/$taskID/ , to put it in a simple way it just reduces one subdirectory. 2. RecoverTask will also do a rename of $joboutput/_temporary/$appAttemptID/$taskID/ to $joboutput/_temporary/($appAttemptID + 1)/$taskID/ 3. Commit Job will merge every task output in $joboutput/_temporary/$appAttemptID/$taskID/ to the path which is specified in the mapreduce.output.fileoutputformat.outputdir $joboutput/, then it will delete $joboutput/_temporary/ and write $joboutput/_SUCCESS It has a perfor
HDF Version: 2.1.2Test Environment: Single AWS VPC with multiple subnets, EC2 Security Groups with port rules controlling access between subnets, AWS LogFlow to track accepted/rejected traffic, 1 EC2 instance for Management, 3 EC2 instances for worker nodes, Laptop on public IP for remote access.Deployment / Testing Method: Installed baseline of Ambari, Ambari Infra, Ambari Metrics, NiFi Certificate Authority, Zookeeper Cluster, NiFi Cluster, ClientsAdded RangerEnabled SSL across all servicesTested all commonly used interfaces, checked for rejected trafficNot Tested: Using External LDAP/AD servicesUsing external Certificate AuthorityConnecting to Auxiliary servicesDeployment TopologyZoneM(anagement)D(ata)R(emote)P(ublic)MembersManagement NodeWorker Nodes 1,2,3Other NiFi ClusterUsersServicesAmbari Infra (Infra Solr), Ranger, Metrics Collector, Grafana, Metrics Monitor, Nifi Certificate Authority, Clients (Infra Solr, ZooKeeper)NiFi, Zookeeper, Metrics Monitor, Clients (Zookeper)NiFiBro
STATEMENT: Ambari audit log file gets generated from Ambari ver. 2.4 - https://issues.apache.org/jira/browse/AMBARI-15241. PROBLEM: How can I enable ambari audit in Ambari ver. 2.2.2? SOLUTION: To get ambari 2.2.2 having the audit, follow up the below instruction. This would be to change log level to DEBUG for this PersistKeyValueService class. - log into ambari node- edit /etc/ambari-server/conf/log4j.properties- set (or add) the following property:log4j.logger.org.apache.ambari.server.api.services.PersistKeyValueService=DEBUG- save the changes- run: $ ambari-server restart
It is known that in a secure Kafka environment, we need to explicitly authorize user/principal to either read/write to a Kafka topic as shown belowGrant Read/Write Access to a TopicTo add the following ACL:"Principals user:bob and user:alice are allowed to perform Operation Read and Write on Topic Test-Topic from Host1 and Host2"run the CLI with the following options:bin/kafka-acls.sh --add --allow-principal <strong><em>User</em></strong>:bob --allow-principal User:alice --allow-host host1 --allow-host host2 --operation Read --operation Write --topic test-topicGrant Full Access to Topic, Cluster, and Consumer GroupTo add ACLs to a topic, specify --topic <topic-name> as the resource option. Similarly, to add ACLs to cluster, specify --cluster; to add ACLs to a consumer group, specify --consumer-group <group-name>.The following examples grant full access for principal bob to topic test-topic and consumer group 10, across the cluster. Substitute your ow
A often requested feature has popped up in HDP 2.5, Phoenix namespace mapping AKA Phoenix schemas. This feature allows creation of schemas and development within a schema work space. This guide will walk through steps to enable this feature and how to use it.Use Case:Create 2 schemea named "schema1" and "scheama2"Within both schemas create table customer.Create another schema named "schema3". Drop schema "schema3"Note - A schema can only be dropped if it is empty (does not host any tables).1. Through Ambari go to HBase. Select Advanced tab 2. Add a parameter to hbase-site.xml. To do this go to "Custom hbase-site" and click on "Add Property"3. Add the property Key: phoenix.schema.isNamespaceMappingEnabled Value: trueClick on Add button. A restart hbase service will be required. 4. Test the functionality, use sqlline.py. It is located under /usr/hdp/current/phoenix/binNote - I am using /usr/hdp/2.5.0.0-1245/phoenix/bin since I want to prove to the audience I am in fact using HDP 2.
When Ranger service is configured for using custom PID file location and custom user using HDP-2.5, below steps need to be followed.1) Edit ranger-admin-services.sh script file: This file is located at /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh which have hard-coded default path as pidf=/var/run/ranger/rangeradmin.pid. Need to update the hard-coded path with the custom value specified from Ambari in ranger_pid_dir property under Advanced ranger-env section. Also update the hard-coded user used for chown {pidf} with the service user’s name given during installation of Ranger service on a Misc Tab from Ambari.Update PID location:pidf={custom_pid_path}/rangeradmin.pidUpdate service user:chown {custom_user} ${pidf}2) Edit ranger-usersync-services.sh: This file is located at /usr/hdp/current/ranger-usersync/ranger-usersync-services.sh. Similar changes are required to update the hard-coded pid location and hard-coded service user for Ranger Usersync component.Update PID locat
Here is the steps to access HDFS UI through Knox. This is tried and tested with Ambari 2.4 and HDP2.51. Make sure Knox is configured properly and it works fine.2. ssh to Knox gateway host and go to /var/lib/knox/data-2.5.3.0-37/services3. download the configurations from https://github.com/apache/knox/tree/v0.11.0/gateway-service-definitions/src/main/resources/services/hdfsui/2.7.0/ URL.4. make sure your folder structure should look alike /var/lib/knox/data-2.5.3.0-37/services/hdfsui/2.7.0 and should have rewrite.xml and service.xml files5. change the owner/Group permissions to Knox for /var/lib/knox/data-2.5.3.0-37/services/hdfsui/ and subdirectory6. Go to Knox configurations Modify "Advanced topology" with below service tag <service> <role>HDFSUI</role> <url>http://NNHOST:50070</url> </service>7.Restart Knox service.8. You should be able to access Name node UI from the below URL https://Knxo-host:8443/gateway/default
In the past, if Select returned no rows, hadoop would still create an empty file. Some customer would use this file to help with their work flow. In https://issues.apache.org/jira/browse/HIVE-13040 this was fixed, because anyone using cloud based solutions could be charged for empty files, so it was determined that hadoop should not write the files.
SYMPTOM Concurrency issues hit during multi-threaded moveFile issued when processing queries such as "INSERT OVERWRITE TABLE ... SELECT .." The following pattern is displayed in stack trace:Loading data to table testdb.test_table from hdfs://xyz/ra_hadoop/.hive-staging_hive_2017-01-31_14-09-52_561_8101886747064006778-4/-ext-10000 ERROR : Failed with exception java.util.ConcurrentModificationException org.apache.hadoop.hive.ql.metadata.HiveException: java.util.ConcurrentModificationException at org.apache.hadoop.hive.ql.metadata.Hive.moveFile(Hive.java:2883) at org.apache.hadoop.hive.ql.metadata.Hive.replaceFiles(Hive.java:3140) at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1727) at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:353) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1745) at org.apache.h
OverviewAmbari's Kerberos Descriptor is JSON-formatted document used to help Ambari enable Kerberos for installed services. The descriptor contains the information needed to create the required principals and keytab files. It also declares configuration changes needed by the serviced so they a are configured for Kerberos properly. The Kerberos Descriptor is comprised of the compiled Kerberos descriptors found in the relevant service definitions with user-specified changes applied to it. This combination of data is known as the "Composite Kerberos Descriptor", where the separate parts are known as the "Stack-level Kerberos Descriptor" and the "User-specified Kerberos Descriptor". Each of these descriptors may be obtained from Ambari via is REST API:GET /api/v1/clusters/{CLUSER_NAME}/kerberos_descriptors/COMPOSITEGET /api/v1/clusters/{CLUSER_NAME}/kerberos_descriptors/STACKGET /api/v1/clusters/{CLUSER_NAME}/kerberos_descriptors/USERNOTE: Be sure to replace {CLUSTER_NAME} when the name o
How to set up a Ranger enabled cluster using Ambari-blueprint. In order to setup a cluster using Ambari blueprints we will need a minimum three node cluster.Lets say this cluster contains three hosts as below:simple-ranger-a.comsimple-ranger-b.comsimple-ranger-c.com Pre-requisites: To setup a Ranger enabled cluster we need to install ambari-server on one of the hosts can be the called the gateway node let and ambari-agents should be installed on all the nodes.All the ambari-agents should be configured to point to the ambari-server on the gateway node.Note : The operating system used for this setup is Cent-OS.Lets consider the gateway node to be simple-ranger-a.com, to install ambari-server on this host we need to add ambari repository to the OS repositories. To update the OS repository we add ambari.repo file to /etc/yum.repos.d/ directory. Next we do a refresh of the OS repositories using command yum clean allThen we run the command yum install -y ambari-server ambari-agent, this wi
For users having hive insert query with dynamic partition, and partitions (> 10) on a column, you may notice that your query is generating too many small files per partition. INSERT OVERWRITE TABLE dB.Test partition(column5)select column1 ,column2 ,column3 ,column4 ,column5from Test2;For Example, if your table has 2000 partitions, and your query is generating 1009 reducers (hive.exec.reducers.max), then you might end up with 2 million small files. To Understand "How Does Tez determine the number of reducers" refer: https://community.hortonworks.com/articles/22419/hive-on-tez-performance-tuning-determining-reducer.html)This could result into issues with:1. HDFS Namenode performance:Refer: https://community.hortonworks.com/articles/15104/small-files-in-hadoop.html2. File Merge Operation failing due java.lang.OutOfMemoryError: GC overhead limit exceeded .» File Merge , java.lang.OutOfMemoryError: GC overhead limit exceeded at java.lang.StringCoding$StringDecoder.decode(StringC
IoTWorking with IoT data is a many layered process, not unlike a parfait. Scratch that, an Onion. In fact, an Onion Omega2, which is a great device that I just got yesterday does IoT really easily. This is so much easier to setup that RPI or other platforms. It also has a ton of pluggable modules that stack on top of this small chip. It's pretty small powered, but it's under $10.The device is extremely well documented at their site.Needed to run real tools, I added a USB stick and used that for storage and for extra SWAP space.opkg updateopkg install kmod-usb-storage-extras e2fsprogs kmod-fs-ext4umount /tmp/mounts/USB-A1mkfs.ext4 /dev/sda1mkdir /mnt/sda1mount /dev/sda1 /mnt/sda1mount /dev/sda1 /mnt/ ; tar -C /overlay -cvf - . | tar -C /mnt/ -xf - ; umount /mnt/opkg updateopkg install block-mountopkg updateopkg install swap-utils block-mountdd if=/dev/zero of=/tmp/mounts/USB-A1/swap.page bs=1M count=256mkswap /tmp/mounts/USB-A1/swap.pageswapon /tmp/mounts/USB-A1/swap.pagefreeb
SYMPTOM: When you create an Oozie workflow which contains a SSH function, it can fail with an error of "Not able to perform operation [ssh -o PasswordAuthentication=no -o KbdInteractiveDevices=no -o StrictHostKeyChecking=no -o ConnectTimeout=20 root@localhost mkdir -p oozie-oozi/0000009-131023115150605-oozie-oozi-W/Ssh--ssh/ ] | ErrorStream: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)." ROOT CAUSE: Passwordless SSH must be setup correctly from oozie@server1 to $user@server2For example: RESOLUTION: If an Oozie workflow contains an ssh command from server 1 to server 2 as root, then the passwordless SSH must be setup as the following: oozie@server1 > root@server2 This article created by Hortonworks Support (Article: 000001722) on 2015-04-01 11:05 OS: Linux Type: Configuration,Executing_Jobs
Depends on whether we are talking about under HDFS or at the OS level, but the answer to both is Yes...For accounts under HDFS, the home directory is determined by the value of dfs.user.home.dir.prefix. see: https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/hdfs-default.xmlFor OS users you can pre-create your service users before install, then set ignore_groupsusers_create=true in cluster-env.xml, and then launch the installer. The service users and groups are here: http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.3/bk_command-line-installation/content/create-system-users-and-groups.html
This tutorial will demonstrate how to execute PySpark jobs on an HDP cluster and pass in parameter values using the Livy REST interface. I will also demonstrate how to interact with Livy via Apache Zeppelin and use forms in Zeppelin to pass in parameter values. Livy is an open source REST interface for interacting with Spark. Livy requires at least Spark 1.6. By default, Livy is built against Apache Spark 1.6.2 with HDP 2.5.3 If on HDP 2.4.2, then Livy 0.2.0 might be part of HDP 2.4.2 repos. If not, then it can be cloned from: https://github.com/cloudera/livy Livy is built against Apache Spark 1.6.2 with HDP 2.5.3. The following was tested with HDP 2.5.3 and Spark 1.6.2. Business Use Case: A PySpark script that resides on the Livy server aggregates order statistics from a Hive table for a date range passed in as parameters to the Python script. The Start and End dates are passed in as parameter values to the Python script. The job runs on the cluster via YARN and produces the followi
it is not completely obvious but you can certainly run Python scripts within Oozie workflows using the Shell action.Here's a sample job.properties file, nothing special about it.nameNode=hdfs://sandbox.hortonworks.com:8020jobTracker=sandbox.hortonworks.com:8050queueName=defaultexamplesRoot=oozieoozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/pythonHere's a sample workflow that will look for a script called script.py inside scripts folder<workflow-app xmlns="uri:oozie:workflow:0.4" name="python-wf"> <start to="python-node"/> <action name="python-node"> <shell xmlns="uri:oozie:shell-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${queueName}</value> </p
When upgrading to HDP 2.5 or later with Falcon, you might encounter the following error when starting the ActiveMQ server: ERROR - [main:] ~ Failed to start ActiveMQ JMS Message Broker. Reason: java.lang.NegativeArraySizeException (BrokerService:528)You might also encounter this error if downgrading Falcon from HDP 2.5 to an earlier release. If you encounter this error, delete the ActiveMQ history and then restart Falcon. If you want to retain the history, be sure to back up the ActiveMQ history prior to deleting it. cd <ACTIVEMQ_DATA_DIR>rm -rf ./localhostcd /usr/hdp/current/falcon-server su -l <FALCON_USER> ./bin/falcon-stop ./bin/falcon-start
Original ArticleCan I authorize access to Kafka over a non-secure channel via Ranger?Yes. you can control access by ip-address.Can I authorize access to Kafka over non-secure channel by user/user-groups?No, one can’t use user/group based access to authorize Kafka access over a non-secure channel. This is because it isn't possible to assert client’s identity over the non-secure channel.Why do we have to specify public user group on all policies items created for authorizing Kafka access over non-secure channel? Kafka can’t assert the identity of client user over a non-secure channel. Thus, Kafka treats all users for such access as an anonymous user (a special user literally named ANONYMOUS).Ranger's public user group is a means to model all users which, of course, includes this anonymous user (ANONYMOUS).What are the specific things to watch out for when setting up authorization for accessing Kafka over non-secure channel? Make sure that all broker-ips have Kafka admin access to all t
ERRORS:from HDFS log:016-10-30 17:44:04,226 ERROR impl.CloudSolrClient (CloudSolrClient.java:requestWithRetryOnStaleState(903)) - Request to collection ranger_audits failed due to (401) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://hwx.com:8886/solr/ranger_audits_shard1_replica1: Expected mime type application/octet-stream but got text/html. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>Error 401 Authentication required</title> </head> <body><h2>HTTP ERROR 401</h2> <p>Problem accessing /solr/ranger_audits_shard1_replica1/update. Reason: <pre> Authentication required</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/> From Hive log:016-10-30 17:50:46,189 WARN [org.apache.ranger.audit.queue.AuditBatchQueue1]: provider.BaseAuditHandler (BaseAuditHandler.java:logFailedEven
PROBLEM:Hive queries were getting stuck/hang on both mr and tez engines while selecting from a table containing few csv files. While the query was working fine for few csv files, for others it just hangs. Nothing in the logs also. I was using Hive 1.2.1 on HDP 2.5.3.0 After some investigation, I found out that those files have some empty values '' in the fields where an rpad function was getting used. You can easily reproduce the issue by firing:select rpad('',1,''); You will see that the query just hangs.The reason is it goes to an infinite loop. More details here: HIVE-15792 RESOLUTION: nvl will not work in this case. That is select nvl('','D'); --will return '' I resolved using a query like this:SELECT rpad(CASE WHEN LENGTH(nvl(COLUMN_NAME,null)) > 0 THEN COLUMN_NAME ELSE null END, 1, ''); In this case the query will return null for both null and empty string values occurring in COLUMN_NAME. Hope this helps. Thanks, Rajdeep
Original postUse case: Access control on table customer, exclude column SSN.User Hive has access to see only name column. Access on column SSN is restricted.Column level security can be controlled in couple of clicks by Ranger UI.
Need to upload and share some of your application logs with a the support team or a costumer and tried of doing bunch of ssh, scp ...? https://transfer.sh/ is your tool !for instance assume you want to upload hello.txt.curl --upload-file ./hello.txt https://transfer.sh/hello.txtYou will get a unique shareable link once the upload is done.https://transfer.sh/66nb8/hello.txtMore examples can be found here
I found it tricky to make Kafka to work with SSL in a kerberized cluster. In this article I share ambari settings I used and console (producer/consumer) sample commands:1- Install Ambari and deploy a cluster with Kafka2- Kerberize cluster using Ambari (it can be AD Wizard, MIT Kerberos or Manual Keytabs)3- Create keystore and truststore with proper certificates, more details here: http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.0/bk_security/content/ch_wire-ssl-certs.html4- Change Kafka Settings on Ambari as below:Kafka Brokers - Listerners: listeners=SASL_PLAINTEXT://localhost:6667, SASL_SSL://localhost:6668Custom kafka-broker - security.inter.broker.protocol=SASL_PLAINTEXTCustom kafka-broker - ssl.client.auth=noneCustom kafka-broker - ssl.key.password=YOUR-PASSWORDCustom kafka-broker - ssl.keystore.location=/path-to-your-keystoreCustom kafka-broker - ssl.keystore.password=YOUR-PASSWORDCustom kafka-broker - ssl.truststore.location=/path-to-your-truststoreCustom kafka-broker - ss
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.