方法一:
Configuration config = new Configuration(true);
config.set("fs.default.name","hdfs://192.168.200.135:9000");
可以这样写,但是 Configuration config = new Configuration(false); 不要用false 。使用false就会加载默认配置文件。
方法二:
Path coreSitePath = new Path("/path/of/HADOOP_HOME", "conf/core-site.xml");
conf.addResource(coreSitePath);
FileSystem fs = FileSystem.get(conf)
4400



被折叠的 条评论
为什么被折叠?



