相关疑难解决方法(0)

无法在hadoop二进制路径中找到winutils二进制文件

我在为最新的hadoop-2.2版本启动namenode时遇到以下错误.我没有在hadoop bin文件夹中找到winutils exe文件.我试过下面的命令

$ bin/hdfs namenode -format
$ sbin/yarn-daemon.sh start resourcemanager

ERROR [main] util.Shell (Shell.java:getWinUtilsPath(303)) - Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
    at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:278)
    at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:300)
    at org.apache.hadoop.util.Shell.<clinit>(Shell.java:293)
    at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
    at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:863)
Run Code Online (Sandbox Code Playgroud)

hadoop

104
推荐指数
7
解决办法
17万
查看次数

远程运行MapReduce

我有一个远程运行的hadoop集群.我能够完成教程:

http://hadoop.apache.org/docs/r2.6.0/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html

在我的远程计算机上,因为有一个内置的hadoop实例.但是,我希望在本地执行相同的任务.对hadoop不熟悉我不知道怎么做.我想知道我是否可以运行程序并将结果发送回本地计算机.我不确定如何登录到我的远程计算机然后运行MapReduce作业.

这是我在远程计算机上的代码:

import java.io.IOException;
import java.util.StringTokenizer;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
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;

public class WordCount {
    public static class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable>{

        private final static IntWritable one = new IntWritable(1);
        private Text word = new Text();

        public void map(Object key, Text value, Context context
        ) throws IOException, InterruptedException {
            StringTokenizer itr = new StringTokenizer(value.toString());
            while (itr.hasMoreTokens()) {
                word.set(itr.nextToken());
                context.write(word, one);
            }
        }
    } …
Run Code Online (Sandbox Code Playgroud)

java hadoop mapreduce

2
推荐指数
1
解决办法
5376
查看次数

标签 统计

hadoop ×2

java ×1

mapreduce ×1