OSDN Git Service

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