You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2016/06/20 09:42:56 UTC

ambari git commit: AMBARI-17257. Ambari Server setup of proxyuser should set default values. (magyari_sandor)

Repository: ambari
Updated Branches:
  refs/heads/trunk 33725d7eb -> 5dc6f640f


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/5dc6f640
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5dc6f640
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5dc6f640

Branch: refs/heads/trunk
Commit: 5dc6f640f87c98bef9db71caac61f7da038f9cff
Parents: 33725d7
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Thu Jun 16 11:42:39 2016 +0200
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Mon Jun 20 11:42:11 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/5dc6f640/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/5dc6f640/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/5dc6f640/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/5dc6f640/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/5dc6f640/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 5ac9074..c6220bc 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": "*"
         }
       }