在eclipse上运行mapreduce小程序,出现警告提示:No job jar file set.到底是哪里的问题呢?请大神赐教!

哈哈哈666666999 2017-04-17 01:38:25
错误提示:

17/04/17 13:22:29 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
17/04/17 13:22:30 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
17/04/17 13:22:31 WARN mapreduce.JobResourceUploader: No job jar file set. User classes may not be found. See Job or Job#setJar(String).
17/04/17 13:22:31 INFO input.FileInputFormat: Total input paths to process : 3
17/04/17 13:22:32 INFO mapreduce.JobSubmitter: number of splits:3
17/04/17 13:22:32 INFO Configuration.deprecation: mapred.job.tracker is deprecated. Instead, use mapreduce.jobtracker.address
17/04/17 13:22:33 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1492406451078_0001
17/04/17 13:22:33 INFO mapred.YARNRunner: Job jar is not present. Not adding any jar to the list of resources.
17/04/17 13:22:34 INFO impl.YarnClientImpl: Submitted application application_1492406451078_0001
17/04/17 13:22:34 INFO mapreduce.Job: The url to track the job: http://youhuidi-Lenovo-G470:8088/proxy/application_1492406451078_0001/
17/04/17 13:22:34 INFO mapreduce.Job: Running job: job_1492406451078_0001
17/04/17 13:22:45 INFO mapreduce.Job: Job job_1492406451078_0001 running in uber mode : false
17/04/17 13:22:45 INFO mapreduce.Job: map 0% reduce 0%
17/04/17 13:28:50 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:46461. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:28:51 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:46461. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:28:52 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:46461. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:35:13 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:35093. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:35:14 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:35093. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:35:15 INFO ipc.Client: Retrying connect to server: youhuidi-Lenovo-G470/127.0.1.1:35093. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
17/04/17 13:35:15 INFO mapreduce.Job: Job job_1492406451078_0001 failed with state FAILED due to: Application application_1492406451078_0001 failed 2 times due to AM Container for appattempt_1492406451078_0001_000002 exited with exitCode: 0
For more detailed output, check application tracking page:http://youhuidi-Lenovo-G470:8088/cluster/app/application_1492406451078_0001Then, click on links to logs of each attempt.
Diagnostics: Failing this attempt. Failing the application.
17/04/17 13:35:15 INFO mapreduce.Job: Counters: 0


mapreduce小程序代码:

package org.apache.hadoop.examples;


import java.io.IOException;



import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.io.Text;

import org.apache.hadoop.mapreduce.Job;

import org.apache.hadoop.mapreduce.Mapper;

import org.apache.hadoop.mapreduce.Reducer;

import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;

import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import org.apache.hadoop.util.GenericOptionsParser;



public class WordCount {



//map将输入中的value复制到输出数据的key上,并直接输出

public static class Map extends Mapper<Object,Text,Text,Text>{

private static Text line=new Text();//每行数据



//实现map函数

public void map(Object key,Text value,Context context)

throws IOException,InterruptedException{

line=value;

context.write(line, new Text(""));

}



}



//reduce将输入中的key复制到输出数据的key上,并直接输出

public static class Reduce extends Reducer<Text,Text,Text,Text>{

//实现reduce函数

public void reduce(Text key,Iterable<Text> values,Context context)

throws IOException,InterruptedException{

context.write(key, new Text(""));

}



}



public static void main(String[] args) throws Exception{

Configuration conf = new Configuration();

//这句话很关键

conf.set("mapred.job.tracker", "192.168.1.2:8088");



String[] ioArgs=new String[]{"dedup_in","dedup_out"};

String[] otherArgs = new GenericOptionsParser(conf, ioArgs).getRemainingArgs();

if (otherArgs.length != 2) {

System.err.println("Usage: Data Deduplication <in> <out>");

System.exit(2);

}



@SuppressWarnings("deprecation")
Job job = new Job(conf, "Data Deduplication");

job.setJarByClass(WordCount.class);



//设置Map、Combine和Reduce处理类

job.setMapperClass(Map.class);

job.setCombinerClass(Reduce.class);

job.setReducerClass(Reduce.class);



//设置输出类型

job.setOutputKeyClass(Text.class);

job.setOutputValueClass(Text.class);



//设置输入和输出目录

FileInputFormat.addInputPath(job, new Path(otherArgs[0]));

FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));

System.exit(job.waitForCompletion(true) ? 0 : 1);

}

}
...全文
495 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
源码链接: https://pan.quark.cn/s/0f7c75cb3aad ### MIPI Video Mode 与 Command Mode 的差异 #### 一、引言 MIPI (Mobile Industry Processor Interface) 是一种用于连接移动设备中处理器及其外围设备的标准化接口。MIPI 接口支持多种协议,其中包含 DSI (Display Serial Interface) 和 DCS (Display Control Interface) 等协议。在 MIPI 接口的应用中,主要涉及两种工作模式:Video Mode(视频模式)和 Command Mode(命令模式)。本文旨在系统性地阐述这两种模式的工作机制、特性以及实际应用环境。 #### 二、LCD RAM 概念说明 在进一步探讨 MIPI 的两种模式之前,有必要对文中提及的“LCD RAM”概念进行明确。实际上,“LCD RAM”并非一个通用术语,而是本文作者用来描述 LCD 控制器中用于存储显示数据的内存区域。LCD(Liquid Crystal Display,液晶显示屏)通常配备一个控制 IC(Integrated Circuit,集成电路),该控制 IC 可能内置 RAM 以缓存显示数据。 #### 三、MIPI Video Mode(视频模式) **定义:** - 视频模式是一种类似于传统 RGB 接口的工作模式,它要求主机持续不断地向显示器传输刷新数据。 - 在这种模式下,数据和控制信号以报文的形式通过 MIPI 总线进行传输。 - 显示器本身无需配备帧缓冲器,因为主机会周期性地刷新屏幕。 **特点:** 1. **实时性高:** 主机需要不...
源码下载地址: https://pan.quark.cn/s/a4b39357ea24 在电磁模拟技术中,CST(Computer Simulation Technology)是一种被广泛采纳的软件工具,它主要用于电磁场、微波、天线以及射频系统的设计工作。本资料将详细分析CST软件中离散端口的具体配置方法,这些方法对于提升仿真结果的精确度和专业水准具有决定性作用。离散端口在CST软件中扮演着模拟信号输入或输出的重要角色,它们构成了仿真模型不可或缺的部分。在配置离散端口时,一个核心的原则是保证端口的方向与网格线保持一致,这是因为这样做能够有效降低计算过程中产生的误差,并确保仿真数据的有效性。如果未能遵循这一指导原则,可能会引发未知的计算问题,进而导致仿真结果失去可靠性。 在CST软件中配置离散端口,通常需要借助“Pick Points”这一功能。通过选择“Pick Edge Center”选项,端口将被设定在模型边缘的中心位置上。然而,这种做法并不总是能够确保端口与网格线保持平行。在某些特定情形下,模型的几何构造可能不允许直接选取一个与网格线平行的边作为端口的安装位置。 为了克服这一挑战,可以采用多种不同的策略。如果模型本身已经包含一条与馈电口平行的边,那么可以直接利用这条边来建立端口,此时CST软件会自动调整端口使其与网格线对齐。另一种可选的方法是,当模型不具备现成的平行边时,用户可以手动构建一个几何结构,比如一个立方体,并使其边缘与馈电口平行。通过这种方式,新建立的几何结构的边缘就可以作为端口的位置,从而确保端口与网格线的平行关系。 在实施上述操作时,必须关注端口尺寸的合理性和物理意义的一致性。端口的尺寸应当依据实际天线馈电部分的尺寸进行适当调整,过大的端口或...

20,842

社区成员

发帖
与我相关
我的任务
社区描述
Hadoop生态大数据交流社区,致力于有Hadoop,hive,Spark,Hbase,Flink,ClickHouse,Kafka,数据仓库,大数据集群运维技术分享和交流等。致力于收集优质的博客
社区管理员
  • 分布式计算/Hadoop社区
  • 涤生大数据
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧