Repository: ambari Updated Branches: refs/heads/branch-2.1 88a40af3d -> 87847c35d
AMBARI-12847 Delete Znode on Metrics Collector restart (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/87847c35 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/87847c35 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/87847c35 Branch: refs/heads/branch-2.1 Commit: 87847c35da07e3cb92703db8111cdda0e7b18ea8 Parents: 88a40af Author: Dmytro Sen <d...@apache.org> Authored: Fri Aug 21 17:24:58 2015 +0300 Committer: Dmytro Sen <d...@apache.org> Committed: Fri Aug 21 17:26:59 2015 +0300 ---------------------------------------------------------------------- .../AMBARI_METRICS/0.1.0/package/scripts/ams_service.py | 5 ++--- .../AMBARI_METRICS/0.1.0/package/scripts/params.py | 2 ++ .../stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py | 8 +++++--- .../src/test/python/stacks/2.0.6/configs/default.json | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/87847c35/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py index 2887e7c..0174aa2 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py @@ -50,9 +50,8 @@ def ams_service(name, action): cmd = format("{cmd} --distributed") if action == 'start': - if not params.hbase_tmp_dir.startswith('hdfs'): - Execute(format('{sudo} rm -f {hbase_tmp_dir}/*.tmp') - ) + Execute(format('{sudo} rm -rf {hbase_tmp_dir}/*.tmp {zookeeper_data_dir}/*') + ) daemon_cmd = format("{cmd} start") Execute(daemon_cmd, http://git-wip-us.apache.org/repos/asf/ambari/blob/87847c35/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py index 25e5066..245802c 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py @@ -118,6 +118,8 @@ ams_checkpoint_dir = config['configurations']['ams-site']['timeline.metrics.aggr hbase_pid_dir = status_params.hbase_pid_dir _hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir'] hbase_tmp_dir = substitute_vars(_hbase_tmp_dir, config['configurations']['ams-hbase-site']) +_zookeeper_data_dir = config['configurations']['ams-hbase-site']['hbase.zookeeper.property.dataDir'] +zookeeper_data_dir = substitute_vars(_zookeeper_data_dir, config['configurations']['ams-hbase-site']) # TODO UPGRADE default, update site during upgrade _local_dir_conf = default('/configurations/ams-hbase-site/hbase.local.dir', "${hbase.tmp.dir}/local") local_dir = substitute_vars(_local_dir_conf, config['configurations']['ams-hbase-site']) http://git-wip-us.apache.org/repos/asf/ambari/blob/87847c35/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py index e383f9c..34135ff 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py +++ b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_collector.py @@ -50,6 +50,8 @@ class TestOozieClient(RMFTestCase): not_if = 'ls /var/run/ambari-metrics-collector//hbase-ams-regionserver.pid >/dev/null 2>&1 && ps `cat /var/run/ambari-metrics-collector//hbase-ams-regionserver.pid` >/dev/null 2>&1', user = 'ams' ) + self.assertResourceCalled('Execute', 'ambari-sudo.sh rm -rf /var/lib/ambari-metrics-collector/hbase-tmp/*.tmp /var/lib/ambari-metrics-collector/hbase-tmp/zookeeper/*', + ) self.assertResourceCalled('Execute', '/usr/sbin/ambari-metrics-collector --config /etc/ambari-metrics-collector/conf --distributed start', user = 'ams' ) @@ -162,12 +164,12 @@ class TestOozieClient(RMFTestCase): group = 'hadoop', recursive = True ) - self.assertResourceCalled('Directory', 'hdfs://localhost:8020/apps/hbase/data/tmp', + self.assertResourceCalled('Directory', '/var/lib/ambari-metrics-collector/hbase-tmp', owner = 'ams', cd_access = 'a', recursive = True ) - self.assertResourceCalled('Directory', 'hdfs://localhost:8020/apps/hbase/data/tmp/local/jars', + self.assertResourceCalled('Directory', '/var/lib/ambari-metrics-collector/hbase-tmp/local/jars', owner = 'ams', cd_access = 'a', group = 'hadoop', @@ -181,7 +183,7 @@ class TestOozieClient(RMFTestCase): configurations = self.getConfig()['configurations']['ams-hbase-site'], configuration_attributes = self.getConfig()['configuration_attributes']['ams-hbase-site'] ) - self.assertResourceCalled('Directory', 'hdfs://localhost:8020/apps/hbase/data/tmp/phoenix-spool', + self.assertResourceCalled('Directory', '/var/lib/ambari-metrics-collector/hbase-tmp/phoenix-spool', owner = 'ams', cd_access = 'a', group = 'hadoop', http://git-wip-us.apache.org/repos/asf/ambari/blob/87847c35/ambari-server/src/test/python/stacks/2.0.6/configs/default.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json index 12cc74d..b45758c 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json @@ -771,7 +771,7 @@ "hbase_master_xmn_size": "128m", "phoenix.query.spoolThresholdBytes": "12582912", "zookeeper.session.timeout": "120000", - "hbase.tmp.dir": "hdfs://localhost:8020/apps/hbase/data/tmp", + "hbase.tmp.dir": "/var/lib/ambari-metrics-collector/hbase-tmp", "hfile.block.cache.size": "0.3", "hbase.regionserver.port": "61320", "hbase.regionserver.thread.compaction.small": "3",