软件配置的作用
Hadoop、Hive、Pig 等软件含有大量的配置,当需要对其软件配置进行修改时,就可以使用软件配置功能来实现。例如,HDFS 服务器的服务线程数目 dfs.namenode.handler.count 默认是 10,假设要加大到 50;HDFS 的文件块的大小 dfs.blocksize 默认是 128MB,假设系统都是小文件,想要改小到 64MB。
目前这个操作只能在集群启动的时候执行一次。
如何使用
登录阿里云 E-MapReduce 控制台集群列表。
在上方选择所在的地域(Region),所创建集群将会在对应的Region内。
单击[backcolor=transparent]创建集群,即会进入创建集群的操作界面。
在创建集群的软件配置这一步中可以看到所有包含的软件以及对应的版本。若想修改集群的配置,可以通过软件配置(可选)框选择相应的 json 格式配置文件,对集群的默认参数进行覆盖或添加。json 文件的样例内容如下[backcolor=transparent]{- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent][
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"core-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"fs.trash.interval"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"61"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hadoop-log4j"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"hadoop.log.file"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hadoop1.log"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"hadoop.root.logger"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"INFO"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"a.b.c"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"ABC"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hdfs-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"dfs.namenode.handler.count"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"12"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"mapred-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"mapreduce.task.io.sort.mb"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"201"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"yarn-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"hadoop.security.groups.cache.secs"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"251"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"yarn.nodemanager.remote-app-log-dir"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"/tmp/logs1"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"httpsfs-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"a.b.c.d"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"200"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"capacity-scheduler"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"yarn.scheduler.capacity.maximum-am-resource-percent"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"0.2"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hadoop-env"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"BC"[backcolor=transparent]:[backcolor=transparent]"CD"
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent]"export"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"AB"[backcolor=transparent]:[backcolor=transparent]"${BC}"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"HADOOP_CLIENT_OPTS"[backcolor=transparent]:[backcolor=transparent]"\"-Xmx512m -Xms512m $HADOOP_CLIENT_OPTS\""
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"httpfs-env"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent]"export"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"HTTPFS_SSL_KEYSTORE_PASS"[backcolor=transparent]:[backcolor=transparent]"passwd"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"mapred-env"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent]"export"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"HADOOP_JOB_HISTORYSERVER_HEAPSIZE"[backcolor=transparent]:[backcolor=transparent]"1001"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"yarn-env"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent]"export"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"HADOOP_YARN_USER"[backcolor=transparent]:[backcolor=transparent]"${HADOOP_YARN_USER:-yarn1}"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"pig"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"pig.tez.auto.parallelism"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"false"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"pig-log4j"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"log4j.logger.org.apache.pig"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"error, A"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hive-env"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"BC"[backcolor=transparent]:[backcolor=transparent]"CD"
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]"configurations"[backcolor=transparent]:[
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent]"export"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"AB"[backcolor=transparent]:[backcolor=transparent]"${BC}"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"HADOOP_CLIENT_OPTS1"[backcolor=transparent]:[backcolor=transparent]"\"-Xmx512m -Xms512m $HADOOP_CLIENT_OPTS1\""
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hive-site"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"hive.tez.java.opts"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"-Xmx3900m"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hive-exec-log4j"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"log4j.logger.org.apache.zookeeper.ClientCnxnSocketNIO"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"INFO,FA"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]},
- [backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"classification"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"hive-log4j"[backcolor=transparent],
- [backcolor=transparent] [backcolor=transparent]"properties"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
- [backcolor=transparent] [backcolor=transparent]"log4j.logger.org.apache.zookeeper.server.NIOServerCnxn"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"INFO,DRFA"
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]}
- [backcolor=transparent] [backcolor=transparent]]
- [backcolor=transparent]}
classification 参数指定要修改的配置文件,properties 参数放置要修改的 key value 键值对,默认配置文件有对应的 key 有则只覆盖 value,没有则添加对应的 key value 键值对。
配置文件与 classification 的对应关系如下列表格所示:
[backcolor=transparent]Hadoop
[backcolor=transparent]Pig
[backcolor=transparent]Hive
core-site 这类扁平的 xml 文件只有一层,配置都放在 properties 里。而 hadoop-en v这类 sh 文件可能有两层结构,可以通过嵌套 configurations 的方式来设置,请参见示例里 hadoop-env 的部分,为 export 的 HADOOP_CLIENT_OPTS 属性添加了 -Xmx512m -Xms512m 的设置。
设置好后,确认后单击[backcolor=transparent]下一步。