OSDN Git Service

Merge branch 'chef-vendor-java'
[metasearch/grid-chef-repo.git] / roles / grid-gpm.rb
1 $LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
2 #${chef-repo}/_lib/grid.rb
3 require 'grid'
4
5 name 'grid-gpm'
6 description 'Grid provisioning master node'
7
8 run_list(
9   'role[node_commons]',
10   'role[ganglia-gmond]',
11 )
12
13 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
14
15 this_subcluster = Grid::CLUSTERS[:base][:provisioningmasters]
16 mcast_addr = this_subcluster[:mcast_addr]
17 port = '8649'
18 =begin
19 # uni-cast
20 udp_send_channels4ucast = []
21 this_subcluster[:nodes].first(2).each {|host|
22   udp_send_channels4ucast.push(
23     {
24       'mcast_join' => '',
25       'host' => "#{host}.#{Grid::DOMAIN}",
26       'port' => port,
27       'ttl' => ''
28     }
29   )
30 }
31 =end
32
33 default_attributes(
34 )
35
36 override_attributes(
37   'ganglia' => {
38     # gmond
39     'cluster' => {
40       'name' => this_subcluster[:alias],
41       'owner' => Grid::DOMAIN
42     },
43     # static multi-cast
44     'static' => {
45       'udp_send_channels' => [
46         {
47           'mcast_join' => mcast_addr,
48           'host' => '',
49           'port' => port,
50           'ttl' => '1'
51         }
52       ],
53       'udp_recv_channels' => [
54         {
55           'mcast_join' => mcast_addr,
56           'port' => port,
57           'bind' => mcast_addr
58         }
59       ]
60 =begin
61       ## static uni-cast
62       'udp_send_channels' => udp_send_channels4ucast,
63       'udp_recv_channels' => [
64         {
65           'mcast_join' => '',
66           'port' => port,
67           'bind' => ''
68         }
69       ]
70 =end
71     }
72   }
73 )