配置hadoop,主要是配置core-site.xml,hdfs-site.xml,mapred-site.xml,
- yarn-default.xml四个配置文件,默认下来,这些配置文件都是空的,所以很难知道这些配置文件有哪些配置可以生效,上网找的配置可能因为各个hadoop版本不同,导致无法生效。浏览更多的配置,有两个方法:
1.选择相应版本的hadoop,下载解压后,搜索*.xml,找到core-default.xml,hdfs-default.xml,mapred-default.xml,
yarn-default.xml这些就是默认配置,可以参考这些配置的说明和key,配置hadoop集群。
2.浏览apache官网,四个配置文件链接如下:
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/core-default.xml
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml
http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml
http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-common/yarn-default.xml
这里是浏览hadoop当前版本号的默认配置文件,其他版本号,要另外去官网找。其中第一个方法找到默认的配置是最好的,因为每个属性都有说明,可以直接使用。另外,core-site.xml是全局配置,hdfs-site.xml和mapred-site.xml分别是hdfs和mapred的局部配置,
yarn-default.xml是yarn的配置。