简体   繁体   English

Hadoop不使用配置文件?

[英]Hadoop not using config files?

I'm deploying Hadoop at work and I've been troubleshooting some days. 我在工作中部署Hadoop,几天来一直在进行故障排除。 Yesterday it was working perfectly but today something strange is happening. 昨天运行良好,但是今天发生了一些奇怪的事情。

I have hadoop.tmp.dir set in core-site.xml as well as other directories for HDFS (datanode, namenode and secondarynamenode in hdfs-site.xml). 我在core-site.xml以及HDFS的其他目录(hdfs-site.xml中的datanode,namenode和secondarynamenode)中设置了hadoop.tmp.dir。 But today, when I format the FS it's creating all the files in /tmp and not in /usr/local/hadoop/tmp which is the one I have configured. 但是今天,当我格式化FS时,它是在/ tmp中而不是在我配置的/ usr / local / hadoop / tmp中创建所有文件。

$ bin/hdfs namenode -format
[...]    
INFO common.Storage: Storage directory /tmp/hadoop-hadoop/dfs/name has been successfully formatted.
[...]

core-site.xml core-site.xml

<property>
      <name>hadoop.tmp.dir</name>                
      <value>/usr/local/hadoop/tmp</value>
</property>

hdfs-site.xml hdfs-site.xml

   <property>
        <name>dfs.namenode.name.dir</name>
        <value>file:/usr/local/hadoop/hdfs/namenode</value>
   </property>

   <property>
        <name>dfs.namenode.checkpoint.dir</name>
        <value>/usr/local/hadoop/hdfs/secondname</value>
   </property>

   <property>
        <name>dfs.datanode.data.dir</name>
        <value>/usr/local/hadoop/hdfs/datanode</value>
   </property>

Anyone has any clue about what's happening? 任何人都知道发生了什么事吗?

Thanks! 谢谢!

make sure this directory exists and have enough permission 确保此目录存在并具有足够的权限

give the path as file:///usr/local/hadoop/tmp 将路径指定为file:///usr/local/hadoop/tmp

Found what was wrong and it was really embarrassing. 发现什么地方出了问题,这真令人尴尬。 My hadoop user had bash as default sh but wasn't loading correctly the profile until I explicitly did "bash" on command line. 我的hadoop用户将bash作为默认的sh,但是直到我在命令行上明确地进行“ bash”操作之前,它没有正确加载配置文件。 Saw it with printenv command. 用printenv命令看到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM