Member since
04-03-2019
962
Posts
1743
Kudos Received
146
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 15040 | 03-08-2019 06:33 PM | |
| 6186 | 02-15-2019 08:47 PM | |
| 5105 | 09-26-2018 06:02 PM | |
| 12618 | 09-07-2018 10:33 PM | |
| 7459 | 04-25-2018 01:55 AM |
07-31-2016
03:44 AM
@Saurabh Kumar - Nice Article! P.S - I have removed username and replaced it with $user in the logs.
... View more
07-30-2016
11:00 PM
3 Kudos
@Vaibhav Kumar these log4j related warnings are okay to ignore. did you get any other error on console or in logs? if yes then can you please let us know?
... View more
07-30-2016
10:02 PM
For me also it worked. While running distcp for secured clusters.
... View more
07-30-2016
07:34 PM
2 Kudos
@Brian Weissler Is your hiveserver2 listening on 10001? You can test it by running netstat command on HS2 server netstat -tulpna|grep 10001
... View more
07-29-2016
05:37 PM
@Artem Ervits There is a typo at below line #! /usr/bin/env pythonimport os, pwd, sys It should be like: #! /usr/bin/env python
import os, pwd, sys
... View more
07-29-2016
05:28 AM
4 Kudos
@Gopichand Mummineni I got this working Please refer https://community.hortonworks.com/content/kbentry/48132/oozie-shell-action-run-hive-query-in-shell-script.html
... View more
07-29-2016
05:26 AM
4 Kudos
Below are the steps to run hive query in a shell script using Oozie shell action . 1. Configure job.properties Example: #*************************************************
# job.properties
#*************************************************
nameNode=hdfs://<namenode-fqdn>:8020
jobTracker=<resourcemanager-host-fqdn>:8050
queueName=default
examplesRoot=examples
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/ . 2. Configure Workflow.xml Example: <workflow-app xmlns="uri:oozie:workflow:0.3" name="shell-wf">
<credentials>
<credential name='my_auth' type='hcat'>
<property>
<name>hcat.metastore.uri</name>
<value>thrift://<hive-metastore-hostname>:9083</value>
</property>
<property>
<name>hcat.metastore.principal</name>
<value>hive/_HOST@HWX.COM</value>
</property>
</credential>
</credentials>
<start to="shell-node"/>
<action name="shell-node" cred="my_auth">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<exec>test.sh</exec>
<file>/user/<username>/test.sh</file>
</shell>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
. 3. Write sample shell script Example:
#!/bin/bashhive -e "SET mapreduce.job.credentials.binary=$HADOOP_TOKEN_FILE_LOCATION; select count(*) from test_hive;" . 4. Upload workflow.xml and shell script to "oozie.wf.application.path" defined in job.properties . 5. Follow below command to run Oozie workflow
oozie job -oozie http://<oozie-server-hostname>:11000/oozie -config /$PATH/job.properties -run Please note - This has been successfully tested with hive.execution.engine=mr; . Please comment if you have any question! Happy Hadooping!! 🙂
... View more
Labels:
07-27-2016
12:09 AM
@Gopichand Mummineni - I got it working. I will write a blog and update you shortly
... View more
07-26-2016
06:54 PM
@Gerd Koenig Thanks. Sure In next post, We can cover NN/RM HA via Blueprints.
... View more
07-26-2016
04:34 PM
@Sai ram - No you cann't. But you can write a shell action and in shell script you can execute this command as well as mail command
... View more