如何使用AWS上的电磁辐射-libjars? [英] How to use -libjars on aws emr?

查看:172
本文介绍了如何使用AWS上的电磁辐射-libjars?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有对堆栈溢出类似的问题,但没有人回答这个问题。的问题就出现了,当按照下面的链接 http://grepalex.com/2013/02 / 25 / Hadoop的libjars / ,我们需要使用出口HADOOP_CLASSPATH = /路径/ jar1:/路径/ jar2来得到它的工作。所以,我怎么能执行出口HADOOP_CLASSPATH = /路径/ jar1:/路径/ jar2为-libjars选项工作。

There are similar questions on Stack overflow but none of them answer the question. The problem arises when as per the following link http://grepalex.com/2013/02/25/hadoop-libjars/ ,we need to use export HADOOP_CLASSPATH=/path/jar1:/path/jar2 to get it to work. So how can I execute export HADOOP_CLASSPATH=/path/jar1:/path/jar2 for -libjars option to work.

我实现了一个工具亚军。它完美地在Hadoop和HDFS。

I have implemented a Tool Runner . It works perfectly on hadoop and HDFS.

我试图同时使用自定义的jar执行这一点,但它提供了异常 java.lang.NoClassDefFoundError的:组织/ JSON /简单/分析器/ JSONParser

I tried executing this while using custom jar but it gives Exception java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser:

这是我跑在电子病历在哪里我使用MultipleInputs和一个文件解析,所以你可以看到多条路径作为参数,这部作品在Hadoop的运行时。

This is what I ran in EMR where I am using MultipleInputs and a file to parse so you can see multiple paths as arguments this works while running in hadoop.

警报-libjars S3N://akshayhazari/jars/json-simple-1.1.1.jar -D MA pred.output.com preSS =真-D马pred.output.com pression.type = BLOCK -D io.seqfile.com pression.type = BLOCK-D MA pred.output.com pression。codeC = org.apache.hadoop.io.com press.Gzip codeC S3N://akshayhazari/rule/rule1.json S3N://akshayhazari/Alert/input/data.txt.gz S3N:// akshayhazari /快讯/输入/ data1.txt.gz S3N:// akshayhazari /报警/输出

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

你能尝试创建FatJar和运行。尝试创建一个罐依赖性增加,然后用电子病历运行。它将工作。

Can you try creating FatJar and Run. Try to create one jar with dependency added and then Run with EMR. It will work.

在Ant编译你可以使用如下

in ant build you can use as below

<拉链destfile =/ lib中/ ABC-fatjar.jar>

< zip destfile="/lib/abc-fatjar.jar" >

&LT; zipgroupfileset DIR =lib目录包括=jobcustomjar.jar,JSON-简单1.1.1.jar/>

< zipgroupfileset dir="lib" includes="jobcustomjar.jar,json-simple-1.1.1.jar" />

&LT; / ZIP>

< /zip >

这篇关于如何使用AWS上的电磁辐射-libjars?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆