Find and share helpful community-sourced technical articles
Recently active
Hivemall: Machine Learning on Hive, Pig and Spark SQL Install HiveMall https://github.com/myui/hivemall/wiki/InstallationPick latest release https://github.com/myui/hivemall/releases # Setup Your Environment $HOME/.hivercadd jar /home/myui/tmp/hivemall-core-xxx-with-dependencies.jar; source /home/myui/tmp/define-all.hive;# Create a directory in HDFS for the JARhadoop fs -mkdir -p /apps/hivemallhdfs dfs -chmod -R 777 /apps/hivemallcp hivemall-core-0.4.2-rc.2-with-dependencies.jar hivemall-with-dependencies.jarhdfs dfs -put hivemall-with-dependencies.jar /apps/hivemall/hdfs dfs -put hivemall-with-dependencies.jar /apps/hive/warehouse/hdfs dfs -put hivemall-core-0.4.2-rc.2-with-dependencies.jar /apps/hivemallshow functions "hivemall.*";+-----------------------------------------+--+| tab_name |+-----------------------------------------+--+| hivemall.add_bias || hivemall.add_feature_index || hivemall.amplify
Download URLCrazy (http://www.morningstarsecurity.com/downloads/urlcrazy-0.5.tar.gz) An Example Command Line Run for URLCrazy [root@tspanndev13 security]# ./url.sh dataflowdeveloper.comTypo Type,Typo,Valid,Pop,DNS-A,CC-A,Country-A,DNS-MX,ExtnCharacter Omission,daaflowdeveloper.com,true,,,?,,com,Character Omission,dataflodeveloper.com,true,,,?,,com,Character Omission,dataflowdeeloper.com,true,,,?,,com,Character Omission,dataflowdeveloer.com,true,,,?,,com,Character Omission,dataflowdevelope.com,true,,,?,,com,Character Omission,dataflowdeveloper.cm,true,,,?,,cm,Character Omission,dataflowdeveloper.co,false,,,?,,,Character Omission,dataflowdeveloper.om,false,,,?,,,Character Omission,dataflowdevelopercom,false,,,?,,,... Shell Script to Call From Apache NiFi /opt/demo/security/urlcrazy-0.5/urlcrazy -i -f csv -p $@ An Example Command Line Run for NSLookup Non-authoritative answer:sparkdeveloper.com text = "v=spf1 ip4:00.000.0.0/24 ip4:00.000.00.0/24 ip4:11.111.111.0/19 ?all" The Final JSON O
BackgroundWhen we use NiFi flow to load Adobe ClickStream tsv file into hive, we found around 3% rows are in wrong format or missed.Source Data Quality$ awk -F "\t" '{print NF}' 01-weblive_20161014-150000.tsv | sort | uniq -c | sort 1 154 1 159 1 162 1 164 1 167 1 198 1 201 1 467 2 446 2 449 2 569 6 13 10 3 13 146 13 185 15 151 16 54 18 433 21 432 22 238 23 102 26 2 34 138 179 1319412 670After clean the tsv$ awk -F "\t" 'NF == 670' 01-weblive_20161014-150000.tsv >> cleaned.tsv$ awk -F "\t" '{print NF}' cleaned.tsv | sort | uniq -c | sort319412 670Still missed a few percent rows.Root Cause and SolutionWe are using ConvertCSVToAvro and ConvertAvroToORC.The clickstrem tsv files have " in them and the ConvertCSVtoAvro processor uses " as the value for the "CSV quote Character" processor configuration property by default. As a result many tabbed fields end up in the same record. We can get good output by changing this configuration property to anothe
ISSUE :When we click on Datanodes tab on Namenode UI, nothing happens. ROOT CAUSE : This is happening because of https://issues.apache.org/jira/browse/HDFS-10888 and https://issues.apache.org/jira/browse/HDFS-9193 which is fixed in Hadoop version 2.8. But HDP 2.5 is on Hadoop 2.7. RESOLUTION/WORKAROUND : To resolve this, we can work around by editing the below file on both the namenodes/usr/hdp/current/hadoop-hdfs-client/webapps/hdfs/dfshealth.js and changing } else if (u.usedPercentage < 85) {to } else if (v < 85) {We should be able to access datanode tabs after restarting namenode.
Special thanks to Michael Young for the help to be my mentor.Step1:cd /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs/conf/screen-shot-2016-11-21-at-100524-am.pngStep2:vi managed-schema: add these 3 lines<field name="_timestamp_" type="date" indexed="true" stored="true" multiValued="false" /> <field name="_ttl_" type="string" indexed="true" multiValued="false" stored="true" /> <field name="_expire_at_" type="date" multiValued="false" indexed="true" stored="true" />screen-shot-2016-11-21-at-100929-am.pngStep3:vi solrconfig.xml on the same directory.Replace the below 3 lines with the lines after it: <updateRequestProcessorChain name="add-unknown-fields-to-the-schema"> <!-- UUIDUpdateProcessorFactory will generate an id if none is present in the incoming document --> <processor />as<updateRequestProcessorChain name="add-unknown-fields-to-the-schema"> <processor> <str name="fieldName"&g
The scope of this article is to explore ways to simulate Slowly changing dimension (SCD-Type2), given the append-only nature of HAWQ, the idea is to capture delta from source systems and have a flag in each row which shows whether the row is A-Append, U-Update or D-Delete, this will ensure that we can capture this information in our base tables in HAWQ. In an Enterprise Data Lake, you will come across scenarios where you have to capture updates/deletes from Source Systems, since HAWQ is append-only, we do need an alternative way to simulate this, which we discuss in this article. For each source table, we will create a corresponding base table, and then create view on top of it for access. The base table will have 2 additional attributes “update_version” and “delete_flag”, the “update_version” of type “bigserial” which will be an auto increment number which will track which version of the row is the latest, largest number would signify most recent record. The “delete_flag” would dete
Known issue :There is a known issue with this configuration. When Ranger service is installed using custom user (Service user’s name can be updated during installation of a service on a Misc Tab on Ambari) and location of PID file was changed by the user (i.e. value of below given property is changed from its default.), there is an issue with service startup. On Ambari Configs section of Ranger : ranger-env / ranger_pid_dir = /var/run/ranger ## is a default valueIf user changes value of the above property to be a different folder, there is an issue with usersync service startup. When usersync start command is called, it invokes /grid/0/hdp/<version>/ranger-usersync/ranger-usersync-services.sh script, which has hardcoded value of PID file for usersync process and the owner as ‘ranger’. Because of this, usersync restart will fail as custom service user does not have permission to create or write pid file on the directory owned by user ‘ranger’.WorkaroundIn order to solve above
Question:I have installed HDP cluster using Ambari which has Ranger service installed and working properly. I enabled the plugin Kafka for Ranger. I noticed something a little bit annoying. If Ranger Admin is down, Kafka will take a long time to start, because it tries to connect to Ranger Admin to get the repository. The error log is something like as shown below -### Will retry 74 time(s), caught exception: Connection failed to Ranger Admin. Reason - [Errno 111] Connection refused.. Sleeping for 8 sec(s) ### Is there a way to decrease this number of retry or the duration of sleep between retry ? Ranger Admin down should not have any impact on the components for which the plugins are enabled, right ? Findings: Ambari uses the following Script to return the ranger admin login check response. /usr/lib/ambari-agent/lib/resource_management/libraries/functions/ranger_functions_v2.py and (ranger_functions.py) /usr/lib/ambari-server/lib/resource_management/libraries/functions/ranger_funct
PROBLEM STATEMENT: Ambari not displaying and service action buttons after login. It displays "Move Master Wizard In Progress". Not able to perform any operation from ambari and same is affecting for all users.ERROR: ROOT CAUSE: The issue seems that the user who logged inn to ambari UI[acting as admin], has tried to perform operation which was left in middle and just logged off from UI. The operation was cached in ambari UI and hence is reflected for other users in UI.RESOLUTION: Take ambari server backup and run below command from Ambari node - curl -u admin:admin -i -H 'X-Requested-By: ambari' -X POST -d '{"wizard-data":"{\"userName\":\"<username>\",\"controllerName\":\"<controller_name>\"}"}'
PROBLEM STATEMENT: We have recently added 40 Datnodes added to cluster and they went down immediately after adding. Below was the exception found - ERROR:ROOT CAUSE:Customer added the 40nodes to the cluster running rack topology script as per link given - https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_hdfs_admin_tools/content/ch05.htmlThe topology script which was copied by customer from above link was missing "fi" on last line and hence was giving above exception. RESOLUTION: Populated corrected script rack-topology.sh on namenode and datanodes and tried starting the datanodes after which datanode service was able to startup.
PROBLEM STATEMENT: Customer deleted hdfs repository from ranger ui. Tried re-enabling plugin but the repository was getting created. Reinstalled ranger, but still no luck.There was alert saying - "Ranger Admin Password check"Text is: This alert is used to ensure that the Ranger Admin password in Ambari is correct. Response is: User:amb_ranger_admin credentials on Ambari UI are not in sync with Ranger Doing a test and changing ranger_admin_password to admin in Ambari. Configs->Advanced Restarting Ranger, not prompted but doing so anyway.Also changed local password on ranger admin host: [root@ip-172-53-51-18 admin]# passwd amb_ranger_admin Changing password for user amb_ranger_admin. New password: Retype new password: passwd: all authentication tokens updated successfully. Did restart of HDFS, but now HDFS was not coming up. ERROR: Ranger admin log error:2016-08-26 11:06:22,917 [http-bio-6080-exec-4] INFO org.apache.ranger.common.RESTErrorUtil (RESTErrorUtil.java:311) - Operation er
PROBLEM STATEMENT: We have a strange problem with ranger. When I do a "select * from <table>; "I can see in ranger, on hive audit, that my user (dnid) is getting logged correctly. But when I look at the same situation on hdfs audit it shows that another user did the request. This Is to me very strange, I´ve tried with different users and the same problem happens again. ERROR: ROOT CAUSE: This is known issue and a BUG -https://issues.apache.org/jira/browse/HIVE-13120http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.2/bk_HDP_RelNotes/content/fixed_issues.html BUG-53108HIVE-13120 RESOLUTION: Changed the below property in hiveserver2 configs and restarted hiveserver2 after which the Ranger HDFS audit was showing user as hive in HDFS audit.From:"hive.server2.enable.doAs"=trueTO:"hive.server2.enable.doAs"=false
PROBLEM STATEMENT: There are frequent email alerts from HiveServer2 Metastore process which are misleading. When check the HiveServer2 Metastore process is up and running fine without issue. ERROR: Below is sample email alert - Ambari Alerts log output shows -/var/log/ambari-server/ambari-alerts.log ROOT CAUSE: The issue was with kerberos credentials for ambari-qa user. RESOLUTION:HiveServer2 Metastore alert is triggered from the node on which the service is installed. "ambari-qa" user is used by ambari to trigger the alert. If you are using kerberized cluster make sure you have "ambari-qa" ticket in place else false alert will be triggered.You can use below command to check -$su - ambari-qa $klist <--[make sure you have valid ticket]$hive --hiveconf hive.metastore.uris=thrift://<hive_mestastore_host>:9083 --hiveconf hive.metastore.client.connect.retry.delay=1 --hiveconf hive.metastore.failure.retries=1 --hiveconf hive.metastore.connect.retries=1 --hiveconf hive.metastore
PROBLEM STATEMENT: I would like to change the default password for rangertagsync. According to the manual https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.0/bk_command-line-installation/content/ch13s05s04.htmlI should just run the python updatetagadminpassword.py after changing the password in ranger. However I get error as shown below -ERROR: [root@test ranger-tagsync]# pwd/usr/hdp/current/ranger-tagsync[root@test ranger-tagsync]# python updatetagadminpassword.py 2016-11-18 09:30:08,311 [E] Required file not found: [/usr/hdp/2.5.0.0-1245/ranger-tagsync/conf/ranger-tagsync-site.xml][root@test ranger-tagsync]# Debugging Steps: From the above logs its clear that "ranger-tagsync-site.xml" is missing.But when check using "rpm -qa |grep tagsync" I see the rpm was installed [root@thakur2 ranger-tagsync]# rpm -qa |grep tagsyncranger_2_5_0_0_1245-tagsync-0.6.0.2.5.0.0-1245.el6.x86_64 2. Check the "rpm -ql" on package to make sure "ranger-tagsync-site.xml" comes from same package, but
PROBLEM STATEMENT:#hdfs dfsadmin -report shows "Blocks with corrupt replica : 20 "& #hdfs fsck / shows " Corrupt blocks : 0 "But.. "Corrupted block" shows as 20 from Ambari and Summary of HDFS services shows " Block 20 corrupt / 0 missing / ... "ERROR: Please find the screenshot below -Ambari Output:FSCK output:DFSADMIN output: ROOT CAUSE: Ambari shows its "Corrupted Block" but its "Corrupted Replica" RESOLUTION: This is a BUG -https://hortonworks.jira.com/browse/BUG-41958, which is fixed in Ambari version-2.2.2
PROBLEM STATEMENT:Running the python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py on the ambari metrics server I get every service running again, except the ambar-metrics-collector: The process is running, but there are two alerts left: Metrics Collector Process - Connection failed: [Errno 111] Connection refused to XXXXX:6188 Metrics Collector - HBase Master Process - Connection failed: [Errno 111] Connection refused to XXXXXX:61310 ERROR: 0x15741734f740003, negotiated timeout = 12000007:57:42,262 INFO [main] ZooKeeperRegistry:107 - ClusterId read in ZooKeeper is null07:57:42,341 WARN [main] HeapMemorySizeUtil:55 - hbase.regionserver.global.memstore.upperLimit is deprecated by hbase.regionserver.global.memstore.size07:58:13,170 INFO [main-SendThread(localhost:61181)] ClientCnxn:1142 - Unable to read additional data from server sessionid 0x15741734f740001, likely server has closed socket, closing socket connection and attempting reconnect07:58:13,170 INFO [main-
SmartSense 1.3 includes Activity Explorer, which hosts prebuilt notebooks that visualize cluster utilization data related to user, queue, job duration, and job resource consumption, including an HDFS Dashboard notebook. This dashboard helps operators better understand how HDFS is being used and which users and jobs are consuming the most resources within the file system.It's important to note that the source data for ACTIVITY.HDFS_USER_FILE_SUMMARY comes from fsimage, which does not contain file- and directory-level information. Many operators are also interested in more fine-grained analytics regarding cluster data use, which can drive decisions such as storage tiering using HDFS heterogeneous storage.Since these data are not available in fsimage, we will use the Ranger audit data for HDFS which the Ranger plugin writes during authorization events. The best practice is for the plugin to write these data to both Solr (for short-term use, driving performance in the UI) as well as HDFS f
Problem Statement: Created a user in Ranger. After sometime the user is not reflecting in ranger ui. But he user is reflecting in Ranger DB table x_user and in usersync logs we see the user is getting synchronized all the time.The user was LDAP user and there was no issue with other users.ERROR: Below is the issue snap -"testuser" is not displayed in Ranger UI but its reflected in Ranger DB as shown below- ROOT CAUSE: It seems the database for the particular user was corrupted.RESOLUTION: Inserted below value to the table "x_portal_user_role" after which issue was resolved. INSERT INTO x_portal_user_role VALUES(NULL,'2016-09-09 00:00:00','2016-09-09 00:00:00',1,1,(SELECT id FROM x_portal_user WHERE login_id='XXXX'),'ROLE_USER',1); ### NOTE: Replace XXXX with the login_id(username used for login into ranger portal) of the user ('XXXX') You can replace 'ROLE_USER' with 'ROLE_SYS_ADMIN' if you want it to be an admin
Problem Statement: Downgrading HDP which failed on restarting Namenode service and struck on below error -resource_management.core.exceptions.Fail: The NameNode None is not listed as Active or Standby, waiting...ERROR:===Traceback (most recent call last):File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 420, in <module>NameNode().execute()File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in executemethod(env)File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 720, in restartself.start(env, upgrade_type=upgrade_type)File "/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py", line 101, in startupgrade_suspended=params.upgrade_suspended, env=env)File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py", line 89, in thunkreturn fn(*args, **kwargs)File "/var/lib/ambari-agent/cache/common-services/HD
ISSUE: 1. While performing HDP upgrade from 2.4.2 to 2.5.0 and which failed on last step Finalize upgrade saying few hosts are not able to upgrade to latest version.2. Tried to revert the upgrade and proceeded with Downgrade option.3. While Downgrade it prompt for Atlas and Kafka to be deleted from Cluster. 4. Deleted Atlas and Kafka from cluster.5. Proceeding further the stopping of service failed on to stop KAFKA6. The downgrade screen was paused and not it was showing in Ambari UI details tab that it "Failed to start KAFKA_BROKER" ROOT CAUSE: Looks like there are two tasks stuck in the PENDING state from the downgrade RESOLUTION: 1. You need to check at what step the upgrade is stuck using below command -
IntroductionThis article is a continuation of Geo-spatial Queries with Hive Using ESRI Geometry Libraries article published a few months ago.ObjectiveDemonstrate how to use Hive context and invoke built-in ESRI UDFs for Hive from Spark SQL.Pre-requisites HDP 2.4.2Steps documented on Geo-spatial Queries with Hive Using ESRI Geometry Libraries Steps1. Launch spark-shell with--jarsas its parameter:spark-shell --jars /home/spark/esri/esri-geometry-api.jar,/home/spark/esri/spatial-sdk-hive-1.1.1-SNAPSHOT.jarI placed the dependency jars to /home/spark/esri path, but you can store them in hdfs or local filesystem and grant proper privileges to your spark user.2. Instantiate sqlContext:val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc);3. From spark-shell, define temporary functions:sqlContext.sql("""create temporary function st_point as 'com.esri.hadoop.hive.ST_Point'""");sqlContext.sql("""create temporary function st_x as 'com.esri.hadoop.hive.ST_X'""");4. From spark-shell, invok
IntroductionTrident processes a stream in batches of tuples for a defined topology. Currently, there is no windowing support of tuples in a trident stream. This section describes how windowing is supported in trident.Below types of windows can be defined for batches of tuples based on processing time or count. Tumbling windowSliding windowTumbling windowTuples are grouped in a single window based on processing time or count. Any tuple belongs to only one of the windows. Below is the new API on org.apache.storm.trident.Stream./**Returns a stream of tuples which are aggregated results of a tumbling window with every {@code windowCount} of tuples.*/public Stream tumblingWindow(intwindowCount, WindowsStoreFactory windowStoreFactory,Fields inputFields,Aggregator aggregator,Fields functionFields)/** * Returns a stream of tuples which are aggregated results of a window that tumbles at duration of {@code windowDuration} */public Stream tumblingWindow(BaseWindowedBolt.Duration windowDuration
ISSUE: Hive view is not working. ERROR: H100 Unable to submit statement show databases like '*': org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out ROOT CAUSE: Issue was with mysql pool connection size limit exceeded.Check using -mysql> SHOW VARIABLES LIKE "max_connections";+-----------------+-------+| Variable_name | Value |+-----------------+-------+| max_connections | 100 |+-----------------+-------+1 row in set (0.00 sec) RESOLUTION: Modified mysql pool size limit from 100 to 500 and restarted mysql which resolved the issue.mysql> SET GLOBAL max_connections = 500;Query OK, 0 rows affected (0.00 sec)mysql> SHOW VARIABLES LIKE "max_connections";+-----------------+-------+| Variable_name | Value |+-----------------+-------+| max_connections | 500 |+-----------------+-------+1 row in set (0.00 sec)
SYMPTOM: Standby NN crashing due to edit log corruption and complaining that OP_CLOSE cannot be applied because the file is not under-construction ERROR:2016-09-30T06:23:25.126-0400 ERROR org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader: Encountered exception on operation CloseOp [length=0, inodeId=0, path=/appdata/148973_perfengp/TARGET/092016/tempdb.TARGET.092016.hdfs, replication=3, mtime=1475223680193, atime=1472804384143, blockSize=134217728, blocks=[blk_1243879398_198862467], permissions=gsspe:148973_psdbpe:rwxrwxr-x, aclEntries=null, clientName=, clientMachine=, overwrite=false, storagePolicyId=0, opCode=OP_CLOSE, txid=1585682886] java.io.IOException: File is not under construction: /appdata/148973_perfengp/TARGET/092016/tempdb.TARGET.092016.hdfs at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.applyEditLogOp(FSEditLogLoader.java:436) at org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.loadEditRecords(FSEditLogLoader.java:230) at org.apache.hadoop.hdfs.serve
Check out the HDC on AWS technical preview documentation and learn how to use HDC to create clusters on AWS. The steps are pretty simple, even if you are new to AWS:Log in to your AWS account or create one.Create an AWS key pair.Launch a cloud controller instance. If you're just getting started with AWS, select the first deployment option.Log in to the cloud controller and create clusters.Use the link on the dashboard to log in to Ambari.This documentation is work in progress. We would love to hear your feedback and suggestions for improving it. Feel free to comment below.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.