OSDN Git Service

add yarn-installer recipe to the nodejs_utils cookbook.
[metasearch/grid-chef-repo.git] / roles / praesepe-nn.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 "#{cluster_name}-nn"
25 description "#{cluster_name.capitalize} NameNode node"
26
27 run_list(
28   'role[node_commons]',
29   #'role[grid-realm]',
30   'role[ganglia-gmond]',
31   "role[#{cluster_name}-node]"
32 )
33
34 #env_run_lists()
35
36 this_subcluster = Grid::CLUSTERS[cluster_sym][:namenodes]
37 mcast_addr = this_subcluster[:mcast_addr]
38 port = '8649'
39 # uni-cast
40 udp_send_channels4ucast = []
41 this_subcluster[:nodes].first(2).each {|host|
42   udp_send_channels4ucast.push(
43     {
44       'mcast_join' => '',
45       'host' => "#{host}.#{Grid::DOMAIN}",
46       'port' => port,
47       'ttl' => ''
48     }
49   )
50 }
51
52 default_attributes(
53 )
54
55 override_attributes(
56   'ganglia' => {
57     # gmond
58     'cluster' => {
59       'name' => this_subcluster[:alias],
60       'owner' => Grid::DOMAIN
61     },
62     'static' => {
63 =begin
64       ## static multi-cast
65       'udp_send_channels' => [
66         {
67           'mcast_join' => mcast_addr,
68           'host' => '',
69           'port' => port,
70           'ttl' => '1'
71         }
72       ],
73       'udp_recv_channels' => [
74         {
75           'mcast_join' => mcast_addr,
76           'port' => port,
77           'bind' => mcast_addr
78         }
79       ]
80 =end
81       ## static uni-cast
82       'udp_send_channels' => udp_send_channels4ucast,
83       'udp_recv_channels' => [
84         {
85           'mcast_join' => '',
86           'port' => port,
87           'bind' => ''
88         }
89       ]
90     }
91   }
92 )