2 # Copyright 2013-2014, whitestar
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 $LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
18 #${chef-repo}/roles/_lib/grid.rb
22 cluster_name = 'ptolemy'
23 cluster_sym = cluster_name.to_sym
25 name "#{cluster_name}-jt"
26 description "#{cluster_name.capitalize} JobTracker node"
31 'role[ganglia-gmond]',
32 "role[#{cluster_name}-node]"
37 this_subcluster = Grid::CLUSTERS[cluster_sym][:jobtrackers]
38 mcast_addr = this_subcluster[:mcast_addr]
41 udp_send_channels4ucast = []
42 this_subcluster[:nodes].first(2).each {|host|
43 udp_send_channels4ucast.push(
46 'host' => "#{host}.#{Grid::DOMAIN}",
47 #'host' => IPSocket.getaddress("#{host}.#{Grid::DOMAIN}"),
61 'name' => this_subcluster[:alias],
62 'owner' => Grid::DOMAIN
67 'udp_send_channels' => [
69 'mcast_join' => mcast_addr,
75 'udp_recv_channels' => [
77 'mcast_join' => mcast_addr,
84 'udp_send_channels' => udp_send_channels4ucast,
85 'udp_recv_channels' => [