:mcast_addr => '239.2.11.20'
}
},
- :praesepe => {
- },
:hyades => {
},
+ :praesepe => {
+ },
:ptolemy => {
:gmetads => {
:name => 'gmetads',
#'truenode.max.xcievers' => '4096'
},
'yarn-site.xml' => {}, # ver. 2.0
- 'mapred-site.xml' => {},
+ 'mapred-site.xml' => {
+ #'mapred.tasktracker.map.tasks.maximum' => '4', # default: 2
+ #'mapred.tasktracker.reduce.tasks.maximum' => '2', # default: 2
+ #'mapred.child.java.opts' => '-Xmx1000m', # default: -Xmx200m
+ #'mapred.reduce.slowstart.completed.maps' => '0.80', # default: 0.05
+ #'tasktracker.http.threads' => '80', # default: 40
+ #'mapred.reduce.parallel.copies' => SQRT(nodes) # default: 5
+ },
'capacity-scheduler.xml' => {},
}
#default['hadoop'][''] =
-name 'hadoop-ptolemy'
-description 'Pleiades Hadoop cluster node'
+$LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
+#${chef-repo}/_lib/grid.rb
+require 'grid'
+
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+
+name "hadoop-#{cluster_name}"
+description "#{cluster_name.capitalize} Hadoop cluster node"
run_list(
'role[node_commons]',
grid_vol_root = '/grid/vol'
hadoop_attributes = {
# core-site.xml
- 'this.cluster.name' => 'ptolemy',
- 'this.domain' => 'grid.example.com',
+ 'this.cluster.name' => cluster_name,
+ 'this.domain' => Grid::DOMAIN,
'this.namenode.fqdn' => '${this.cluster.name}-nn.${this.domain}',
'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint",
#'fs.checkpoint.dir' => "#{grid_vol_root}/0/var/lib/${user.name}/checkpoint,/export/home/${user.name}/var/lib/checkpoint",
'this.jobtracker.fqdn' => '${this.cluster.name}-jt.${this.domain}',
'this.jobhistory.fqdn' => '${this.cluster.name}-jt.${this.domain}',
#'this.jobhistory.fqdn' => '${this.cluster.name}-jh.${this.domain}',
+ 'extra_configs' => {
+ # e.g. 'core-site.xml' => {'k1' => 'v1', 'k2' => 'v2'},
+ 'hadoop-env.sh' => {},
+ 'yarn-env.sh' => {}, # ver. 2.0
+ 'mapred-env.sh' => {}, # ver. 2.0
+ 'core-site.xml' => {},
+ 'hdfs-site.xml' => {
+ # with HBase
+ #'dfs.support.append' => 'true',
+ #'truenode.max.xcievers' => '4096'
+ },
+ 'yarn-site.xml' => {}, # ver. 2.0
+ 'mapred-site.xml' => {
+ #'mapred.tasktracker.map.tasks.maximum' => '4', # default: 2
+ #'mapred.tasktracker.reduce.tasks.maximum' => '2', # default: 2
+ #'mapred.child.java.opts' => '-Xmx1000m', # default: -Xmx200m
+ #'mapred.reduce.slowstart.completed.maps' => '0.80', # default: 0.05
+ #'tasktracker.http.threads' => '80', # default: 40
+ #'mapred.reduce.parallel.copies' => SQRT(nodes) # default: 5
+ },
+ 'capacity-scheduler.xml' => {}
+ }
}
default_attributes(
require 'rubygems'
require 'bracecomp'
-name 'pleiades-gm'
-description 'Pleiades ganglia gmetad node'
+cluster_name = 'pleiades'
+cluster_sym = cluster_name.to_sym
+
+name "#{cluster_name}-gm"
+description "#{cluster_name.capitalize} ganglia gmetad node"
run_list(
'role[node_commons]',
#env_run_lists()
-this_subcluster = Grid::CLUSTERS[:pleiades][:gmetads]
+this_subcluster = Grid::CLUSTERS[cluster_sym][:gmetads]
mcast_addr = this_subcluster[:mcast_addr]
port = '8649'
polling_interval = '30'
# for non-DataNodes
data_sources = []
-Grid::CLUSTERS[:pleiades].select{|key| key != :datanodes}.each {|key, cluster|
+Grid::CLUSTERS[cluster_sym].select{|key| key != :datanodes}.each {|key, cluster|
data_sources.push(
{
:name => cluster[:alias],
},
)
+nagios_nodes = []
+if defined? Grid::CLUSTERS[cluster_sym][:nagioses][:nodes] then
+ nagios_nodes = Grid::CLUSTERS[cluster_sym][:nagioses][:nodes].map{|host| "#{host}.#{Grid::DOMAIN}"}
+end
+
override_attributes(
'ganglia' => {
# gmond
},
# gmetad
'gridname' => 'Pleiades',
- 'trusted_hosts' => ['127.0.0.1'] \
- + Grid::CLUSTERS[:pleiades][:nagioses][:nodes].map{|host| "#{host}.#{Grid::DOMAIN}"},
+ 'trusted_hosts' => ['127.0.0.1'] + nagios_nodes,
'data_sources' => data_sources + dn_data_sources
}
)
#${chef-repo}/_lib/grid.rb
require 'grid'
-name 'ptolemy-dn'
-description 'Ptolemy DataNode node'
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+
+name "#{cluster_name}-dn"
+description "#{cluster_name.capitalize} DataNode node"
run_list(
'role[node_commons]',
#'role[grid-realm]',
'role[ganglia-gmond]',
- 'role[ptolemy-node]'
+ "role[#{cluster_name}-node]"
)
#env_run_lists()
-mcast_addr = Grid::CLUSTERS[:ptolemy][:datanodes][:mcast_addr]
+mcast_addr = Grid::CLUSTERS[cluster_sym][:datanodes][:mcast_addr]
port = '8649'
default_attributes(
'name' => 'DataNode00000',
'owner' => Grid::DOMAIN
},
+=begin
## static multi-cast
'static' => {
'udp_send_channels' => [
}
]
}
-=begin
+=end
## automatic multi/uni-cast
'gmond_conf_type' => 'automatic',
- 'automatic' = {
+ 'automatic' => {
'cluster_name_prefix' => 'DataNode', # DataNode#####
'cast_mode' => 'uni', # or multi
- 'domain' => 'grid.example.com',
- 'node_prefix' => 'dn',
- 'digit_nums' => '5', # dn#####
+ 'domain' => Grid::DOMAIN,
+ #'node_prefix' => 'dn',
+ 'node_prefix' => 'dn4',
+ #'digit_nums' => '5', # dn#####
+ 'digit_nums' => '4', # dn4####
'padstr' => '0', # dn00000
'first_node_num' => '0', # 1st node: dn00000.grid.example.com
- 'last_node_num' => '999', # last node: dn00999.grid.example.com
+ #'last_node_num' => '999', # last node: dn00999.grid.example.com
+ 'last_node_num' => '1', # last node: dn40001.grid.example.com
'head_node_nums' => '2', # heads of the 1st cluster: dn0000{0..1}.grid.example.com
'cluster_size' => '40', # heads of the 2nd cluster: dn0004{0..1}.grid.example.com
'mcast_join' => mcast_addr, # multi-cast mode only
'port' => port,
'ttl' => '1', # multi-cast mode only
- 'bind' => '239.2.11.71' # multi-cast mode only
+ 'bind' => mcast_addr # multi-cast mode only
}
-=end
}
)
require 'rubygems'
require 'bracecomp'
-name 'ptolemy-gm'
-description 'Ptolemy ganglia gmetad node'
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+
+name "#{cluster_name}-gm"
+description "#{cluster_name.capitalize} ganglia gmetad node"
run_list(
'role[node_commons]',
#env_run_lists()
-this_subcluster = Grid::CLUSTERS[:ptolemy][:gmetads]
+this_subcluster = Grid::CLUSTERS[cluster_sym][:gmetads]
mcast_addr = this_subcluster[:mcast_addr]
port = '8649'
polling_interval = '30'
-=begin
# uni-cast
udp_send_channels4ucast = []
this_subcluster[:nodes].first(2).each {|host|
}
)
}
-=end
# for non-DataNodes
data_sources = []
-Grid::CLUSTERS[:ptolemy].select{|key| key != :datanodes}.each {|key, cluster|
+Grid::CLUSTERS[cluster_sym].select{|key| key != :datanodes}.each {|key, cluster|
data_sources.push(
{
:name => cluster[:alias],
# for DataNodes
head_node_nums = 2
-digit_nums = 5
+digit_nums = 4
padstr = '0'
dn_data_sources = []
(0...2).step(40) {|v|
{
:name => "DataNode#{first_head}",
:polling_interval => polling_interval,
- :address_list => "dn{#{first_head}..#{last_head}}.#{Grid::DOMAIN}".expand
+ # dn40000
+ :address_list => "dn4{#{first_head}..#{last_head}}.#{Grid::DOMAIN}".expand
}
)
}
},
)
+nagios_nodes = []
+if defined? Grid::CLUSTERS[cluster_sym][:nagioses][:nodes] then
+ nagios_nodes = Grid::CLUSTERS[cluster_sym][:nagioses][:nodes].map{|host| "#{host}.#{Grid::DOMAIN}"}
+end
+
override_attributes(
'ganglia' => {
# gmond
'name' => this_subcluster[:alias],
'owner' => Grid::DOMAIN
},
- ## static multi-cast
'static' => {
+=begin
+ ## static multi-cast
'udp_send_channels' => [
{
'mcast_join' => mcast_addr,
'bind' => mcast_addr
}
],
-=begin
+=end
## static uni-cast
'udp_send_channels' => udp_send_channels4ucast,
'udp_recv_channels' => [
'bind' => ''
}
],
-=end
},
# gmetad
- 'gridname' => 'Ptolemy',
- 'trusted_hosts' => ['127.0.0.1'],
- #'trusted_hosts' => ['127.0.0.1'] \
- # + Grid::CLUSTERS[:ptolemy][:nagioses][:nodes].map{|host| "#{host}.#{Grid::DOMAIN}"},
+ 'gridname' => cluster_name.capitalize,
+ 'trusted_hosts' => ['127.0.0.1'] + nagios_nodes,
'data_sources' => data_sources + dn_data_sources
}
)
#${chef-repo}/_lib/grid.rb
require 'grid'
-name 'ptolemy-jt'
-description 'Ptolemy JobTracker node'
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+
+name "#{cluster_name}-jt"
+description "#{cluster_name.capitalize} JobTracker node"
run_list(
'role[node_commons]',
#'role[grid-realm]',
'role[ganglia-gmond]',
- 'role[ptolemy-node]'
+ "role[#{cluster_name}-node]"
)
#env_run_lists()
-this_subcluster = Grid::CLUSTERS[:ptolemy][:jobtrackers]
+this_subcluster = Grid::CLUSTERS[cluster_sym][:jobtrackers]
mcast_addr = this_subcluster[:mcast_addr]
port = '8649'
-=begin
# uni-cast
udp_send_channels4ucast = []
this_subcluster[:nodes].first(2).each {|host|
}
)
}
-=end
default_attributes(
)
'owner' => Grid::DOMAIN
},
'static' => {
+=begin
## static multi-cast
'udp_send_channels' => [
{
'bind' => mcast_addr
}
]
-=begin
+=end
## static uni-cast
'udp_send_channels' => udp_send_channels4ucast,
'udp_recv_channels' => [
'bind' => ''
}
]
-=end
}
}
)
#${chef-repo}/_lib/grid.rb
require 'grid'
-name 'ptolemy-nn'
-description 'Ptolemy NameNode node'
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+
+name "#{cluster_name}-nn"
+description "#{cluster_name.capitalize} NameNode node"
run_list(
'role[node_commons]',
#'role[grid-realm]',
'role[ganglia-gmond]',
- 'role[ptolemy-node]'
+ "role[#{cluster_name}-node]"
)
#env_run_lists()
-this_subcluster = Grid::CLUSTERS[:ptolemy][:namenodes]
+this_subcluster = Grid::CLUSTERS[cluster_sym][:namenodes]
mcast_addr = this_subcluster[:mcast_addr]
port = '8649'
-=begin
# uni-cast
udp_send_channels4ucast = []
this_subcluster[:nodes].first(2).each {|host|
}
)
}
-=end
default_attributes(
)
'owner' => Grid::DOMAIN
},
'static' => {
+=begin
## static multi-cast
'udp_send_channels' => [
{
'bind' => mcast_addr
}
]
-=begin
+=end
## static uni-cast
'udp_send_channels' => udp_send_channels4ucast,
'udp_recv_channels' => [
'bind' => ''
}
]
-=end
}
}
)
#${chef-repo}/_lib/grid.rb
require 'grid'
-name 'ptolemy-node'
-description 'Ptolemy cluster node'
+cluster_name = 'ptolemy'
+cluster_sym = cluster_name.to_sym
+hadoop_version = '1.2.1'
+hbase_version = '0.94.7'
+
+name "#{cluster_name}-node"
+description "#{cluster_name.capitalize} cluster node"
run_list(
- 'role[hadoop-ptolemy]',
- #'role[hadoop-ptolemy-with-security]',
- #'role[hbase-ptolemy-with-security]'
+ "role[hadoop-#{cluster_name}]",
+ #"role[hadoop-#{cluster_name}-with-security]",
+ #"role[hbase-#{cluster_name}-with-security]"
)
#env_run_lists()
-cluster = Grid::CLUSTERS[:ptolemy]
+cluster = Grid::CLUSTERS[cluster_sym]
default_attributes(
'hadoop' => {
- 'version' => '1.2.1',
+ 'version' => hadoop_version,
'metrics2' => {
# multi-cast
'namenode.sink.ganglia.servers' => "#{cluster[:namenodes][:mcast_addr]}:8649",
},
=begin
'hbase' => {
- 'version' => '0.94.7'
+ 'version' => hbase_version
}
=end
)