You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ds...@apache.org on 2015/12/23 17:58:57 UTC
ambari git commit: AMBARI-14467 Handle schemaless value for
ams-hbase-site/hbase.rootdir (dsen)
Repository: ambari
Updated Branches:
refs/heads/trunk 5592240b6 -> 6f8b840aa
AMBARI-14467 Handle schemaless value for ams-hbase-site/hbase.rootdir (dsen)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6f8b840a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6f8b840a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6f8b840a
Branch: refs/heads/trunk
Commit: 6f8b840aa7b15cf240ccdf3cfc819ed16235d06f
Parents: 5592240
Author: Dmytro Sen <ds...@apache.org>
Authored: Wed Dec 23 18:58:44 2015 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Wed Dec 23 18:58:44 2015 +0200
----------------------------------------------------------------------
.../0.1.0/configuration/ams-hbase-site.xml | 6 ++++++
.../stacks/HDP/2.0.6/services/stack_advisor.py | 20 +++++++++++++++-----
.../stacks/2.0.6/common/test_stack_advisor.py | 5 +++++
3 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6f8b840a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
index ccb7252..1964047 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-site.xml
@@ -29,6 +29,12 @@
HBase to either local filesystem path if using Ambari Metrics in embedded mode or
to a HDFS dir, example: hdfs://namenode.example.org:8020/amshbase.
</description>
+ <depends-on>
+ <property>
+ <type>core-site</type>
+ <name>fs.defaultFS</name>
+ </property>
+ </depends-on>
</property>
<property>
<name>hbase.tmp.dir</name>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6f8b840a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 97daa79..7e2871b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -459,6 +459,11 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
amsCollectorHosts = self.getComponentHostNames(services, "AMBARI_METRICS", "METRICS_COLLECTOR")
+ defaultFs = 'file:///'
+ if "core-site" in services["configurations"] and \
+ "fs.defaultFS" in services["configurations"]["core-site"]["properties"]:
+ defaultFs = services["configurations"]["core-site"]["properties"]["fs.defaultFS"]
+
rootDir = "file:///var/lib/ambari-metrics-collector/hbase"
tmpDir = "/var/lib/ambari-metrics-collector/hbase-tmp"
hbaseClusterDistributed = False
@@ -482,7 +487,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
if host["Hosts"]["host_name"] == collectorHostName:
mountpoints = self.getPreferredMountPoints(host["Hosts"])
break
- isLocalRootDir = rootDir.startswith("file://")
+ isLocalRootDir = rootDir.startswith("file://") or (defaultFs.startswith("file://") and rootDir.startswith("/"))
if isLocalRootDir:
rootDir = re.sub("^file:///|/", "", rootDir, count=1)
rootDir = "file://" + os.path.join(mountpoints[0], rootDir)
@@ -542,7 +547,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
putHbaseEnvProperty("hbase_master_xmn_size", round_to_n(0.15*(hbase_heapsize+hbase_rs_heapsize),64))
# If no local DN in distributed mode
- if rootDir.startswith("hdfs://"):
+ if rootDir.startswith("hdfs://") or (defaultFs.startswith("hdfs://") and rootDir.startswith("/")):
dn_hosts = self.getComponentHostNames(services, "HDFS", "DATANODE")
if set(amsCollectorHosts).intersection(dn_hosts):
collector_cohosted_with_dn = "true"
@@ -837,6 +842,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
amsCollectorHosts = self.getComponentHostNames(services, "AMBARI_METRICS", "METRICS_COLLECTOR")
ams_site = getSiteProperties(configurations, "ams-site")
+ core_site = getSiteProperties(configurations, "core-site")
collector_heapsize, hbase_heapsize, total_sinks_count = self.getAmsMemoryRecommendation(services, hosts)
recommendedDiskSpace = 10485760
@@ -855,10 +861,14 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
rootdir_item = None
op_mode = ams_site.get("timeline.metrics.service.operation.mode")
+ default_fs = core_site.get("fs.defaultFS") if core_site else "file:///"
hbase_rootdir = properties.get("hbase.rootdir")
hbase_tmpdir = properties.get("hbase.tmp.dir")
- if op_mode == "distributed" and hbase_rootdir.startswith("file://"):
+ is_local_root_dir = hbase_rootdir.startswith("file://") or (default_fs.startswith("file://") and hbase_rootdir.startswith("/"))
+ if op_mode == "distributed" and is_local_root_dir:
rootdir_item = self.getWarnItem("In distributed mode hbase.rootdir should point to HDFS.")
+ elif op_mode == "embedded" and hbase_rootdir.startswith('/'):
+ rootdir_item = self.getWarnItem("In embedded mode schemaless values are not supported for hbase.rootdir")
pass
distributed_item = None
@@ -885,13 +895,13 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
for collectorHostName in amsCollectorHosts:
for host in hosts["items"]:
if host["Hosts"]["host_name"] == collectorHostName:
- if op_mode == 'embedded':
+ if op_mode == 'embedded' or is_local_root_dir:
validationItems.extend([{"config-name": 'hbase.rootdir', "item": self.validatorEnoughDiskSpace(properties, 'hbase.rootdir', host["Hosts"], recommendedDiskSpace)}])
validationItems.extend([{"config-name": 'hbase.rootdir', "item": self.validatorNotRootFs(properties, recommendedDefaults, 'hbase.rootdir', host["Hosts"])}])
validationItems.extend([{"config-name": 'hbase.tmp.dir', "item": self.validatorNotRootFs(properties, recommendedDefaults, 'hbase.tmp.dir', host["Hosts"])}])
dn_hosts = self.getComponentHostNames(services, "HDFS", "DATANODE")
- if not hbase_rootdir.startswith("hdfs"):
+ if is_local_root_dir:
mountPoints = []
for mountPoint in host["Hosts"]["disk_info"]:
mountPoints.append(mountPoint["mountpoint"])
http://git-wip-us.apache.org/repos/asf/ambari/blob/6f8b840a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index d79b2ad..6699e94 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -1227,6 +1227,11 @@ class TestHDP206StackAdvisor(TestCase):
'dfs.datanode.data.dir': "/hadoop/data"
}
},
+ "core-site": {
+ "properties": {
+ "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+ }
+ },
"ams-site": {
"properties": {
"timeline.metrics.service.operation.mode": "embedded"