19

I am trying to install a single node setup of Hadoop on Ubuntu. I started following the instructions on the Hadoop 2.3 docs.

But I seem to be missing something very simple.

First, it says to

To get a Hadoop distribution, download a recent stable release from one of the Apache Download Mirrors.

Then,

Unpack the downloaded Hadoop distribution. In the distribution, edit the file conf/hadoop-env.sh to define at least JAVA_HOME to be the root of your Java installation.

However, I can't seem to find the conf directory.

I downloaded a release of 2.3 at one of the mirrors. Then unpacked the tarball, an ls of the inside returns:

$ ls
bin  etc  include  lib  libexec  LICENSE.txt  NOTICE.txt  README.txt  sbin  share

I was able to find the file they were referencing, just not in a conf directory:

$ find . -name hadoop-env.sh
./etc/hadoop/hadoop-env.sh

Am I missing something, or am I grabbing the wrong package? Or are the docs just outdated?

If so, anyone know where some more up-to date docs are?

4

6 回答 6

12

我正在尝试安装一个伪分布式模式 Hadoop,遇到了同样的问题。

按照Hadoop The Definitive Guide (Third Edition)一书,第 618 页,它说:

In Hadoop 2.0 and later, MapReduce runs on YARN and there is an additional con-
figuration file called yarn-site.xml. All the configuration files should go in the
etc/hadoop subdirectory

希望这证实这etc/hadoop是正确的地方。

于 2014-05-19T19:20:37.470 回答
6

我认为文档需要更新。尽管目录结构发生了变化,但 hadoop-env.sh、core-ste.xml 和 hdfs-site.xml 等重要文件的文件名没有改变。您可能会发现以下链接对入门很有用。

http://codesfusion.blogspot.com/2013/10/setup-hadoop-2x-220-on-ubuntu.html

于 2014-03-19T06:28:18.300 回答
5

在 Hadoop1 中,

{$HADOOP_HOME}/conf/

在 Hadoop2 中,

{$HADOOP_HOME}/etc/hadoop
于 2017-01-14T08:39:40.123 回答
3

在 Hadoop 2.7.3 中,该文件位于 hadoop-common/src/main/conf/

$ sudo find . -name hadoop-env.sh
./hadoop-2.7.3-src/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh
于 2017-01-10T13:03:29.553 回答
2

只需在博客文章 http://codesfusion.blogspot.com/2013/10/setup-hadoop-2x-220-on-ubuntu.html上添加注释。这篇博文很棒而且非常有用。我就是这样开始的。我花了一点时间弄清楚的一个方面是,这个博客似乎使用了一种简化的方式在 hadoop conf 文件中提供配置,例如“conf/core-site.xml”、hdfs-site.xml 等......如下

<!--fs.default.name is the name node URI -->
<configuration>
    fs.default.name
    hdfs://localhost:9000
</configuration>

根据官方文档,有一种更严格的方法-当您有多个属性时,将其添加如下(请注意-描述是可选的:-))

<configuration>
    <property>
    <name> fs.default.name </name>
    <value>hdfs://localhost:9000 </value>
    <description>the name node URI </description>
    </property>
    <!--Add more configuration properties here -->
</configuration>
于 2014-08-06T15:10:04.327 回答
0

Hadoop (2022) 版本 3.3.1 的 conf 目录位于 src/main 目录中:

$HOME/hadoop/hadoop3.3/hadoop-common-project/hadoop-common/src/main/

于 2022-02-10T07:35:25.083 回答