对于伪分布式的搭建,没啥好说的,推荐两个博客:
第一个主要讲在cygwin下的搭建,第二个讲在cygwin下怎么用eclipse创建hadoop开发环境
至于全分布式,就伤心咯。。。搞了三台虚拟机在跑,结果感觉还是没有成功
参照这个博客弄的:
三个虚拟机在跑,卡死人,单机跑的时候是可以的,但是加入了几个datanode后总感觉不大对劲,虽然还是能跑,但是感觉只有一台在跑。。。。
用bin/hdfs dfsadmin -report查看的时候总是只能看到只有一个datanode,但是在slaves上看datanode已经启动成功了,不知道为什么。。。。
打包命令是jar -cvf matrix.jar 一大堆.class文件 或者
jar -cvf matrix.jar -C 你要打包的文件夹
这个包得放到hadoop默认jar包的路径之下,不然会报错误说
no job jar file set. user classes may nojot be found. see jobconf(class) or bconf#setjar(string)
还有一个解决方法说
I've had this error as well when running from the command prompt. I've found that by passing the location of the jar file that contains your classes to conf.setJar() when setting the job configuration parameters fixes it. Basically the code would look something like this:
String userJarLocation = "/path/to/jar";
conf.setJar(userJarLocation); //were conf is the JobConf object
不过我没试过,虽然觉得应该可行,急着交作业了,上面那个方法能用就先这样吧,有机会再试试。。。。
还有一篇文章分析了原因:
这篇文章的第4点,不明觉厉。。。。
想想好像没啥好说的了,要是想到了或者以后再搞hadoop的时候再补充吧,先洗澡去。。。。。