关于java.io.IOException: HADOOP_HOME or hadoop.home.dir are not set.的问题
报错如下:
300 [main] DEBUG org.apache.hadoop.util.Shell - Failed to detect a valid hadoop home directory
java.io.IOException: HADOOP_HOME or hadoop.home.dir are not set
解决办法一:
根据 http://blog.csdn.net/baidu_19473529/article/details/54693523 配置hadoop_home变量
下载winutils地址https://github.com/srccodes/hadoop-common-2.2.0-bin下载解压
重新打开Eclipse,运行程序,可以解决内网的Hadoop连接问题。(亲测试通过)
解决办法二:
在java程序中加入
System.setProperty("hadoop.home.dir", "/usr/local/hadoop-2.6.0");
依然报错(未亲测试)
解决办法三:(不是同一问题?)
根据该提示:
依然报错
--------------------------------5.19.早晨------------------------------------------
今天早上再次执行该程序,将上传到HDFS部分的代码给注释掉后发现日志报错信息如下:
132 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Trying to load the custom-built native-hadoop library...
134 [main] DEBUG org.apache.hadoop.util.NativeCodeLoader - Failed to load native-hadoop with error: java.lang.UnsatisfiedLinkError: no hadoop in java.library.path
1)check Hadoop library:
root@Ubuntu-1:/usr/local/hadoop-2.6.0/lib/native# file libhadoop.so.1.0.
It's 64-bite library
2)Try adding the HADOOP_OPTS
environment variable:
root@Ubuntu-1:~# vi /etc/profile //environment variable
export HADOOP_OPTS="-Djava.library.path=${HADOOP_HOME}/lib/native/"
It doesn't work, and reports the same error.
3)Try adding the HADOOP_OPTS
and HADOOP_COMMON_LIB_NATIVE_DIR
environment variable:
export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_HOME}/lib/native
export HADOOP_OPTS="-Djava.library.path=${HADOOP_HOME}/lib/"
It still doesn't work, and reports the same error.
4)Adding the Hadoop
library into LD_LIBRARY_PATH
root@Ubuntu-1:~# vi .bashrc
export LD_LIBRARY_PATH=/usr/local/hadoop/lib/native/:$LD_LIBRARY_PATH
It doesn't work, and reports the same error.
5)append word native to HADOOP_OPTS
like this
export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native"
It doesn't work, and reports the same error.
-----------------------------------5.20早晨-------------------------
win下依旧无法使用java代码上传文件到HDFS
----------------------------------5.24------------
copy了一份hadoop-2.6.0文件到本机,更改bin目录和path ,显示无效的path,遂更改回去
---------------------2017.5.26-------------------
今天早上开机 试了一下 发现它已经好了 其实上述的设置已经可以解决大部分遇到这类问题的人群
关于java.io.IOException: HADOOP_HOME or hadoop.home.dir are not set.的问题的更多相关文章
- windows 中使用hbase 异常:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
平时一般是在windows环境下进行开发,在windows 环境下操作hbase可能会出现异常(java.io.IOException: Could not locate executable nul ...
- 排查Hive报错:org.apache.hadoop.hive.serde2.SerDeException: java.io.IOException: Start of Array expected
CREATE TABLE json_nested_test ( count string, usage string, pkg map<string,string>, languages ...
- java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries
在已经搭建好的集群环境Centos6.6+Hadoop2.7+Hbase0.98+Spark1.3.1下,在Win7系统Intellij开发工具中调试Spark读取Hbase.运行直接报错: ? 1 ...
- hive运行query语句时提示错误:org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOException:
hive> select product_id, track_time from trackinfo limit 5; Total MapReduce jobs = 1 Launching Jo ...
- Spark- ERROR Shell: 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.
运行 mport org.apache.log4j.{Level, Logger} import org.apache.spark.rdd.RDD import org.apache.spark.{S ...
- spark开发常见问题之一:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
最近在学习研究pyspark机器学习算法,执行代码出现以下异常: 19/06/29 10:08:26 ERROR Shell: Failed to locate the winutils binary ...
- idea 提示:ERROR util.Shell: Failed to locate the winutils binary in the hadoop binary path java.io.IOException解决方法
Windows系统中的IDEA链接Linux里面的Hadoop的api时出现的问题 提示:ERROR util.Shell: Failed to locate the winutils binary ...
- org.apache.hadoop.ipc.RemoteException(java.io.IOException)
昨晚突然之间mr跑步起来了 jps查看 进程都在的,但是在reduce任务跑了85%的时候会抛异常 异常情况如下: 2016-09-21 21:32:28,538 INFO [org.apache.h ...
- 运行基准测试hadoop集群中的问题:org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /benchmarks/TestDFSIO/io_data/test_
在master(即:host2)中执行 hadoop jar hadoop-test-1.1.2.jar DFSCIOTest -write -nrFiles 12 -fileSize 10240 - ...
随机推荐
- C++ 使用VS2010创建MFC ActiveX工程项目
1.ActiveX的基本概念 ActiveX控件可以看作是一个极小的服务器应用程序,它不能独立运行,必须嵌入到某个容器程序中,与该容器一起运行.这个容器包括WEB网页,应用程序窗体等... Activ ...
- Unity资源Assetbundle
转 Unity资源打包之Assetbundle 本文原创版权归 csdn janeky 所有,转载请详细注明原创作者及出处,以示尊重! 作者:janeky 原文:http://blog.csdn.n ...
- Java 中 == 和 equals 的区别
有一段时间,== 和 equals 的区别一直困扰着我.因为涉及到Java的内存机制,然而Java的内存机制又是比较抽象的东西,所以对那时候的我来说,实在是很难理解. == 和 equals 最大的区 ...
- pycahrm 基础设置
一些常用设置: 1. pycharm默认是自动保存的,习惯自己按ctrl + s 的可以进行如下设置:1. file -> Setting -> General -> Synchro ...
- 1-keystone 部署
https://github.com/openstack/keystone 最新版为rocky 1. 进入mysql create database keystone; grant all privi ...
- table tr 加入背景色之后 去掉td之间的空隙
给table加样式 border-collapse:collapse;
- AssetBundle Manager
[AssetBundle Manager] AssetBundleManager是一个款Unity公司制作的Unity库. 1.Simulation Mode The main advantage o ...
- git桌面工具下载git源码
第一步,登陆githup,搜索自己需要查看的代码. 并复制clone url. 第二步,复制下载资源:选择菜单--FILE--CLONE
- Linux 学习总结(三)
一. yum 命令 .列出所有可更新的软件清单命令:yum check-update .更新所有软件命令:yum update .仅安装指定的软件命令:yum install <package_ ...
- 贪吃蛇Food Java实现(二)
1.antition包Food类 package cn.tcc.snake.antition; import java.awt.Graphics;import java.awt.Point;publi ...