OSDN Git Service

add Apache Hadoop 2.2.0 support to the hadoop cookbooks.
[metasearch/grid-chef-repo.git] / cookbooks / hadoop / templates / default / etc-2.0 / hadoop / yarn-site.xml
1 <?xml version="1.0"?>
2 <!--
3   Licensed under the Apache License, Version 2.0 (the "License");
4   you may not use this file except in compliance with the License.
5   You may obtain a copy of the License at
6
7     http://www.apache.org/licenses/LICENSE-2.0
8
9   Unless required by applicable law or agreed to in writing, software
10   distributed under the License is distributed on an "AS IS" BASIS,
11   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   See the License for the specific language governing permissions and
13   limitations under the License. See accompanying LICENSE file.
14 -->
15 <configuration>
16
17 <!-- Site specific YARN configuration properties -->
18     <property>
19         <name>this.resourcemanager.fqdn</name>
20         <value><%= node['hadoop']['this.resourcemanager.fqdn'] %></value>
21         <!-- <value>${this.cluster.name}-rm.${this.domain}</value> -->
22     </property>
23
24     <property>
25         <name>yarn.log-aggregation-enable</name>
26         <value><%= node['hadoop']['yarn.log-aggregation-enable'] %></value>
27     </property>
28     <property>
29         <name>yarn.resourcemanager.scheduler.class</name>
30         <value><%= node['hadoop']['yarn.resourcemanager.scheduler.class'] %></value>
31         <description>In case you do not want to use the default scheduler</description>
32     </property>
33 <%
34 yarn_nodemanager_local_dirs = ''
35 @active_vol_nums.to_i.times {|vol_num|
36   yarn_nodemanager_local_dirs = yarn_nodemanager_local_dirs == '' ? '' : "#{yarn_nodemanager_local_dirs},"
37   yarn_nodemanager_local_dirs = "#{yarn_nodemanager_local_dirs}#{node['grid']['vol_root']}/#{vol_num}/var/lib/${user.name}/nm/local"
38 }
39 -%>
40     <property>
41         <name>yarn.nodemanager.local-dirs</name>
42         <value><%= yarn_nodemanager_local_dirs %></value>
43         <!-- <value>/grid/vol/0/var/lib/${user.name}/nm/local,/grid/vol/1/var/lib/${user.name}/nm/local</value> -->
44         <description>the local directories used by the nodemanager
45         (default: /tmp/nm-local-dir)</description>
46     </property>
47     <property>
48         <name>yarn.nodemanager.resource.memory-mb</name>
49         <value><%= node['hadoop']['yarn.nodemanager.resource.memory-mb'] %></value>
50         <description>Amount of physical memory, in MB, that can be allocated
51         for containers. (default: 8192)</description>
52     </property>
53     <property>
54         <name>yarn.nodemanager.resource.cpu-cores</name>
55         <value><%= node['hadoop']['yarn.nodemanager.resource.cpu-cores'] %></value>
56         <description>Number of CPU cores that can be allocated
57         for containers. (default: 8)</description>
58     </property>
59     <property>
60         <name>yarn.nodemanager.remote-app-log-dir</name>
61         <value><%= node['hadoop']['yarn.nodemanager.remote-app-log-dir'] %></value>
62         <description>directory on hdfs where the application logs are moved to
63         (default: /tmp/logs)</description>
64     </property>
65 <%
66 yarn_nodemanager_log_dirs = ''
67 @active_vol_nums.to_i.times {|vol_num|
68   yarn_nodemanager_log_dirs = yarn_nodemanager_log_dirs == '' ? '' : "#{yarn_nodemanager_log_dirs},"
69   yarn_nodemanager_log_dirs = "#{yarn_nodemanager_log_dirs}#{node['grid']['vol_root']}/#{vol_num}/var/log/${user.name}/nm"
70 }
71 -%>
72     <property>
73         <name>yarn.nodemanager.log-dirs</name>
74         <value><%= yarn_nodemanager_log_dirs %></value>
75         <!-- <value>/grid/vol/0/var/log/${user.name}/nm,/grid/vol/1/var/log/${user.name}/nm</value> -->
76         <description>the directories used by Nodemanagers as log directories
77         (default: /tmp/logs)</description>
78     </property>
79     <property>
80         <name>yarn.nodemanager.aux-services</name>
81         <value><%= node['hadoop']['yarn.nodemanager.aux-services'] %></value>
82         <description>shuffle service that needs to be set for Map Reduce to run</description>
83     </property>
84     <property>
85         <name>yarn.application.classpath</name>
86         <value><%= node['hadoop']['yarn.application.classpath'] %></value>
87         <description>Classpath for typical applications.</description>
88     </property>
89
90     <property>
91         <name>yarn.resourcemanager.nodes.include-path</name>
92         <value><%= node['hadoop']['yarn.resourcemanager.nodes.include-path'] %></value>
93         <description>Path to file with nodes to include.</description>
94     </property>
95     <property>
96         <name>yarn.resourcemanager.nodes.exclude-path</name>
97         <value><%= node['hadoop']['yarn.resourcemanager.nodes.exclude-path'] %></value>
98         <description>Path to file with nodes to exclude.</description>
99     </property>
100
101     <property>
102         <name>yarn.nodemanager.admin-env</name>
103         <value><%= node['hadoop']['yarn.nodemanager.admin-env'] %></value>
104     </property>
105
106 <% if node['hadoop']['with_security'] then -%>
107     <property>
108         <name>yarn.acl.enable</name>
109         <value><%= node['hadoop']['yarn.acl.enable'] %></value>
110     </property>
111     <property>
112         <name>yarn.admin.acl</name>
113         <value><%= node['hadoop']['yarn.admin.acl'] %></value>
114     </property>
115     <property>
116         <name>yarn.resourcemanager.principal</name>
117         <value><%= node['hadoop']['yarn.resourcemanager.principal'] %></value>
118         <!-- <value>yarn/_HOST@${this.realm}</value> -->
119     </property>
120     <property>
121         <name>yarn.resourcemanager.keytab</name>
122         <value><%= node['hadoop']['yarn.resourcemanager.keytab'] %></value>
123     </property>
124     <property>
125         <name>yarn.nodemanager.principal</name>
126         <value><%= node['hadoop']['yarn.nodemanager.principal'] %></value>
127         <!-- <value>yarn/_HOST@${this.realm}</value> -->
128     </property>
129     <property>
130         <name>yarn.nodemanager.keytab</name>
131         <value><%= node['hadoop']['yarn.nodemanager.keytab'] %></value>
132     </property>
133
134     <property>
135         <name>yarn.nodemanager.container-executor.class</name>
136         <value><%= node['hadoop']['yarn.nodemanager.container-executor.class'] %></value>
137     </property>
138     <property>
139         <name>yarn.nodemanager.linux-container-executor.group</name>
140         <value><%= node['hadoop']['yarn.nodemanager.linux-container-executor.group'] %></value>
141     </property>
142     <property>
143         <name>yarn.nodemanager.linux-container-executor.resources-handler.class</name>
144         <value><%= node['hadoop']['yarn.nodemanager.linux-container-executor.resources-handler.class'] %></value>
145         <description>The class which should help the LCE handle resources.</description>
146     </property>
147     <property>
148         <name>yarn.nodemanager.linux-container-executor.cgroups.hierarchy</name>
149         <value><%= node['hadoop']['yarn.nodemanager.linux-container-executor.cgroups.hierarchy'] %></value>
150         <description>The cgroups hierarchy under which to place YARN proccesses (cannot contain commas).
151         If yarn.nodemanager.linux-container-executor.cgroups.mount is false (that is, if cgroups have
152         been pre-configured), then this cgroups hierarchy must already exist and be writable by the
153         NodeManager user, otherwise the NodeManager may fail.
154         Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler.</description>
155     </property>
156     <property>
157         <name>yarn.nodemanager.linux-container-executor.cgroups.mount</name>
158         <value><%= node['hadoop']['yarn.nodemanager.linux-container-executor.cgroups.mount'] %></value>
159         <description>Whether the LCE should attempt to mount cgroups if not found.
160         Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler.</description>
161     </property>
162     <property>
163         <name>yarn.nodemanager.linux-container-executor.cgroups.mount-path</name>
164         <value><%= node['hadoop']['yarn.nodemanager.linux-container-executor.cgroups.mount-path'] %></value>
165         <description>Where the LCE should attempt to mount cgroups if not found. Common locations
166         include /sys/fs/cgroup and /cgroup; the default location can vary depending on the Linux
167         distribution in use. This path must exist before the NodeManager is launched.
168         Only used when the LCE resources handler is set to the CgroupsLCEResourcesHandler, and
169         yarn.nodemanager.linux-container-executor.cgroups.mount is true.</description>
170     </property>
171 <% end -%>
172 <%
173 this_file = 'mapred-site.xml'
174 if defined? node['hadoop']['extra_configs'][this_file] \
175   && node['hadoop']['extra_configs'][this_file] != nil then
176   node['hadoop']['extra_configs'][this_file].each do |key,value|
177 -%>
178     <property>
179         <name><%= key %></name>
180         <value><%= value %></value>
181     </property>
182 <%
183   end
184 end 
185 -%>
186 </configuration>