OSDN Git Service

fix service control.
[metasearch/grid-chef-repo.git] / roles / pleiades-hm.rb
index 4ccbf7f..48fcf93 100644 (file)
@@ -1,5 +1,21 @@
-$LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
-#${chef-repo}/_lib/grid.rb
+#
+# Copyright 2013-2014, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+$LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
+#${chef-repo}/roles/_lib/grid.rb
 require 'grid'
 
 name 'pleiades-hm'
@@ -14,8 +30,23 @@ run_list(
 
 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
 
-mcast_addr = Grid::CLUSTERS[:pleiades][:hbasemasters][:mcast_addr]
+this_subcluster = Grid::CLUSTERS[:pleiades][:hbasemasters]
+mcast_addr = this_subcluster[:mcast_addr]
 port = '8649'
+=begin
+# uni-cast
+udp_send_channels4ucast = []
+this_subcluster[:nodes].first(2).each {|host|
+  udp_send_channels4ucast.push(
+    {
+      'mcast_join' => '',
+      'host' => "#{host}.#{Grid::DOMAIN}",
+      'port' => port,
+      'ttl' => ''
+    }
+  )
+}
+=end
 
 default_attributes(
 )
@@ -24,7 +55,7 @@ override_attributes(
   'ganglia' => {
     # gmond
     'cluster' => {
-      'name' => Grid::CLUSTERS[:pleiades][:hbasemasters][:alias],
+      'name' => this_subcluster[:alias],
       'owner' => Grid::DOMAIN
     },
     'static' => {
@@ -46,20 +77,7 @@ override_attributes(
       ]
 =begin
       ## static uni-cast
-      'udp_send_channels' => [
-        {
-          'mcast_join' => '',
-          'host' => "hm00.#{Grid::DOMAIN}",
-          'port' => port,
-          'ttl' => ''
-        },
-        {
-          'mcast_join' => '',
-          'host' => "hm01.#{Grid::DOMAIN}",
-          'port' => port,
-          'ttl' => ''
-        }
-      ],
+      'udp_send_channels' => udp_send_channels4ucast,
       'udp_recv_channels' => [
         {
           'mcast_join' => '',