OSDN Git Service

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