OSDN Git Service

add yarn-installer recipe to the nodejs_utils cookbook.
[metasearch/grid-chef-repo.git] / roles / hadoop-praesepe.rb
1 #
2 # Copyright 2013-2014, whitestar
3 #
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
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16
17 $LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
18 #${chef-repo}/roles/_lib/grid.rb
19 require 'grid'
20
21 cluster_name = 'praesepe'
22 cluster_sym = cluster_name.to_sym
23
24 name "hadoop-#{cluster_name}"
25 description "#{cluster_name.capitalize} Hadoop cluster node"
26
27 run_list(
28   'role[node_commons]',
29   # LDAP (option)
30   #'role[nameservice-client-grid]',
31   'role[hadoop]'
32 )
33
34 #env_run_lists()
35
36 grid_vol_root = '/grid/vol'
37 hadoop_attributes = {
38   # core-site.xml
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",
44   # hdfs-site.xml
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',
50   # mapred-site.xml
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}',
54   'extra_configs' => {
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' => {},
60     'hdfs-site.xml' => {
61       # with HBase
62       #'dfs.support.append' => 'true',
63       #'truenode.max.xcievers' => '4096'
64     },
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
73     },
74     'capacity-scheduler.xml' => {}
75   }
76 }
77
78 #default_attributes()
79
80 override_attributes(
81   'grid' => {
82     'vol_root' => grid_vol_root,
83     'max_vol_nums' => '4'
84   },
85   'hadoop' => hadoop_attributes
86 )
87