Win10_spark本地模式报错:Failed to locate the winutils binary in the hadoop binary path java.io.IOException

当想在Windows上运行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.

主要是找不到winutils

解决办法:

1.将Windows的hadoop安装介质的zip包解压到本地目录

2.在程序中指定环境变量

def main(args: Array[String]): Unit = {
    //!!!注意:如果在Windows上执行,指定Hadoop的Home
    System.setProperty("hadoop.home.dir", "D:\\temp\\hadoop-2.4.1\\hadoop-2.4.1")
    
    //程序
}

 

猜你喜欢

转载自blog.csdn.net/Muzi_Water/article/details/89312403
0条评论
添加一条新回复