Author: swagle
Date: Thu Apr 18 17:49:30 2013
New Revision: 1469493
URL: http://svn.apache.org/r1469493
Log:
AMBARI-1978. Deploying HDP-1.3.0 results in several alerts - is it related to
hard-coded port. (swagle)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_port_from_url.rb
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1469493&r1=1469492&r2=1469493&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Apr 18 17:49:30 2013
@@ -760,6 +760,9 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-1978. Deploying HDP-1.3.0 results in several alerts - is it related to
+ hard-coded port. (swagle)
+
AMBARI-1974. BootStrapTest is failing on the master build. (smohanty)
AMBARI-1968. Hadoop Classpath is being overwridden which causes hive
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_port_from_url.rb
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_port_from_url.rb?rev=1469493&r1=1469492&r2=1469493&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_port_from_url.rb
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_port_from_url.rb
Thu Apr 18 17:49:30 2013
@@ -21,6 +21,24 @@
# to get Port from URL string
module Puppet::Parser::Functions
newfunction(:hdp_get_port_from_url, :type => :rvalue) do |args|
- args.empty? ? "" : args.kind_of?(Array) ? args[0].split(":")[1] :
args.split(":")[1]
+ def is_numeric?(s)
+ !!Integer(s) rescue false
+ end
+
+ var = args.empty? ? "" : args.kind_of?(Array) ? args[0].split(":")[1] :
args.split(":")[1]
+
+ if function_hdp_is_empty(var)
+ if args.kind_of?(Array)
+ if args.length > 1
+ var = args[1]
+ else
+ is_numeric?(args[0]) ? args[0] : ""
+ end
+ else
+ is_numeric?(args) ? args : "";
+ end
+ else
+ var
+ end
end
-end
\ No newline at end of file
+end
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp?rev=1469493&r1=1469492&r2=1469493&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
Thu Apr 18 17:49:30 2013
@@ -48,25 +48,14 @@ class hdp(
if has_key($configuration, 'mapred-site') {
$mapred-site = $configuration['mapred-site']
- $jtnode_port =
hdp_get_port_from_url($mapred-site["mapred.job.tracker.http.address"])
- $tasktracker_port =
hdp_get_port_from_url($mapred-site["mapred.task.tracker.http.address"])
- $jobhistory_port =
hdp_get_port_from_url($mapred-site["mapreduce.history.server.http.address"])
- } else {
- $jtnode_port = "50030"
- $tasktracker_port = "50060"
- $jobhistory_port = "51111"
- }
-
- if has_key($configuration, 'hbase-site') {
- $hbase-site = $configuration['hbase-site']
- $hbase_master_port = $hbase-site["hbase.master.info.port"]
- $hbase_rs_port = $hbase-site["hbase.regionserver.info.port"]
- } else {
- $hbase_master_port = "60010"
- $hbase_rs_port = "60030"
+ $jtnode_port =
hdp_get_port_from_url($mapred-site["mapred.job.tracker.http.address"],"50030")
+ $tasktracker_port =
hdp_get_port_from_url($mapred-site["mapred.task.tracker.http.address"],"50060")
+ $jobhistory_port =
hdp_get_port_from_url($mapred-site["mapreduce.history.server.http.address"],"51111")
}
-
+ $hbase_master_port =
hdp_default("hadoop/hbase-site/hbase.master.info.port","60010")
+ $hbase_rs_port =
hdp_default("hadoop/hbase-site/hbase.regionserver.info.port","60030")
+
#TODO: think not needed and also there seems to be a puppet bug around this
and ldap
class { 'hdp::snmp': service_state => 'running'}