Repository: ambari Updated Branches: refs/heads/trunk 46abfca2d -> 2ccf0c7de
AMBARI-5984. Ganglia directory customization failing on trunk on perf cluster (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2ccf0c7d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ccf0c7d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ccf0c7d Branch: refs/heads/trunk Commit: 2ccf0c7de3222169874783893a525886a5ab7cf2 Parents: 46abfca Author: Andrew Onishuk <[email protected]> Authored: Mon Jun 2 17:05:51 2014 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Mon Jun 2 17:05:51 2014 +0300 ---------------------------------------------------------------------- .../services/GANGLIA/package/files/gmetadLib.sh | 2 +- .../GANGLIA/package/scripts/ganglia_server.py | 34 ++++---------------- .../services/GANGLIA/package/scripts/params.py | 1 - .../GANGLIA/package/templates/gangliaEnv.sh.j2 | 1 + .../GANGLIA/package/templates/rrd.py.j2 | 4 +-- .../services/GANGLIA/package/files/gmetadLib.sh | 2 +- .../GANGLIA/package/scripts/ganglia_server.py | 34 ++++---------------- .../services/GANGLIA/package/scripts/params.py | 1 - .../GANGLIA/package/templates/gangliaEnv.sh.j2 | 1 + .../GANGLIA/package/templates/rrd.py.j2 | 4 +-- 10 files changed, 20 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/files/gmetadLib.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/files/gmetadLib.sh b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/files/gmetadLib.sh index e28610e..d8f98b2 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/files/gmetadLib.sh +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/files/gmetadLib.sh @@ -189,7 +189,7 @@ setuid_username "${GMETAD_USER}" #------------------------------------------------------------------------------- # Where gmetad stores its round-robin databases # default: "/var/lib/ganglia/rrds" -# rrd_rootdir "/some/other/place" +rrd_rootdir "${RRD_ROOTDIR}" # #------------------------------------------------------------------------------- # In earlier versions of gmetad, hostnames were handled in a case http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py index c2b647c..1096b14 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/ganglia_server.py @@ -103,34 +103,12 @@ def server_files(): ) rrd_file_owner = params.gmetad_user - if not os.path.exists(params.rrdcached_base_dir) or (os.path.islink(params.rrdcached_default_base_dir) - and params.rrdcached_default_base_dir == params.rrdcached_base_dir): - if os.path.islink(params.rrdcached_default_base_dir): - Link(params.rrdcached_default_base_dir, - action = "delete" - ) - else: - Directory(params.rrdcached_default_base_dir, - action = "delete" - ) - - Directory(params.rrdcached_base_dir, - owner=rrd_file_owner, - group=rrd_file_owner, - mode=0755, - recursive=True - ) - - if params.rrdcached_default_base_dir != params.rrdcached_base_dir: - Link(params.rrdcached_default_base_dir, - to=params.rrdcached_base_dir - ) - elif rrd_file_owner != 'nobody': - Directory(params.rrdcached_default_base_dir, - owner=rrd_file_owner, - group=rrd_file_owner, - recursive=True - ) + Directory(params.rrdcached_base_dir, + owner=rrd_file_owner, + group=rrd_file_owner, + mode=0755, + recursive=True + ) if __name__ == "__main__": http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/params.py index 030181f..24c6a4b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/scripts/params.py @@ -31,7 +31,6 @@ gmetad_user = config['configurations']['global']["gmetad_user"] gmond_user = config['configurations']['global']["gmond_user"] webserver_group = "apache" -rrdcached_default_base_dir = "/var/lib/ganglia/rrds" rrdcached_base_dir = config['configurations']['global']["rrdcached_base_dir"] rrdcached_timeout = default("/configurations/global/rrdcached_timeout", 3600) rrdcached_delay = default("/configurations/global/rrdcached_delay", 1800) http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/gangliaEnv.sh.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/gangliaEnv.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/gangliaEnv.sh.j2 index 9872ac4..0214753 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/gangliaEnv.sh.j2 +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/gangliaEnv.sh.j2 @@ -37,6 +37,7 @@ # */ # Unix users and groups for the binaries we start up. +RRD_ROOTDIR={{rrdcached_base_dir}} GMETAD_USER={{gmetad_user}}; GMOND_USER={{gmond_user}}; WEBSERVER_GROUP={{webserver_group}}; http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/rrd.py.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/rrd.py.j2 b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/rrd.py.j2 index f6d6bd0..c3ea707 100644 --- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/rrd.py.j2 +++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/package/templates/rrd.py.j2 @@ -148,7 +148,7 @@ clusterParts = stripList(clusterParts) if "p" in queryString: rrdPath = queryString["p"] else: - rrdPath = "/var/lib/ganglia/rrds/" + rrdPath = "{{rrdcached_base_dir}}" start = None if "s" in queryString: @@ -184,7 +184,7 @@ def _walk(*args, **kwargs): for cluster in clusterParts: - for path, dirs, files in _walk(rrdPath + cluster): + for path, dirs, files in _walk(os.path.join(rrdPath,cluster)): pathParts = path.split("/") #Process only path which contains files. If no host parameter passed - process all hosts folders and summary info #If host parameter passed - process only this host folder http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/files/gmetadLib.sh ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/files/gmetadLib.sh b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/files/gmetadLib.sh index 30a629b..6a24bed 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/files/gmetadLib.sh +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/files/gmetadLib.sh @@ -189,7 +189,7 @@ setuid_username "${GMETAD_USER}" #------------------------------------------------------------------------------- # Where gmetad stores its round-robin databases # default: "/var/lib/ganglia/rrds" -# rrd_rootdir "/some/other/place" +rrd_rootdir "${RRD_ROOTDIR}" # #------------------------------------------------------------------------------- # In earlier versions of gmetad, hostnames were handled in a case http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py index 5e86dbf..6a0693b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py @@ -103,34 +103,12 @@ def server_files(): ) rrd_file_owner = params.gmetad_user - if not os.path.exists(params.rrdcached_base_dir) or (os.path.islink(params.rrdcached_default_base_dir) - and params.rrdcached_default_base_dir == params.rrdcached_base_dir): - if os.path.islink(params.rrdcached_default_base_dir): - Link(params.rrdcached_default_base_dir, - action = "delete" - ) - else: - Directory(params.rrdcached_default_base_dir, - action = "delete" - ) - - Directory(params.rrdcached_base_dir, - owner=rrd_file_owner, - group=rrd_file_owner, - mode=0755, - recursive=True - ) - - if params.rrdcached_default_base_dir != params.rrdcached_base_dir: - Link(params.rrdcached_default_base_dir, - to=params.rrdcached_base_dir - ) - elif rrd_file_owner != 'nobody': - Directory(params.rrdcached_default_base_dir, - owner=rrd_file_owner, - group=rrd_file_owner, - recursive=True - ) + Directory(params.rrdcached_base_dir, + owner=rrd_file_owner, + group=rrd_file_owner, + mode=0755, + recursive=True + ) if __name__ == "__main__": http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py index aae06e9..e269b78 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py @@ -37,7 +37,6 @@ gmond_allowed_apps = ["Application1", "Application2", "Application3"] gmond_apps = set(gmond_apps) & set(gmond_allowed_apps) webserver_group = "apache" -rrdcached_default_base_dir = "/var/lib/ganglia/rrds" rrdcached_base_dir = config['configurations']['global']["rrdcached_base_dir"] rrdcached_timeout = default("/configurations/global/rrdcached_timeout", 3600) rrdcached_delay = default("/configurations/global/rrdcached_delay", 1800) http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/gangliaEnv.sh.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/gangliaEnv.sh.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/gangliaEnv.sh.j2 index f7142af..2a80234 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/gangliaEnv.sh.j2 +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/gangliaEnv.sh.j2 @@ -38,6 +38,7 @@ # */ # Unix users and groups for the binaries we start up. +RRD_ROOTDIR={{rrdcached_base_dir}} GMETAD_USER={{gmetad_user}}; GMOND_USER={{gmond_user}}; WEBSERVER_GROUP={{webserver_group}}; http://git-wip-us.apache.org/repos/asf/ambari/blob/2ccf0c7d/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2 ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2 b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2 index f6d6bd0..c3ea707 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2 +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2 @@ -148,7 +148,7 @@ clusterParts = stripList(clusterParts) if "p" in queryString: rrdPath = queryString["p"] else: - rrdPath = "/var/lib/ganglia/rrds/" + rrdPath = "{{rrdcached_base_dir}}" start = None if "s" in queryString: @@ -184,7 +184,7 @@ def _walk(*args, **kwargs): for cluster in clusterParts: - for path, dirs, files in _walk(rrdPath + cluster): + for path, dirs, files in _walk(os.path.join(rrdPath,cluster)): pathParts = path.split("/") #Process only path which contains files. If no host parameter passed - process all hosts folders and summary info #If host parameter passed - process only this host folder
