[英]Hortonworks Hadoop using Virtualbox - Execute a jar
i am a hadoop beginner. 我是Hadoop初学者。 Therefore i try to handle easy examples to get to know the environment.
因此,我尝试处理一些简单的示例来了解环境。 So i created a jar that performs a wordcount - amongst others this one Hadoop: Set up Maven project in 5 Minutes .
因此,我创建了一个执行单词计数的jar,其中包括一个Hadoop:5分钟内设置Maven项目 。 My problem: It is not possible for me to execute the .jar at my Hortonworks Sandbox.
我的问题:我无法在Hortonworks Sandbox上执行.jar。 Every time i get the error:
每次我得到错误:
WARNING: Use "yarn jar" to launch YARN applications.
警告:使用“纱线罐”启动YARN应用程序。
Not a valid JAR: /user/maria_dev/wordcount3.jar不是有效的JAR:/user/maria_dev/wordcount3.jar
To launch the jar i did the following steps: 要启动jar,我执行了以下步骤:
hadoop jar /user/maria_dev/wordcount3.jar /user/maria_dev/BlackArrow.txt /user/maria_dev
/ hadoop jar /user/maria_dev/wordcount3.jar /user/maria_dev/BlackArrow.txt /user/maria_dev
/
AND 和
hadoop jar /user/maria_dev/wordcount3.jar de.kja. wordcount3. wordcount /user/maria_dev/BlackArrow.txt /user/maria_dev/
In Both cases i get the error from above... 在这两种情况下,我都会从上面得到错误...
So i had the following thoughts: 所以我有以下想法:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at de.kja.wordcount2.wordcount.main(wordcount.java:47)
线程“主”中的异常java.lang.ArrayIndexOutOfBoundsException:de.kja.wordcount2.wordcount.main(wordcount.java:47)为0
OR 要么
Usage: WordCount [generic options] Generic options supported are -conf specify an application configuration file -D use value for given property -fs specify a namenode -jt specify a job tracker -files specify comma separated files to be copied to the map reduce cluster -libjars specify comma separated jar files to include in the classpath.
用法:WordCount [通用选项]支持的通用选项是-conf指定应用程序配置文件-D给定属性的使用值-fs指定名称节点-jt指定作业跟踪器-files指定将逗号分隔的文件复制到map减少群集-libjars指定以逗号分隔的jar文件,以包含在类路径中。 -archives specify comma separated archives to be unarchived on the compute machines.
-archives指定用逗号分隔的归档文件,这些归档文件将在计算机上取消归档。 The general command line syntax is bin/hadoop command [genericOptions] [commandOptions]
常规命令行语法为bin / hadoop命令[genericOptions] [commandOptions]
Hadoop version: 2.7.1.2.4.0.0-169 Hadoop版本:2.7.1.2.4.0.0-169
If you need more information please ask! 如果您需要更多信息,请询问! Thank you for your help :)
谢谢您的帮助 :)
In your virtual machine, open the Linux terminal 在您的虚拟机中,打开Linux终端
su - ambari-qa su-ambari-qa
yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar teragen 1000 /tmp/genout 纱罐/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar teragen 1000 / tmp / genout
yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar terasort /tmp/genout /tmp/sortout 纱罐/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar terasort / tmp / genout / tmp / sortout
yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar teravalidate /tmp/sortout /tmp/valout 纱罐/usr/hdp/current/hadoop-mapreduce-client/hadoop-mapreduce-examples.jar teravalidate / tmp / sortout / tmp / valout
This is a sample to ensure you able to run jobs from sandbox. 这是确保您能够从沙箱运行作业的示例。
you need to run your code as yarn jar .... 您需要将代码作为jar来运行....
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.