hadoop windows开发环境

最近搭建了hadoop的开发环境 出了几个错误总结一下

1不能run-on hadoop

         由于我是使用的版本是是0.20.2自带的eclipse插件不能用所以必须上网下载

         网址:http://pan.baidu.com/s/1qtnn8

         复制到eclipse下的\plugins的文件夹中替换原来的插件 重新启动elipse

2 参考《实战hadoop》刘鹏的CopyFromLocalFile进行从本地将文件上传到hdfs出现的错

  代码如下

   

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class CopFile {
	
	public static void main(String[] args) throws Exception{
		
		Configuration conf =new Configuration();
		conf.addResource(new Path("D:/hadoop-0.20.2/conf/hdfs-site.xml"));
		conf.addResource(new Path("D:/hadoop-0.20.2/conf/core-site.xml"));
		FileSystem hdfs = FileSystem.get(conf);
		Path src =new Path("D:\\a.txt");
		Path dst = new Path("/");
		hdfs.copyFromLocalFile(src, dst);
		System.out.println("Upload to "+ conf.get("fs.default.name"));
		FileStatus Files[]=hdfs.listStatus(dst);
		for(FileStatus file:Files)
		{
			System.out.println(file.getPath());
		}
	}

报出以下错误

 org.apache.hadoop.security.AccessControlException: Permission denied: user=usermic-6ybi0xo\administrator, access=WRITE, inode="":usermic-6ybi0xo\cyg_server:supergroup:rwxr-xr-x

2.1 显示不能够进行对hdfs中的文件进行读写操作原因是权限不够

解决方法

更改hdfs-site .xml 增加权限 添加一下几句话

<property>
<name>dfs.permissions</name>
<value>false</value>
</property>


 

你可能感兴趣的:(eclipse,hadoop,eclipse插件)