Repository: ambari Updated Branches: refs/heads/branch-2.4 1d8555cdb -> 4370ae9fb
AMBARI-17257. Ambari Server setup of proxyuser should set default values. (magyari_sandor) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4370ae9f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4370ae9f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4370ae9f Branch: refs/heads/branch-2.4 Commit: 4370ae9fbb2742e0bcc81dcf90f64f38ecbdd4c8 Parents: 1d8555c Author: Sandor Magyari <[email protected]> Authored: Thu Jun 16 11:42:39 2016 +0200 Committer: Sandor Magyari <[email protected]> Committed: Mon Jun 20 11:43:35 2016 +0200 ---------------------------------------------------------------------- .../resources/stacks/HDP/2.0.6/services/stack_advisor.py | 11 +++++++---- .../resources/stacks/HDP/2.1/services/stack_advisor.py | 3 ++- .../python/stacks/2.0.6/common/test_stack_advisor.py | 5 +++-- .../test/python/stacks/2.1/common/test_stack_advisor.py | 4 +++- .../test/python/stacks/2.2/common/test_stack_advisor.py | 3 ++- 5 files changed, 17 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4370ae9f/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 4db39ce..dd03a9f 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 @@ -20,6 +20,8 @@ limitations under the License. import re import os import sys +import socket + from math import ceil, floor from resource_management.core.logger import Logger @@ -118,14 +120,14 @@ class HDP206StackAdvisor(DefaultStackAdvisor): servicesList = [service["StackServices"]["service_name"] for service in services["services"]] if "TEZ" in servicesList: ambari_user = self.getAmbariUser(services) - putYarnProperty("yarn.timeline-service.http-authentication.proxyuser.{0}.hosts".format(ambari_user), "*") + ambariHostName = socket.getfqdn() + putYarnProperty("yarn.timeline-service.http-authentication.proxyuser.{0}.hosts".format(ambari_user), ambariHostName) putYarnProperty("yarn.timeline-service.http-authentication.proxyuser.{0}.groups".format(ambari_user), "*") - putYarnProperty("yarn.timeline-service.http-authentication.proxyuser.{0}.users".format(ambari_user), "*") old_ambari_user = self.getOldAmbariUser(services) if old_ambari_user is not None: putYarnPropertyAttribute("yarn.timeline-service.http-authentication.proxyuser.{0}.hosts".format(old_ambari_user), 'delete', 'true') putYarnPropertyAttribute("yarn.timeline-service.http-authentication.proxyuser.{0}.groups".format(old_ambari_user), 'delete', 'true') - putYarnPropertyAttribute("yarn.timeline-service.http-authentication.proxyuser.{0}.users".format(old_ambari_user), 'delete', 'true') + def recommendMapReduce2Configurations(self, configurations, clusterData, services, hosts): putMapredProperty = self.putProperty(configurations, "mapred-site", services) @@ -161,7 +163,8 @@ class HDP206StackAdvisor(DefaultStackAdvisor): def recommendAmbariProxyUsersForHDFS(self, services, servicesList, putCoreSiteProperty, putCoreSitePropertyAttribute): if "HDFS" in servicesList: ambari_user = self.getAmbariUser(services) - putCoreSiteProperty("hadoop.proxyuser.{0}.hosts".format(ambari_user), "*") + ambariHostName = socket.getfqdn() + putCoreSiteProperty("hadoop.proxyuser.{0}.hosts".format(ambari_user), ambariHostName) putCoreSiteProperty("hadoop.proxyuser.{0}.groups".format(ambari_user), "*") old_ambari_user = self.getOldAmbariUser(services) if old_ambari_user is not None: http://git-wip-us.apache.org/repos/asf/ambari/blob/4370ae9f/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py index 84a2476..f63ca86 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/stack_advisor.py @@ -96,8 +96,9 @@ class HDP21StackAdvisor(HDP206StackAdvisor): servicesList = [service["StackServices"]["service_name"] for service in services["services"]] if "PIG" in servicesList: ambari_user = self.getAmbariUser(services) + ambariHostName = socket.getfqdn() webHcatSiteProperty = self.putProperty(configurations, "webhcat-site", services) - webHcatSiteProperty("webhcat.proxyuser.{0}.hosts".format(ambari_user), "*") + webHcatSiteProperty("webhcat.proxyuser.{0}.hosts".format(ambari_user), ambariHostName) webHcatSiteProperty("webhcat.proxyuser.{0}.groups".format(ambari_user), "*") old_ambari_user = self.getOldAmbariUser(services) if old_ambari_user is not None: http://git-wip-us.apache.org/repos/asf/ambari/blob/4370ae9f/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 d0a18fd..eee00de 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 @@ -1121,13 +1121,14 @@ class TestHDP206StackAdvisor(TestCase): clusterData = { "totalAvailableRam": 2048 } + ambariHostName = socket.getfqdn() expected = {'oozie-env': {'properties': {'oozie_user': 'oozie'}}, 'core-site': {'properties': {'hadoop.proxyuser.ambari_user.groups': '*', - 'hadoop.proxyuser.ambari_user.hosts': '*', + 'hadoop.proxyuser.ambari_user.hosts': ambariHostName, 'hadoop.proxyuser.oozie.groups': '*', 'hadoop.proxyuser.hive.groups': '*', 'hadoop.proxyuser.webhcat.hosts': 'c6401.ambari.apache.org,c6402.ambari.apache.org', @@ -1174,7 +1175,7 @@ class TestHDP206StackAdvisor(TestCase): {'oozie_user': 'oozie'}}, 'core-site': {'properties': {'hadoop.proxyuser.ambari_user.groups': '*', - 'hadoop.proxyuser.ambari_user.hosts': '*', + 'hadoop.proxyuser.ambari_user.hosts': ambariHostName, 'hadoop.proxyuser.oozie.groups': '*', 'hadoop.proxyuser.hive.groups': '*', 'hadoop.proxyuser.hdfs1.groups': '*', http://git-wip-us.apache.org/repos/asf/ambari/blob/4370ae9f/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py index f1c93ca..abea76e 100644 --- a/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.1/common/test_stack_advisor.py @@ -18,6 +18,7 @@ limitations under the License. import json import os +import socket from unittest import TestCase class TestHDP21StackAdvisor(TestCase): @@ -374,6 +375,7 @@ class TestHDP21StackAdvisor(TestCase): clusterData = { "totalAvailableRam": 2048 } + ambariHostName = socket.getfqdn() expected = { 'hadoop-env': { 'properties': { @@ -387,7 +389,7 @@ class TestHDP21StackAdvisor(TestCase): "properties": { "hadoop.proxyuser.hdfs.hosts": "*", "hadoop.proxyuser.hdfs.groups": "*", - "hadoop.proxyuser.ambari_user.hosts": "*", + "hadoop.proxyuser.ambari_user.hosts": ambariHostName, "hadoop.proxyuser.ambari_user.groups": "*" } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4370ae9f/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py index b888402..a7e4072 100644 --- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py @@ -2911,6 +2911,7 @@ class TestHDP22StackAdvisor(TestCase): "hbaseRam": 112, "reservedRam": 128 } + ambariHostName = socket.getfqdn() expected = { 'hadoop-env': { 'properties': { @@ -2946,7 +2947,7 @@ class TestHDP22StackAdvisor(TestCase): "properties": { "hadoop.proxyuser.hdfs.hosts": "*", "hadoop.proxyuser.hdfs.groups": "*", - "hadoop.proxyuser.ambari_user.hosts": "*", + "hadoop.proxyuser.ambari_user.hosts": ambariHostName, "hadoop.proxyuser.ambari_user.groups": "*" } }
