8

我在几台笔记本电脑上安装了 hadoop,以形成一个 hadoop 集群。首先,我们以伪分布式模式安装,除了一个非常完美之外(即所有服务都运行,当我使用它进行测试时hadoop fs显示hdfs)。在后面提到的笔记本电脑(有问题的笔记本电脑)中,该`hadoop fs -ls命令显示本地目录的信息而不是hdfs命令-cat, -mkdir,也是如此-put。我可能做错了什么?

任何帮助,将不胜感激

这是我的core-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
 <name>hadoop.tmp.dir</name>
 <value>/home/hduser/hdfs_dir/tmp</value>
 <description></description>
</property>

<property>
 <name>fs.default.name</name>
 <value>hdfs://localhost:54310</value>
 <description>.</description>
</property>
</configuration>

我必须说,这是所有其他笔记本电脑的同一个文件,它们工作正常。

4

3 回答 3

6

我遇到了同样的问题,我必须确保fs.default.name' 的值包含一个尾随/以引用路径组件:

<property>
 <name>fs.default.name</name>
 <value>hdfs://localhost:54310/</value>
 <description>.</description>
</property>
于 2013-04-18T16:13:55.230 回答
4

检查fs.default.nameincore-site.xml指向 ex 中的正确数据节点:

<property>
     <name>fs.default.name</name>
     <value>hdfs://target-namenode:54310</value>
</property>
于 2013-04-04T09:09:20.553 回答
2

如果fs.default.nameincore-site.xml指向 hdfs://localhost:54310/有或没有尾随 /,即使你有同样的问题,那么你可能正在查看错误的配置文件。就我而言,它是 cloudera 的 cdh4 并检查符号链接:

ls -l /etc/hadoop/conf
** /etc/hadoop/conf -> /etc/alternatives/hadoop-conf
ls -l /etc/alternatives/hadoop-conf
**
/etc/alternatives/hadoop-conf -> /etc/hadoop/conf.cloudera.yarn1

早些时候我使用 MRv1 并迁移到 MRv2 (YARN),升级后符号链接被破坏为:

ls -l /etc/hadoop/conf
** /etc/hadoop/conf -> /etc/alternatives/hadoop-conf
ls -l /etc/alternatives/hadoop-conf
**
/etc/alternatives/hadoop-conf -> /etc/hadoop/conf.cloudera.mapreduce1
ls -l /etc/hadoop/conf.cloudera.mapreduce1
ls: cannot access /etc/hadoop/conf.cloudera.mapreduce1: No such file or directory

Also, update-alternatives was run to have high priority for /etc/hadoop/conf.cloudera.mapreduce1 path as:

alternatives --display hadoop-conf
hadoop-conf - status is manual.
link currently points to /etc/hadoop/conf.cloudera.mapreduce1
/etc/hadoop/conf.cloudera.hdfs1 - priority 90
/etc/hadoop/conf.cloudera.mapreduce1 - priority 92
/etc/hadoop/conf.empty - priority 10
/etc/hadoop/conf.cloudera.yarn1 - priority 91
Current `best' version is /etc/hadoop/conf.cloudera.mapreduce1.

To remove old link which has highest priority do:

update-alternatives --remove hadoop-conf /etc/hadoop/conf.cloudera.mapreduce1
rm -f /etc/alternatives/hadoop-conf
ln -s /etc/hadoop/conf.cloudera.yarn1 /etc/alternatives/hadoop-conf

于 2014-01-22T13:15:19.527 回答