AMBARI-19466. Sqlline-thin is unable to connect to phoenix (echekankiy via dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9388184e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9388184e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9388184e Branch: refs/heads/branch-2.5 Commit: 9388184ebf105d68f2597195a213619f7946fae9 Parents: 98f03b5 Author: Lisnichenko Dmitro <[email protected]> Authored: Thu Jan 12 16:23:22 2017 +0200 Committer: Lisnichenko Dmitro <[email protected]> Committed: Thu Jan 12 16:23:22 2017 +0200 ---------------------------------------------------------------------- .../stacks/HDP/2.0.6/services/stack_advisor.py | 25 ++++++++++++-------- .../stacks/HDP/2.1/services/stack_advisor.py | 2 +- .../stacks/HDP/2.3/services/stack_advisor.py | 2 +- .../stacks/HDP/2.5/services/stack_advisor.py | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9388184e/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 105ffb6..480e73d 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 @@ -200,7 +200,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor): ambari_user = ambari_user.split('@')[0] return ambari_user - def get_data_for_proxyuser(self, user_name, services, groups=False): + def get_data_for_proxyuser(self, user_name, services, configurations, groups=False): """ Returns values of proxyuser properties for given user. Properties can be hadoop.proxyuser.username.groups or hadoop.proxyuser.username.hosts @@ -222,11 +222,16 @@ class HDP206StackAdvisor(DefaultStackAdvisor): if property_value == "*": return True, set() else: - return False, set(property_value.split(",")) + result_values = set() + if "core-site" in configurations: + if property_name in configurations["core-site"]['properties']: + result_values = result_values.union(configurations["core-site"]['properties'][property_name].split(",")) + result_values = result_values.union(property_value.split(",")) + return False, result_values return False, set() - def put_proxyuser_value(self, user_name, value, is_groups=False, services=None, put_function=None): - is_wildcard_value, current_value = self.get_data_for_proxyuser(user_name, services, is_groups) + def put_proxyuser_value(self, user_name, value, is_groups=False, services=None, configurations=None, put_function=None): + is_wildcard_value, current_value = self.get_data_for_proxyuser(user_name, services, configurations, is_groups) result_value = "*" result_values_set = self.merge_proxyusers_values(current_value, value) if len(result_values_set) > 0: @@ -251,13 +256,13 @@ class HDP206StackAdvisor(DefaultStackAdvisor): append(second) return result - def recommendAmbariProxyUsersForHDFS(self, services, servicesList, putCoreSiteProperty, putCoreSitePropertyAttribute): + def recommendAmbariProxyUsersForHDFS(self, services, configurations, servicesList, putCoreSiteProperty, putCoreSitePropertyAttribute): if "HDFS" in servicesList: ambari_user = self.getAmbariUser(services) ambariHostName = socket.getfqdn() - self.put_proxyuser_value(ambari_user,ambariHostName,services=services,put_function=putCoreSiteProperty) - self.put_proxyuser_value(ambari_user, "*", is_groups=True, services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value(ambari_user,ambariHostName,services=services, configurations=configurations, put_function=putCoreSiteProperty) + self.put_proxyuser_value(ambari_user, "*", is_groups=True, services=services, configurations=configurations, put_function=putCoreSiteProperty) old_ambari_user = self.getOldAmbariUser(services) if old_ambari_user is not None: @@ -364,10 +369,10 @@ class HDP206StackAdvisor(DefaultStackAdvisor): if "propertyHosts" in user_properties: services["forced-configurations"].append({"type" : "core-site", "name" : "hadoop.proxyuser.{0}.hosts".format(hive_user)}) # Add properties "hadoop.proxyuser.*.hosts", "hadoop.proxyuser.*.groups" to core-site for all users - self.put_proxyuser_value(user_name, user_properties["propertyHosts"], services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value(user_name, user_properties["propertyHosts"], services=services, configurations=configurations, put_function=putCoreSiteProperty) Logger.info("Updated hadoop.proxyuser.{0}.hosts as : {1}".format(hive_user, user_properties["propertyHosts"])) if "propertyGroups" in user_properties: - self.put_proxyuser_value(user_name, user_properties["propertyGroups"], is_groups=True, services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value(user_name, user_properties["propertyGroups"], is_groups=True, services=services, configurations=configurations, put_function=putCoreSiteProperty) # Remove old properties if user was renamed userOldValue = getOldValue(self, services, user_properties["config"], user_properties["propertyName"]) @@ -381,7 +386,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor): services["forced-configurations"].append({"type" : "core-site", "name" : "hadoop.proxyuser.{0}.groups".format(userOldValue)}) services["forced-configurations"].append({"type" : "core-site", "name" : "hadoop.proxyuser.{0}.groups".format(user_name)}) - self.recommendAmbariProxyUsersForHDFS(services, servicesList, putCoreSiteProperty, putCoreSitePropertyAttribute) + self.recommendAmbariProxyUsersForHDFS(services, configurations, servicesList, putCoreSiteProperty, putCoreSitePropertyAttribute) def recommendHDFSConfigurations(self, configurations, clusterData, services, hosts): putHDFSProperty = self.putProperty(configurations, "hadoop-env", services) http://git-wip-us.apache.org/repos/asf/ambari/blob/9388184e/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 f34f5a1..ad35688 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 @@ -143,7 +143,7 @@ class HDP21StackAdvisor(HDP206StackAdvisor): meta = self.get_service_component_meta("HIVE", "WEBHCAT_SERVER", services) if "hostnames" in meta: - self.put_proxyuser_value("HTTP", meta["hostnames"], services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value("HTTP", meta["hostnames"], services=services, configurations=configurations, put_function=putCoreSiteProperty) def recommendTezConfigurations(self, configurations, clusterData, services, hosts): putTezProperty = self.putProperty(configurations, "tez-site") http://git-wip-us.apache.org/repos/asf/ambari/blob/9388184e/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py index e09ffde..d986f1a 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py @@ -485,7 +485,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor): if kmsEnvProperties and self.checkSiteProperties(kmsEnvProperties, 'kms_user') and 'KERBEROS' in servicesList: kmsUser = kmsEnvProperties['kms_user'] kmsUserOld = getOldValue(self, services, 'kms-env', 'kms_user') - self.put_proxyuser_value(kmsUser, '*', is_groups=True, services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value(kmsUser, '*', is_groups=True, services=services, configurations=configurations, put_function=putCoreSiteProperty) if kmsUserOld is not None and kmsUser != kmsUserOld: putCoreSitePropertyAttribute("hadoop.proxyuser.{0}.groups".format(kmsUserOld), 'delete', 'true') services["forced-configurations"].append({"type" : "core-site", "name" : "hadoop.proxyuser.{0}.groups".format(kmsUserOld)}) http://git-wip-us.apache.org/repos/asf/ambari/blob/9388184e/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py index 45a5351..b08ce75 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py @@ -633,7 +633,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor): # The PQS hosts we want to ensure are set new_value = ','.join(phoenix_query_server_hosts) # Update the proxyuser setting, deferring to out callback to merge results together - self.put_proxyuser_value("HTTP", new_value, services=services, put_function=putCoreSiteProperty) + self.put_proxyuser_value("HTTP", new_value, services=services, configurations=configurations, put_function=putCoreSiteProperty) else: Logger.debug("No phoenix query server hosts to update") else:
