1.需要在eclipse中将hadoop集群的几个xml配置文件放置到一个文件夹中
例如:在项目中新建个conf目录放置:core-site.xml、 hdfs-site.xml、 mapred-site.xml、 hbase-site.xml
2.需要将需要的jar包导入项目:
Build Path->Add external Archives,选择需要的jar包:
在windows下运行Hadoop程序的环境配置-LMLPHP
3.如果项目运行需要制定其他文件作为一些配置信息传入,可将文件放入项目根目录,然后在运行主类的argument里面制定。

4.很重要的一步,放在conf目录下的配置文件,要为主类运行而服务还需要Run Configuration:
Run As->Run Configuration->Java Application ->Classpath ->Bootstrap Entries -> Advanced ->Add Folders,选择conf文件夹
在windows下运行Hadoop程序的环境配置-LMLPHP


这样,就可以运行hadoop程序了!

01-31 03:18