hadoop 写入错误说找不到core-site.xml文件问题

chaohua2000 2015-10-11 11:53:11
[root@proxy1 test_hadoop]# hadoop fs -ls
Exception in thread "main" java.lang.RuntimeException: core-site.xml not found
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2566)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2492)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2405)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1143)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1115)
at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1451)
at org.apache.hadoop.util.GenericOptionsParser.processGeneralOptions(GenericOptionsParser.java:321)
at org.apache.hadoop.util.GenericOptionsParser.parseGeneralOptions(GenericOptionsParser.java:487)
at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:170)
at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:153)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:64)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:340)
...全文
5487 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
香干肉丝 2017-10-22
  • 打赏
  • 举报
回复
把/etc/profile文件可能有错误
winds_xp 2017-02-03
  • 打赏
  • 举报
回复
关注
Xiao 伙伴 2017-01-07
  • 打赏
  • 举报
回复
HADOOP_CONF_DIR设置正确吗,检查一下hadoop-env.sh各个变量是否正确吧
qq_15229655 2016-12-29
  • 打赏
  • 举报
回复
最近在学习Hadoop,我也出现了和楼主一样的问题,同时也发现停止Hadoop时也出错(如下) hadoop@xxx-virtual-machine:/usr/local/hadoop$ sbin/stop-all.sh This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh Error: Cannot find configuration directory: /etc/hadoop stopping yarn daemons Error: Cannot find configuration directory: /etc/hadoop 然后我去修改了hadoop.env.sh文件,将里面的 export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"} 改成我自己的路径: export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop/ 最后source hadoop.env.sh 结果问题解决了,希望能有用吧!!
YangQinQinNeusoft 2016-04-26
  • 打赏
  • 举报
回复
楼主,你最后怎么解决的
夜无边CN 2015-10-14
  • 打赏
  • 举报
回复
引用 3 楼 chaohua2000 的回复:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

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

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://**.**.**.**:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/data/hadoop/tmp</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>131702</value>
</property>
</configuration>



<property>
<name>hadoop.tmp.dir</name>
<value>file:/data/hadoop/tmp</value>
</property> file:/data ? 你是集群搭好之后,就出现这个问题吗
chaohua2000 2015-10-11
  • 打赏
  • 举报
回复
版本是 hadoop2.7.1
chaohua2000 2015-10-11
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

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

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://**.**.**.**:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/data/hadoop/tmp</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>131702</value>
</property>
</configuration>
iamzealoot 2015-10-11
  • 打赏
  • 举报
回复
楼主对应的配置文件写了么?

20,808

社区成员

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

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