a) Update the property in relevant mapred-site.xml(from where client load the config).
b) Import the mapred-site.xml configuration file in the job startup command line using "-conf mapred-site.xml"
For example: yarn jar hadoop-example.jar sleep -conf /mapreduce/conf/mapred-site.xml -m 1 -r 1 -mt 1000 -rt 1000
The priority of the configuration in -conf mapred-site.xml has higher priority than (a).
c) Run the MapReduce job in command line using -DpropertyName=propertyValue to import the property.
d) In the MapReduce client code, use conf.set(name, value) to set the property.
這個配置是客戶端參數,也就是提交作業的機器上的mapred-site.xml配置,可能是不同用戶在不同節點上提交的,有些節點沒有更新。
注意,這個配置與集群中節點沒關系,與提交作業的機器有關。
此外,這個參數也可以由用戶定制,每個作業可以單獨設置,可能有些人自己做了修改。
有關這個參數,一開始我理解不夠,當前的集群中配置文件 mapred-site.xml中啟用了大頁面,我在操作去掉大頁面的過程中,替換了所有mapred-site.xml
中使用大頁面的參數Xlp(ibm jdk). 但是在檢查的時候 pdsh –w nodelist –w ‘ps –ef | grep attempt | grep –v grep ‘還是發現了在用大頁面的作業存在。
發現有一些應用自己指定了mapreduce.map.java.opts,它是通過打包舊的配置文件來實現的。
hadoop jar $myjar mainclass –Dmapreduce.map.java.opts=”-server –Xms500m –Xmx500m” args
類似的參數還有mapreduce.reduce.java.opts