Oozie Hadoop Streaming(Oozie Hadoop Streaming)
我正在尝试编写一个简单的地图,只有hadoop流式传输作业从hdfs读取数据并将其推送到vertica。
我写了几个shell脚本如下
load.sh
hadoop jar hadoop-streaming-2.7.3.2.5.3.0-37.jar -input $INPUT_DIR -mapper /user/oozie/adhoc_data_load/scripts/export.sh -output $OUTPUT_DIR
export.sh
./vsql -c "copy $TABLE from stdin delimiter E'\t' direct null '\\N';" -U $DBUSER -w $DBPWD -h $DBHOST -p $DBPORT
工作流程:
<action name="loadToVertica"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>loadVertica.sh</exec> <argument>${STREAMING_JAR_PATH}</argument> <argument>${nameNode}/user/oozie/optus_adhoc_data/${exportDataDate}</argument> <argument>${TABLE_NAME_VERTICA}</argument> <argument>${dbHost}</argument> <argument>${dbName}</argument> <argument>${dbPassword}</argument> <argument>${dbPort}</argument> <argument>${nameNode}/user/oozie/optus_adhoc_data/output/${exportDataDate}</argument> <argument>vsql,export.sh</argument> <file>${nameNode}/user/oozie/adhoc_data_load/scripts/loadVertica.sh#loadVertica.sh</file> <file>${wfsBasePath}/libs/${STREAMING_JAR_PATH}#${STREAMING_JAR_PATH}</file> <file>${wfsBasePath}/config/vsql#vsql</file> <file>${wfsBasePath}/scripts/export.sh#export.sh</file> <capture-output/> </shell> <ok to="end"/> <error to="end"/> </action>
使用Oozie用户运行它获得以下异常:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=yarn, access=WRITE, inode="/user/yarn/.staging":hdfs:hdfs:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:319)
解:
添加工作流程:
HADOOP_USER_NAME = $ {WF:用户()}
I am trying to write a simple map only hadoop streaming job reading data from hdfs and pushing it to vertica.
I have written few shell scripts as below
load.sh
hadoop jar hadoop-streaming-2.7.3.2.5.3.0-37.jar -input $INPUT_DIR -mapper /user/oozie/adhoc_data_load/scripts/export.sh -output $OUTPUT_DIR
export.sh
./vsql -c "copy $TABLE from stdin delimiter E'\t' direct null '\\N';" -U $DBUSER -w $DBPWD -h $DBHOST -p $DBPORT
Workflow:
<action name="loadToVertica"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>loadVertica.sh</exec> <argument>${STREAMING_JAR_PATH}</argument> <argument>${nameNode}/user/oozie/optus_adhoc_data/${exportDataDate}</argument> <argument>${TABLE_NAME_VERTICA}</argument> <argument>${dbHost}</argument> <argument>${dbName}</argument> <argument>${dbPassword}</argument> <argument>${dbPort}</argument> <argument>${nameNode}/user/oozie/optus_adhoc_data/output/${exportDataDate}</argument> <argument>vsql,export.sh</argument> <file>${nameNode}/user/oozie/adhoc_data_load/scripts/loadVertica.sh#loadVertica.sh</file> <file>${wfsBasePath}/libs/${STREAMING_JAR_PATH}#${STREAMING_JAR_PATH}</file> <file>${wfsBasePath}/config/vsql#vsql</file> <file>${wfsBasePath}/scripts/export.sh#export.sh</file> <capture-output/> </shell> <ok to="end"/> <error to="end"/> </action>
Running it with Oozie user getting below exception:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=yarn, access=WRITE, inode="/user/yarn/.staging":hdfs:hdfs:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:319)
Solution:
Add in workflow :
HADOOP_USER_NAME=${wf:user()}
原文:https://stackoverflow.com/questions/44498025
最满意答案
我对你有一个想法,而不是将图像放在要滚动的元素的上方,如何将它放在它们下面,以相同的不透明度显示。
然后也改变你正在滚动的div的不透明度。 这会让它看起来像在下面。
你会添加:
$(document).ready(function(){ $(document).on('click', function(){ $('#VCBody').prepend('<div class="vcBodyShadow">3</div>'); $('.vcElementContainer').css('opacity','0.5'); }); });
.vcBodyShadow{ position:absolute; top:0; left:0; width:100%; height:100%; background-color: red; z-index:1; opacity: 0.5; font-size: 100px; font-weight: bold; padding: 50px; } #VCBody{ position:relative; height:100%; width:100%; overflow:auto; } .vcElementContainer { display:flex; align-items:center; justify-content:space-around; flex-wrap: wrap; height: $height; width:$width; overflow:hidden; position:relative; z-index:2; background-color:yellow; min-height:100px; margin:20px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html> <body> <div id="VCBody"> <div class="vcElementContainer">1</div> <div class="vcElementContainer">2</div> </div> </body> </html>
I have an idea for you, instead of having the image above the element you want to scroll on, how about putting it below them, with the same opacity.
Then also change the opacity of the divs you're scrolling. This will give it the appearance of being underneath.
You would add:
$(document).ready(function(){ $(document).on('click', function(){ $('#VCBody').prepend('<div class="vcBodyShadow">3</div>'); $('.vcElementContainer').css('opacity','0.5'); }); });
.vcBodyShadow{ position:absolute; top:0; left:0; width:100%; height:100%; background-color: red; z-index:1; opacity: 0.5; font-size: 100px; font-weight: bold; padding: 50px; } #VCBody{ position:relative; height:100%; width:100%; overflow:auto; } .vcElementContainer { display:flex; align-items:center; justify-content:space-around; flex-wrap: wrap; height: $height; width:$width; overflow:hidden; position:relative; z-index:2; background-color:yellow; min-height:100px; margin:20px; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html> <body> <div id="VCBody"> <div class="vcElementContainer">1</div> <div class="vcElementContainer">2</div> </div> </body> </html>
相关问答
更多-
演示保持元素的position:fixed和操作元素的left属性: var leftInit = $(".scroll_fixed").offset().left; var top = $('.scroll_fixed').offset().top - parseFloat($('.scroll_fixed').css('margin-top').replace(/auto/, 0)); $(window).scroll(function(event) { var x = 0 - $(this ...
-
您在检查侧边栏是否已达到蓝色div时忘记了包含边栏的高度: var sidebar = $('.sidebar').position().top; var blueDiv = $('.bottom').position().top - $('.sidebar').innerHeight(); $(window).scroll(function() { var sT = $(window).scrollTop(); if (sT > sidebar && sT < blueDiv) { ...
-
这是你在找什么?: http : //jsfiddle.net/cmontgomery/YVh4q/ 基本上,每当窗口滚动检查您的部分是否在可见区域时,如果没有,请相应地进行调整: $(window).scroll(function () { var mover = $("#sidebar .quick-links"); if($(window).scrollTop() === 0) { //console.log("to top"); mover.prependTo("#s ...
-
可能是jquery切换制作它。 $(document).ready(function() { $(document).scroll(function() { var top = $(document).scrollTop(); var viewport = $("#welcome").height(); if (top >= viewport ) { $('#header').addClass("fixed"); } e ...
-
使用overflow-y: hidden; 而不是auto Everything I tried failed. Quick and dirty, I put the div's inside a table, single row, dual column, and set the second div to: position:relative; Quick and dirty table: