2 # Copyright 2013-2014, whitestar
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 $LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
18 #${chef-repo}/roles/_lib/grid.rb
21 cluster_name = 'praesepe'
22 cluster_sym = cluster_name.to_sym
24 name "hadoop-#{cluster_name}"
25 description "#{cluster_name.capitalize} Hadoop cluster node"
30 #'role[nameservice-client-grid]',
36 grid_vol_root = '/grid/vol'
39 'this.cluster.name' => cluster_name,
40 'this.domain' => Grid::DOMAIN,
41 'this.namenode.fqdn' => '${this.cluster.name}-nn.${this.domain}',
42 'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint",
43 #'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint,/export/home/${user.name}/var/lib/checkpoint",
45 'this.secondary.namenode.fqdn' => '${this.cluster.name}-cn.${this.domain}',
46 'dfs.name.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/name",
47 #'dfs.name.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/name,/export/home/${user.name}/var/lib/name",
48 'dfs.replication' => '2',
49 #'dfs.replication' => '3',
51 'this.jobtracker.fqdn' => '${this.cluster.name}-jt.${this.domain}',
52 'this.jobhistory.fqdn' => '${this.cluster.name}-jt.${this.domain}',
53 #'this.jobhistory.fqdn' => '${this.cluster.name}-jh.${this.domain}',
55 # e.g. 'core-site.xml' => {'k1' => 'v1', 'k2' => 'v2'},
56 'hadoop-env.sh' => {},
57 'yarn-env.sh' => {}, # ver. 2.0
58 'mapred-env.sh' => {}, # ver. 2.0
59 'core-site.xml' => {},
62 #'dfs.support.append' => 'true',
63 #'truenode.max.xcievers' => '4096'
65 'yarn-site.xml' => {}, # ver. 2.0
66 'mapred-site.xml' => {
67 #'mapred.tasktracker.map.tasks.maximum' => '4', # default: 2
68 #'mapred.tasktracker.reduce.tasks.maximum' => '2', # default: 2
69 #'mapred.child.java.opts' => '-Xmx1000m', # default: -Xmx200m
70 #'mapred.reduce.slowstart.completed.maps' => '0.80', # default: 0.05
71 #'tasktracker.http.threads' => '80', # default: 40
72 #'mapred.reduce.parallel.copies' => SQRT(nodes) # default: 5
74 'capacity-scheduler.xml' => {}
82 'vol_root' => grid_vol_root,
85 'hadoop' => hadoop_attributes