ambari git commit: AMBARI-14959: Implement service check for secured PXF service (lavjain via jaoki)
Repository: ambari Updated Branches: refs/heads/branch-2.2 529818a19 -> e191a4fe4 AMBARI-14959: Implement service check for secured PXF service (lavjain via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e191a4fe Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e191a4fe Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e191a4fe Branch: refs/heads/branch-2.2 Commit: e191a4fe468c65a5596da8347b28a434088cc92a Parents: 529818a Author: Jun Aoki Authored: Tue Feb 9 15:34:23 2016 -0800 Committer: Jun Aoki Committed: Tue Feb 9 15:34:23 2016 -0800 -- .../PXF/3.0.0/package/scripts/params.py | 17 +++- .../PXF/3.0.0/package/scripts/service_check.py | 81 +++- 2 files changed, 76 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e191a4fe/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py -- diff --git a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py index 7749de7..b3e85e4 100644 --- a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py @@ -22,6 +22,7 @@ from resource_management import Script from resource_management.libraries.functions.default import default from resource_management.libraries.functions import get_kinit_path from resource_management.libraries.resources.hdfs_resource import HdfsResource +from resource_management.libraries.functions.namenode_ha_utils import get_active_namenode config = Script.get_config() @@ -31,9 +32,10 @@ stack_name = str(config["hostLevelParams"]["stack_name"]) # Users and Groups pxf_user = "pxf" pxf_group = pxf_user -hdfs_superuser = config['configurations']['hadoop-env']['hdfs_user'] +hdfs_user = config['configurations']['hadoop-env']['hdfs_user'] hdfs_superuser_group = config["configurations"]["hdfs-site"]["dfs.permissions.superusergroup"] user_group = config["configurations"]["cluster-env"]["user_group"] +hbase_user = default('configurations/hbase-env/hbase_user', None) hive_user = default('configurations/hive-env/hive_user', None) tomcat_group = "tomcat" @@ -60,14 +62,21 @@ is_hive_installed = default("/clusterHostInfo/hive_server_host", None) is not No # HDFS hdfs_site = config['configurations']['hdfs-site'] default_fs = config['configurations']['core-site']['fs.defaultFS'] +namenode_path = default('/configurations/hdfs-site/dfs.namenode.http-address', None) +dfs_nameservice = default('/configurations/hdfs-site/dfs.nameservices', None) +if dfs_nameservice: + namenode_path = get_active_namenode(hdfs_site, security_enabled, hdfs_user)[1] -hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] +# keytabs and principals kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) -hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] +hdfs_user_keytab = default('configurations/hadoop-env/hdfs_user_keytab', None) +hdfs_principal_name = default('configurations/hadoop-env/hdfs_principal_name', None) +hbase_user_keytab = default('configurations/hbase-env/hbase_user_keytab', None) +hbase_principal_name = default('configurations/hbase-env/hbase_principal_name', None) # HDFSResource partial function HdfsResource = functools.partial(HdfsResource, -user=hdfs_superuser, +user=hdfs_user, security_enabled=security_enabled, keytab=hdfs_user_keytab, kinit_path_local=kinit_path_local, http://git-wip-us.apache.org/repos/asf/ambari/blob/e191a4fe/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py -- diff --git a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py index 064be04..21b7c5d 100644 --- a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py @@ -15,15 +15,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import json + from resource_management.libraries.script import Script from resource_management.core.exceptions import Fail from resource_management.core.logger import Lo
ambari git commit: AMBARI-14959: Implement service check for secured PXF service (lavjain via jaoki)
Repository: ambari Updated Branches: refs/heads/trunk 73fbe14c2 -> feb50e3a3 AMBARI-14959: Implement service check for secured PXF service (lavjain via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/feb50e3a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/feb50e3a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/feb50e3a Branch: refs/heads/trunk Commit: feb50e3a3f5edb1105780d06254bb9538d19063e Parents: 73fbe14 Author: Jun Aoki Authored: Tue Feb 9 15:33:08 2016 -0800 Committer: Jun Aoki Committed: Tue Feb 9 15:33:08 2016 -0800 -- .../PXF/3.0.0/package/scripts/params.py | 17 +++- .../PXF/3.0.0/package/scripts/service_check.py | 81 +++- 2 files changed, 76 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/feb50e3a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py -- diff --git a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py index 7749de7..b3e85e4 100644 --- a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py @@ -22,6 +22,7 @@ from resource_management import Script from resource_management.libraries.functions.default import default from resource_management.libraries.functions import get_kinit_path from resource_management.libraries.resources.hdfs_resource import HdfsResource +from resource_management.libraries.functions.namenode_ha_utils import get_active_namenode config = Script.get_config() @@ -31,9 +32,10 @@ stack_name = str(config["hostLevelParams"]["stack_name"]) # Users and Groups pxf_user = "pxf" pxf_group = pxf_user -hdfs_superuser = config['configurations']['hadoop-env']['hdfs_user'] +hdfs_user = config['configurations']['hadoop-env']['hdfs_user'] hdfs_superuser_group = config["configurations"]["hdfs-site"]["dfs.permissions.superusergroup"] user_group = config["configurations"]["cluster-env"]["user_group"] +hbase_user = default('configurations/hbase-env/hbase_user', None) hive_user = default('configurations/hive-env/hive_user', None) tomcat_group = "tomcat" @@ -60,14 +62,21 @@ is_hive_installed = default("/clusterHostInfo/hive_server_host", None) is not No # HDFS hdfs_site = config['configurations']['hdfs-site'] default_fs = config['configurations']['core-site']['fs.defaultFS'] +namenode_path = default('/configurations/hdfs-site/dfs.namenode.http-address', None) +dfs_nameservice = default('/configurations/hdfs-site/dfs.nameservices', None) +if dfs_nameservice: + namenode_path = get_active_namenode(hdfs_site, security_enabled, hdfs_user)[1] -hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] +# keytabs and principals kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) -hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] +hdfs_user_keytab = default('configurations/hadoop-env/hdfs_user_keytab', None) +hdfs_principal_name = default('configurations/hadoop-env/hdfs_principal_name', None) +hbase_user_keytab = default('configurations/hbase-env/hbase_user_keytab', None) +hbase_principal_name = default('configurations/hbase-env/hbase_principal_name', None) # HDFSResource partial function HdfsResource = functools.partial(HdfsResource, -user=hdfs_superuser, +user=hdfs_user, security_enabled=security_enabled, keytab=hdfs_user_keytab, kinit_path_local=kinit_path_local, http://git-wip-us.apache.org/repos/asf/ambari/blob/feb50e3a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py -- diff --git a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py index 064be04..21b7c5d 100644 --- a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/service_check.py @@ -15,15 +15,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ +import json + from resource_management.libraries.script import Script from resource_management.core.exceptions import Fail from resource_management.core.logger import Logger from
ambari git commit: AMBARI-14965: Ambari server lists service even though service creation fails (Ajit Kumar via jluniya)
Repository: ambari Updated Branches: refs/heads/trunk 37122a6d3 -> 73fbe14c2 AMBARI-14965: Ambari server lists service even though service creation fails (Ajit Kumar via jluniya) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/73fbe14c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/73fbe14c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/73fbe14c Branch: refs/heads/trunk Commit: 73fbe14c2a14619a5023ea0698cda72858c05fbe Parents: 37122a6 Author: Jayush Luniya Authored: Tue Feb 9 15:08:42 2016 -0800 Committer: Jayush Luniya Committed: Tue Feb 9 15:08:42 2016 -0800 -- .../internal/ServiceResourceProvider.java | 197 +-- 1 file changed, 88 insertions(+), 109 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/73fbe14c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java index a2aca70..ed7659f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java @@ -64,6 +64,8 @@ import org.apache.ambari.server.state.ServiceFactory; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.State; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -148,7 +150,7 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider ResourceAlreadyExistsException, NoSuchParentResourceException { -final Set requests = new HashSet(); +final Set requests = new HashSet<>(); for (Map propertyMap : request.getProperties()) { requests.add(getRequest(propertyMap)); } @@ -338,115 +340,11 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider LOG.warn("Received an empty requests set"); return; } - -Clusters clusters = getManagementController().getClusters(); -AmbariMetaInfo ambariMetaInfo = getManagementController().getAmbariMetaInfo(); - +Clusters clusters = getManagementController().getClusters(); // do all validation checks -Map> serviceNames = new HashMap>(); -Set duplicates = new HashSet(); -for (ServiceRequest request : requests) { - if (request.getClusterName() == null - || request.getClusterName().isEmpty() - || request.getServiceName() == null - || request.getServiceName().isEmpty()) { -throw new IllegalArgumentException("Cluster name and service name" -+ " should be provided when creating a service"); - } - - if (LOG.isDebugEnabled()) { -LOG.debug("Received a createService request" -+ ", clusterName=" + request.getClusterName() -+ ", serviceName=" + request.getServiceName() -+ ", request=" + request); - } - - if(!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, getClusterResourceId(request.getClusterName()), RoleAuthorization.SERVICE_ADD_DELETE_SERVICES)) { -throw new AuthorizationException("The user is not authorized to create services"); - } - - if (!serviceNames.containsKey(request.getClusterName())) { -serviceNames.put(request.getClusterName(), new HashSet()); - } - if (serviceNames.get(request.getClusterName()) - .contains(request.getServiceName())) { -// throw error later for dup -duplicates.add(request.getServiceName()); -continue; - } - serviceNames.get(request.getClusterName()).add(request.getServiceName()); - - if (request.getDesiredState() != null - && !request.getDesiredState().isEmpty()) { -State state = State.valueOf(request.getDesiredState()); -if (!state.isValidDesiredState() -|| state != State.INIT) { - throw new IllegalArgumentException("Invalid desired state" - + " only INIT state allowed during creation" - + ", providedDesiredState=" + request.getDesiredState()); -} - } - - Cluster cluster; - try { -cluster = clusters.getCluster(request.getClusterName()); - } catch (ClusterNotFoundException e) { -throw new ParentObjectNotFoundException("Attempted to add a service to a cluster which doesn't exist", e); -
ambari git commit: AMBARI-14972 - Add PK to servicecomponentdesiredstate Table To Support FK Relationships (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/branch-dev-patch-upgrade d3db8dadd -> 697c309c1 AMBARI-14972 - Add PK to servicecomponentdesiredstate Table To Support FK Relationships (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/697c309c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/697c309c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/697c309c Branch: refs/heads/branch-dev-patch-upgrade Commit: 697c309c19e04949f1bb9a746f5a5d1e87fb3e39 Parents: d3db8da Author: Jonathan Hurley Authored: Tue Feb 9 09:37:18 2016 -0500 Committer: Jonathan Hurley Committed: Tue Feb 9 09:37:18 2016 -0500 -- .../dao/ServiceComponentDesiredStateDAO.java| 57 +++-- .../HostComponentDesiredStateEntity.java| 2 +- .../orm/entities/HostComponentStateEntity.java | 1 - .../ServiceComponentDesiredStateEntity.java | 47 +-- .../ServiceComponentDesiredStateEntityPK.java | 84 --- .../server/state/ServiceComponentImpl.java | 59 +- .../svccomphost/ServiceComponentHostImpl.java | 17 ++-- .../server/upgrade/UpgradeCatalog150.java | 18 +--- .../server/upgrade/UpgradeCatalog170.java | 9 +- .../server/upgrade/UpgradeCatalog200.java | 8 +- .../server/upgrade/UpgradeCatalog210.java | 69 .../main/resources/Ambari-DDL-Derby-CREATE.sql | 10 ++- .../main/resources/Ambari-DDL-MySQL-CREATE.sql | 6 +- .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 7 +- .../resources/Ambari-DDL-Postgres-CREATE.sql| 11 ++- .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 10 ++- .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 7 +- .../resources/Ambari-DDL-SQLServer-CREATE.sql | 12 ++- .../server/state/ServiceComponentTest.java | 11 +-- .../server/upgrade/UpgradeCatalog170Test.java | 9 +- .../server/upgrade/UpgradeCatalog200Test.java | 9 +- .../server/upgrade/UpgradeCatalog210Test.java | 86 ++-- .../server/upgrade/UpgradeCatalogHelper.java| 5 +- 23 files changed, 270 insertions(+), 284 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/697c309c/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java index 341d1fd..b8c2fcc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java @@ -26,7 +26,6 @@ import javax.persistence.TypedQuery; import org.apache.ambari.server.orm.RequiresSession; import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity; -import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntityPK; import com.google.inject.Inject; import com.google.inject.Provider; @@ -38,9 +37,22 @@ public class ServiceComponentDesiredStateDAO { @Inject Provider entityManagerProvider; + /** + * DAO utilities for dealing mostly with {@link TypedQuery} results. + */ + @Inject + private DaoUtils daoUtils; + + /** + * Gets a {@link ServiceComponentDesiredStateEntity} by its PK ID. + * + * @param id + * the ID. + * @return the entity or {@code null} if it does not exist. + */ @RequiresSession - public ServiceComponentDesiredStateEntity findByPK(ServiceComponentDesiredStateEntityPK primaryKey) { -return entityManagerProvider.get().find(ServiceComponentDesiredStateEntity.class, primaryKey); + public ServiceComponentDesiredStateEntity findById(long id) { +return entityManagerProvider.get().find(ServiceComponentDesiredStateEntity.class, id); } @RequiresSession @@ -55,6 +67,37 @@ public class ServiceComponentDesiredStateDAO { return null; } + /** + * Finds a {@link ServiceComponentDesiredStateEntity} by a combination of + * cluster, service, and component. + * + * @param clusterId + * the cluster ID + * @param serviceName + * the service name (not {@code null}) + * @param componentName + * the component name (not {@code null}) + */ + @RequiresSession + public ServiceComponentDesiredStateEntity findByName(long clusterId, String serviceName, + String componentName) { +EntityManager entityManager = entityManagerProvider.get(); +TypedQuery query = entityManager.createNamedQuery( +"ServiceComponentDesiredStateEntity.findByName", ServiceComponentDesiredStateEntity.class);
ambari git commit: AMBARI-14962 : Auto configure AMS UI to use AMS Datasource - Commit 2 (avijayan)
Repository: ambari Updated Branches: refs/heads/trunk 14396f2b7 -> 37122a6d3 AMBARI-14962 : Auto configure AMS UI to use AMS Datasource - Commit 2 (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/37122a6d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37122a6d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37122a6d Branch: refs/heads/trunk Commit: 37122a6d3aa7f5b5cb48c85a420be1c389010951 Parents: 14396f2 Author: Aravindan Vijayan Authored: Tue Feb 9 11:09:26 2016 -0800 Committer: Aravindan Vijayan Committed: Tue Feb 9 11:09:26 2016 -0800 -- .../templates/metrics_grafana_datasource.json.j2 | 18 ++ 1 file changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/37122a6d/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 index 3edc6fb..1b03a2d 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 @@ -1,3 +1,21 @@ +{# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + { "name": "{{ams_datasource_name}}", "type": "ambarimetrics",
ambari git commit: AMBARI-14962 : Auto configure AMS UI to use AMS Datasource - Commit 2 (avijayan)
Repository: ambari Updated Branches: refs/heads/branch-2.2 d142d888f -> 529818a19 AMBARI-14962 : Auto configure AMS UI to use AMS Datasource - Commit 2 (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/529818a1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/529818a1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/529818a1 Branch: refs/heads/branch-2.2 Commit: 529818a198c5c1bf3cbc0a3b6015d3f285ea7403 Parents: d142d88 Author: Aravindan Vijayan Authored: Tue Feb 9 11:14:09 2016 -0800 Committer: Aravindan Vijayan Committed: Tue Feb 9 11:14:09 2016 -0800 -- .../templates/metrics_grafana_datasource.json.j2 | 18 ++ 1 file changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/529818a1/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 index 3edc6fb..1b03a2d 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2 @@ -1,3 +1,21 @@ +{# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#} + { "name": "{{ams_datasource_name}}", "type": "ambarimetrics",
ambari git commit: AMBARI-14962 Auto configure AMS UI to use AMS Datasource (avijayan)
Repository: ambari Updated Branches: refs/heads/branch-2.2 43e9da158 -> d142d888f AMBARI-14962 Auto configure AMS UI to use AMS Datasource (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d142d888 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d142d888 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d142d888 Branch: refs/heads/branch-2.2 Commit: d142d888f9f3c52d125806d0fa90596ab9553ae5 Parents: 43e9da1 Author: Aravindan Vijayan Authored: Tue Feb 9 08:22:03 2016 -0800 Committer: Aravindan Vijayan Committed: Tue Feb 9 08:22:03 2016 -0800 -- .../0.1.0/package/scripts/metrics_grafana.py| 2 + .../package/scripts/metrics_grafana_util.py | 131 +++ .../metrics_grafana_datasource.json.j2 | 15 +++ .../AMBARI_METRICS/test_metrics_grafana.py | 19 ++- 4 files changed, 163 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d142d888/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py index f876036..d96309c 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py @@ -22,6 +22,7 @@ from resource_management import Script, Execute from resource_management.libraries.functions import format from status import check_service_status from ams import ams +from metrics_grafana_util import create_ams_datasource class AmsGrafana(Script): def install(self, env): @@ -46,6 +47,7 @@ class AmsGrafana(Script): Execute(start_cmd, user=params.ams_user ) +create_ams_datasource() def stop(self, env): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/d142d888/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py new file mode 100644 index 000..c4a91e1 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" +from resource_management.core.logger import Logger +from resource_management.core.base import Fail +from resource_management import Template + +import httplib +import time +import socket +import json + +def create_ams_datasource(): + + import params + GRAFANA_CONNECT_TRIES = 5 + GRAFANA_CONNECT_TIMEOUT = 15 + GRAFANA_URL = "/api/datasources" + METRICS_GRAFANA_DATASOURCE_NAME = "AMBARI_METRICS" + + headers = {"Content-type": "application/json"} + + Logger.info("Checking if AMS Grafana datasource already exists") + Logger.info("Connecting (GET) to %s:%s%s" % (params.hostname, + params.ams_grafana_port, + GRAFANA_URL)) + + conn = httplib.HTTPConnection(params.hostname, +int(params.ams_grafana_port)) + + conn.request("GET", GRAFANA_URL) + response = conn.getresponse() + Logger.info("Http response: %s %s" % (response.status, response.reason)) + + if(response.status == 200): +datasources = response.read() +datasources_json = json.loads(datasources) +for i in xrange(0, len(datasources_json)): + datasource_name = datasources_json[i]["name"] +
ambari git commit: AMBARI-14962 : Auto configure AMS UI to use AMS Datasource (avijayan)
Repository: ambari Updated Branches: refs/heads/trunk 38a52256e -> 14396f2b7 AMBARI-14962 : Auto configure AMS UI to use AMS Datasource (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/14396f2b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/14396f2b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/14396f2b Branch: refs/heads/trunk Commit: 14396f2b74115744d6f4c93b97a9911cd1e58ff1 Parents: 38a5225 Author: Aravindan Vijayan Authored: Mon Feb 8 13:22:15 2016 -0800 Committer: Aravindan Vijayan Committed: Tue Feb 9 08:18:51 2016 -0800 -- .../0.1.0/package/scripts/metrics_grafana.py| 2 + .../package/scripts/metrics_grafana_util.py | 131 +++ .../metrics_grafana_datasource.json.j2 | 15 +++ .../AMBARI_METRICS/test_metrics_grafana.py | 19 ++- 4 files changed, 163 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/14396f2b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py index f876036..d96309c 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py @@ -22,6 +22,7 @@ from resource_management import Script, Execute from resource_management.libraries.functions import format from status import check_service_status from ams import ams +from metrics_grafana_util import create_ams_datasource class AmsGrafana(Script): def install(self, env): @@ -46,6 +47,7 @@ class AmsGrafana(Script): Execute(start_cmd, user=params.ams_user ) +create_ams_datasource() def stop(self, env): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/14396f2b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py new file mode 100644 index 000..c4a91e1 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +""" +from resource_management.core.logger import Logger +from resource_management.core.base import Fail +from resource_management import Template + +import httplib +import time +import socket +import json + +def create_ams_datasource(): + + import params + GRAFANA_CONNECT_TRIES = 5 + GRAFANA_CONNECT_TIMEOUT = 15 + GRAFANA_URL = "/api/datasources" + METRICS_GRAFANA_DATASOURCE_NAME = "AMBARI_METRICS" + + headers = {"Content-type": "application/json"} + + Logger.info("Checking if AMS Grafana datasource already exists") + Logger.info("Connecting (GET) to %s:%s%s" % (params.hostname, + params.ams_grafana_port, + GRAFANA_URL)) + + conn = httplib.HTTPConnection(params.hostname, +int(params.ams_grafana_port)) + + conn.request("GET", GRAFANA_URL) + response = conn.getresponse() + Logger.info("Http response: %s %s" % (response.status, response.reason)) + + if(response.status == 200): +datasources = response.read() +datasources_json = json.loads(datasources) +for i in xrange(0, len(datasources_json)): + datasource_name = datasources_json[i]["name"] + if(datas
ambari git commit: AMBARI-14974 Ambari maven builds fail on trunk (dsen)
Repository: ambari Updated Branches: refs/heads/trunk 400d49548 -> 38a52256e AMBARI-14974 Ambari maven builds fail on trunk (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/38a52256 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/38a52256 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/38a52256 Branch: refs/heads/trunk Commit: 38a52256e0d421fe52beef4e4860b99676b5 Parents: 400d495 Author: Dmytro Sen Authored: Tue Feb 9 18:03:29 2016 +0200 Committer: Dmytro Sen Committed: Tue Feb 9 18:03:29 2016 +0200 -- ambari-metrics/ambari-metrics-assembly/pom.xml | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/38a52256/ambari-metrics/ambari-metrics-assembly/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml b/ambari-metrics/ambari-metrics-assembly/pom.xml index 130097d..941c3aa 100644 --- a/ambari-metrics/ambari-metrics-assembly/pom.xml +++ b/ambari-metrics/ambari-metrics-assembly/pom.xml @@ -89,7 +89,7 @@ collector -package +prepare-package single @@ -105,7 +105,7 @@ monitor -package +prepare-package single @@ -121,7 +121,7 @@ grafana -package +prepare-package single @@ -137,7 +137,7 @@ hadoop-sink -package +prepare-package single @@ -175,7 +175,7 @@ copy-resources -prepare-package +package copy-resources @@ -611,7 +611,7 @@ copy-resources -prepare-package +package copy-resources
ambari git commit: AMBARI-14971 UI - lag in Create Versions page doesn't show confirmation. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk ef1b98b3c -> 400d49548 AMBARI-14971 UI - lag in Create Versions page doesn't show confirmation. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/400d4954 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/400d4954 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/400d4954 Branch: refs/heads/trunk Commit: 400d49548755a8c50760dd1bfcba81dacaba79f6 Parents: ef1b98b Author: ababiichuk Authored: Tue Feb 9 15:37:20 2016 +0200 Committer: ababiichuk Committed: Tue Feb 9 17:46:47 2016 +0200 -- .../scripts/controllers/stackVersions/StackVersionsCreateCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/400d4954/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js index fc4bee9..532e5f4 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js +++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js @@ -60,7 +60,7 @@ angular.module('ambariAdminConsole') .success(function () { var versionName = $scope.upgradeStack.selected.stack_version + '.' + $scope.repoSubversion; var stackName = $scope.upgradeStack.selected.stack_name; -Alert.success($t('versions.alerts.versionCreated'), {stackName: stackName, versionName: versionName}); +Alert.success($t('versions.alerts.versionCreated', {stackName: stackName, versionName: versionName})); $location.path('/stackVersions'); }) .error(function (data) {
[1/2] ambari git commit: AMBARI-14973. ambari-agent upstart script restart triggers the restart of hbase specific JVM processes (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.2 9e425d774 -> 43e9da158 refs/heads/trunk 429450010 -> ef1b98b3c AMBARI-14973. ambari-agent upstart script restart triggers the restart of hbase specific JVM processes (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef1b98b3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef1b98b3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef1b98b3 Branch: refs/heads/trunk Commit: ef1b98b3c77a5b4ebafbd5cc9c720ad9f13b63e8 Parents: 4294500 Author: Andrew Onishuk Authored: Tue Feb 9 17:40:11 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 17:40:11 2016 +0200 -- ambari-agent/src/main/python/ambari_agent/PythonExecutor.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ef1b98b3/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py index 0d431bc..d75fc0c 100644 --- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py +++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py @@ -166,6 +166,9 @@ class PythonExecutor(object): else: structured_out = {} return out, error, structured_out + + def preexec_fn(self): +os.setpgid(0, 0) def launch_python_subprocess(self, command, tmpout, tmperr): """ @@ -181,7 +184,7 @@ class PythonExecutor(object): return subprocess.Popen(command, stdout=tmpout, - stderr=tmperr, close_fds=close_fds, env=command_env) + stderr=tmperr, close_fds=close_fds, env=command_env, preexec_fn=self.preexec_fn) def isSuccessfull(self, returncode): return not self.python_process_has_been_killed and returncode == 0
[2/2] ambari git commit: AMBARI-14973. ambari-agent upstart script restart triggers the restart of hbase specific JVM processes (aonishuk)
AMBARI-14973. ambari-agent upstart script restart triggers the restart of hbase specific JVM processes (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43e9da15 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43e9da15 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43e9da15 Branch: refs/heads/branch-2.2 Commit: 43e9da158cdba8c996592dada80615e848380ea8 Parents: 9e425d7 Author: Andrew Onishuk Authored: Tue Feb 9 17:40:15 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 17:40:15 2016 +0200 -- ambari-agent/src/main/python/ambari_agent/PythonExecutor.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/43e9da15/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py index 350c568..cc08127 100644 --- a/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py +++ b/ambari-agent/src/main/python/ambari_agent/PythonExecutor.py @@ -150,6 +150,9 @@ class PythonExecutor(object): else: structured_out = {} return out, error, structured_out + + def preexec_fn(self): +os.setpgid(0, 0) def launch_python_subprocess(self, command, tmpout, tmperr): """ @@ -165,7 +168,7 @@ class PythonExecutor(object): return subprocess.Popen(command, stdout=tmpout, - stderr=tmperr, close_fds=close_fds, env=command_env) + stderr=tmperr, close_fds=close_fds, env=command_env, preexec_fn=self.preexec_fn) def isSuccessfull(self, returncode): return not self.python_process_has_been_killed and returncode == 0
[1/2] ambari git commit: AMBARI-14961. Ambari overwrites auth_to_local rules in core-site.xml (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/branch-2.2 e74d08336 -> 9e425d774 refs/heads/trunk dfff43d74 -> 429450010 AMBARI-14961. Ambari overwrites auth_to_local rules in core-site.xml (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/42945001 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/42945001 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/42945001 Branch: refs/heads/trunk Commit: 4294500105a3e7f12be3f14801dd319a6b95f489 Parents: dfff43d Author: Lisnichenko Dmitro Authored: Tue Feb 9 17:02:44 2016 +0200 Committer: Lisnichenko Dmitro Committed: Tue Feb 9 17:02:44 2016 +0200 -- .../ambari/server/controller/KerberosHelperImpl.java | 8 +++- .../KERBEROS/1.10.3-10/configuration/kerberos-env.xml | 14 ++ ambari-web/app/data/HDP2/site_properties.js | 7 +++ 3 files changed, 28 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/42945001/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java index fe1ba46..be6edc9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java @@ -651,7 +651,13 @@ public class KerberosHelperImpl implements KerberosHelper { Map> kerberosConfigurations) throws AmbariException { -if (kerberosDescriptor != null) { +boolean processAuthToLocalRules = true; +Map kerberosEnvProperties = existingConfigurations.get("kerberos-env"); +if(kerberosEnvProperties.containsKey("manage_auth_to_local")) { + processAuthToLocalRules = Boolean.valueOf(kerberosEnvProperties.get("manage_auth_to_local")); +} + +if (kerberosDescriptor != null && processAuthToLocalRules) { Set authToLocalProperties; Set authToLocalPropertiesToSet = new HashSet(); http://git-wip-us.apache.org/repos/asf/ambari/blob/42945001/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml index 25a5533..a03dea6 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml @@ -50,6 +50,20 @@ +manage_auth_to_local + + Indicates whether the hadoop auth_to_local rules should be managed by Ambari or managed manually. + +true +Manage Hadoop auth_to_local rules + + true + false + boolean + + + + install_packages Install OS-specific Kerberos client package(s) http://git-wip-us.apache.org/repos/asf/ambari/blob/42945001/ambari-web/app/data/HDP2/site_properties.js -- diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js index 385b1bf..3ea6c68 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -1491,6 +1491,13 @@ var hdp2properties = [ "index" : 13 }, { +"name": "manage_auth_to_local", +"serviceName": "KERBEROS", +"filename": "kerberos-env.xml", +"category": "Advanced kerberos-env", +"index" : 14 + }, + { "name": "admin_server_host", "serviceName": "KERBEROS", "filename": "kerberos-env.xml",
[2/2] ambari git commit: AMBARI-14961. Ambari overwrites auth_to_local rules in core-site.xml (dlysnichenko)
AMBARI-14961. Ambari overwrites auth_to_local rules in core-site.xml (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9e425d77 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9e425d77 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9e425d77 Branch: refs/heads/branch-2.2 Commit: 9e425d7743c64cd67904ccc7ccd207d73874c138 Parents: e74d083 Author: Lisnichenko Dmitro Authored: Tue Feb 9 17:02:44 2016 +0200 Committer: Lisnichenko Dmitro Committed: Tue Feb 9 17:03:21 2016 +0200 -- .../ambari/server/controller/KerberosHelperImpl.java | 8 +++- .../KERBEROS/1.10.3-10/configuration/kerberos-env.xml | 14 ++ ambari-web/app/data/HDP2/site_properties.js | 7 +++ 3 files changed, 28 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9e425d77/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java index e335e21..737b0aa 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java @@ -649,7 +649,13 @@ public class KerberosHelperImpl implements KerberosHelper { Map> kerberosConfigurations) throws AmbariException { -if (kerberosDescriptor != null) { +boolean processAuthToLocalRules = true; +Map kerberosEnvProperties = existingConfigurations.get("kerberos-env"); +if(kerberosEnvProperties.containsKey("manage_auth_to_local")) { + processAuthToLocalRules = Boolean.valueOf(kerberosEnvProperties.get("manage_auth_to_local")); +} + +if (kerberosDescriptor != null && processAuthToLocalRules) { Set authToLocalProperties; Set authToLocalPropertiesToSet = new HashSet(); http://git-wip-us.apache.org/repos/asf/ambari/blob/9e425d77/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml index c76e45a..b5cfa25 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml @@ -50,6 +50,20 @@ +manage_auth_to_local + + Indicates whether the hadoop auth_to_local rules should be managed by Ambari or managed manually. + +true +Manage Hadoop auth_to_local rules + + true + false + boolean + + + + install_packages Install OS-specific Kerberos client package(s) http://git-wip-us.apache.org/repos/asf/ambari/blob/9e425d77/ambari-web/app/data/HDP2/site_properties.js -- diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js index 7dfdbff..e061c96 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -1515,6 +1515,13 @@ var hdp2properties = [ "index" : 13 }, { +"name": "manage_auth_to_local", +"serviceName": "KERBEROS", +"filename": "kerberos-env.xml", +"category": "Advanced kerberos-env", +"index" : 14 + }, + { "name": "admin_server_host", "serviceName": "KERBEROS", "filename": "kerberos-env.xml",
[1/2] ambari git commit: AMBARI-14970. Remove support for HDP 2.1 (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.2 4d930ba02 -> e74d08336 refs/heads/trunk cb3b3ed44 -> dfff43d74 AMBARI-14970. Remove support for HDP 2.1 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dfff43d7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dfff43d7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dfff43d7 Branch: refs/heads/trunk Commit: dfff43d747b0b8c65756e4c0d7623fe7f45c6c4b Parents: cb3b3ed Author: Andrew Onishuk Authored: Tue Feb 9 13:47:22 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 13:47:22 2016 +0200 -- ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/dfff43d7/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml index 8ee982c..4af3622 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml @@ -17,7 +17,7 @@ --> - true + false 2.0.6 1.7
[2/2] ambari git commit: AMBARI-14970. Remove support for HDP 2.1 (aonishuk)
AMBARI-14970. Remove support for HDP 2.1 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e74d0833 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e74d0833 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e74d0833 Branch: refs/heads/branch-2.2 Commit: e74d08336eaafe8986b9ad3a7f0636fba10a6b0a Parents: 4d930ba Author: Andrew Onishuk Authored: Tue Feb 9 13:47:25 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 13:47:25 2016 +0200 -- ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e74d0833/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml index 8ee982c..4af3622 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.1/metainfo.xml @@ -17,7 +17,7 @@ --> - true + false 2.0.6 1.7
ambari git commit: AMBARI-14967. Incorrect behavior of period combobox/metrics on Dashboard page after resetting all widgets to default (alexantonenko)
Repository: ambari Updated Branches: refs/heads/branch-2.2 a8fd4a660 -> 4d930ba02 AMBARI-14967. Incorrect behavior of period combobox/metrics on Dashboard page after resetting all widgets to default (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4d930ba0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4d930ba0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4d930ba0 Branch: refs/heads/branch-2.2 Commit: 4d930ba02025d980a8987738cee355fa50f7c027 Parents: a8fd4a6 Author: Alex Antonenko Authored: Tue Feb 9 12:01:43 2016 +0200 Committer: Alex Antonenko Committed: Tue Feb 9 12:40:13 2016 +0200 -- ambari-web/app/views/main/dashboard/widgets.js | 5 ++ .../test/views/main/dashboard/widgets_test.js | 74 +--- 2 files changed, 70 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4d930ba0/ambari-web/app/views/main/dashboard/widgets.js -- diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js index fe9f542..b99d881 100644 --- a/ambari-web/app/views/main/dashboard/widgets.js +++ b/ambari-web/app/views/main/dashboard/widgets.js @@ -511,6 +511,11 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, Ap self.postUserPref(self.get('persistKey'), self.get('initPrefObject')); self.setDBProperty(self.get('persistKey'), self.get('initPrefObject')); } + self.setProperties({ +currentTimeRangeIndex: 0, +customStartTime: null, +customEndTime: null + }); self.translateToReal(self.get('initPrefObject')); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/4d930ba0/ambari-web/test/views/main/dashboard/widgets_test.js -- diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js b/ambari-web/test/views/main/dashboard/widgets_test.js index b0e2f14..63025a0 100644 --- a/ambari-web/test/views/main/dashboard/widgets_test.js +++ b/ambari-web/test/views/main/dashboard/widgets_test.js @@ -442,15 +442,71 @@ describe('App.MainDashboardWidgetsView', function () { }); describe("#resetAllWidgets()", function () { -before(function () { - sinon.stub(App, 'showConfirmationPopup', Em.K); -}); -after(function () { - App.showConfirmationPopup.restore(); -}); -it("", function () { - view.resetAllWidgets(); - expect(App.showConfirmationPopup.calledOnce).to.be.true; + +var cases = [ + { +testMode: true, +postUserPrefCallCount: 0, +setDBPropertyCallCount: 0, +title: 'test mode' + }, + { +testMode: false, +postUserPrefCallCount: 1, +setDBPropertyCallCount: 1, +title: 'real cluster' + } +]; + +cases.forEach(function (item) { + + describe(item.title, function () { + +beforeEach(function () { + sinon.stub(App, 'showConfirmationPopup', function (callback) { +callback(); + }); + sinon.stub(App, 'get').withArgs('testMode').returns(item.testMode); + sinon.stub(view, 'postUserPref', Em.K); + sinon.stub(view, 'setDBProperty', Em.K); + sinon.stub(view, 'translateToReal', Em.K); + view.setProperties({ +currentTimeRangeIndex: 1, +customStartTime: 1000, +customEndTime: 2000 + }); + view.resetAllWidgets(); +}); + +afterEach(function () { + App.get.restore(); + App.showConfirmationPopup.restore(); + view.postUserPref.restore(); + view.setDBProperty.restore(); + view.translateToReal.restore(); +}); + +it('persist reset', function () { + expect(view.postUserPref.callCount).to.equal(item.postUserPrefCallCount); +}); +it('local storage reset', function () { + expect(view.setDBProperty.callCount).to.equal(item.setDBPropertyCallCount); +}); +it('time range reset', function () { + expect(view.get('currentTimeRangeIndex')).to.equal(0); +}); +it('custom start time reset', function () { + expect(view.get('customStartTime')).to.be.null; +}); +it('custom end time reset', function () { + expect(view.get('customEndTime')).to.be.null; +}); +it('default settings application', function () { + expect(view.translateToReal.callCount).to.equal(1); +}); + + }); + }); });
ambari git commit: AMBARI-14967. Incorrect behavior of period combobox/metrics on Dashboard page after resetting all widgets to default (alexantonenko)
Repository: ambari Updated Branches: refs/heads/trunk f25dd31aa -> cb3b3ed44 AMBARI-14967. Incorrect behavior of period combobox/metrics on Dashboard page after resetting all widgets to default (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cb3b3ed4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cb3b3ed4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cb3b3ed4 Branch: refs/heads/trunk Commit: cb3b3ed444812fa34baf05222c21360ec7268c6a Parents: f25dd31 Author: Alex Antonenko Authored: Tue Feb 9 11:57:41 2016 +0200 Committer: Alex Antonenko Committed: Tue Feb 9 12:39:30 2016 +0200 -- ambari-web/app/views/main/dashboard/widgets.js | 5 +++ .../test/views/main/dashboard/widgets_test.js | 42 +--- 2 files changed, 41 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cb3b3ed4/ambari-web/app/views/main/dashboard/widgets.js -- diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js index 95afba7..a2fb281 100644 --- a/ambari-web/app/views/main/dashboard/widgets.js +++ b/ambari-web/app/views/main/dashboard/widgets.js @@ -504,6 +504,11 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, Ap self.postUserPref(self.get('persistKey'), self.get('initPrefObject')); self.setDBProperty(self.get('persistKey'), self.get('initPrefObject')); } + self.setProperties({ +currentTimeRangeIndex: 0, +customStartTime: null, +customEndTime: null + }); self.translateToReal(self.get('initPrefObject')); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/cb3b3ed4/ambari-web/test/views/main/dashboard/widgets_test.js -- diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js b/ambari-web/test/views/main/dashboard/widgets_test.js index ca0837a..49a06a4 100644 --- a/ambari-web/test/views/main/dashboard/widgets_test.js +++ b/ambari-web/test/views/main/dashboard/widgets_test.js @@ -449,16 +449,46 @@ describe('App.MainDashboardWidgetsView', function () { }); describe("#resetAllWidgets()", function () { -before(function () { - sinon.stub(App, 'showConfirmationPopup', Em.K); + +beforeEach(function () { + sinon.stub(App, 'showConfirmationPopup', Em.clb); + sinon.stub(view, 'postUserPref', Em.K); + sinon.stub(view, 'setDBProperty', Em.K); + sinon.stub(view, 'translateToReal', Em.K); + view.setProperties({ +currentTimeRangeIndex: 1, +customStartTime: 1000, +customEndTime: 2000 + }); + view.resetAllWidgets(); }); -after(function () { + +afterEach(function () { App.showConfirmationPopup.restore(); + view.postUserPref.restore(); + view.setDBProperty.restore(); + view.translateToReal.restore(); }); -it("showConfirmationPopup is called once", function () { - view.resetAllWidgets(); - expect(App.showConfirmationPopup.calledOnce).to.be.true; + +it('persist reset', function () { + expect(view.postUserPref.calledOnce).to.be.true; +}); +it('local storage reset', function () { + expect(view.setDBProperty.calledOnce).to.be.true; +}); +it('time range reset', function () { + expect(view.get('currentTimeRangeIndex')).to.equal(0); }); +it('custom start time reset', function () { + expect(view.get('customStartTime')).to.be.null; +}); +it('custom end time reset', function () { + expect(view.get('customEndTime')).to.be.null; +}); +it('default settings application', function () { + expect(view.translateToReal.calledOnce).to.be.true; +}); + }); describe('#checkServicesChange', function () {
[2/2] ambari git commit: AMBARI-14969. autobootstrap failed on Cenots7 (aonishuk)
AMBARI-14969. autobootstrap failed on Cenots7 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a8fd4a66 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a8fd4a66 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a8fd4a66 Branch: refs/heads/branch-2.2 Commit: a8fd4a660b28f85c7194ea301b6ecbdfbc6bab6a Parents: 1bf225d Author: Andrew Onishuk Authored: Tue Feb 9 12:38:03 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 12:38:03 2016 +0200 -- ambari-server/src/main/python/bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a8fd4a66/ambari-server/src/main/python/bootstrap.py -- diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py index adde438..270adda 100755 --- a/ambari-server/src/main/python/bootstrap.py +++ b/ambari-server/src/main/python/bootstrap.py @@ -18,12 +18,14 @@ See the License for the specific language governing permissions and limitations under the License. ''' +import sys +sys.path.append("/usr/lib/python2.6/site-packages/") # this file can be run with python2.7 that why we need this + # On Linux, the bootstrap process is supposed to run on hosts that may have installed Python 2.4 and above (CentOS 5). # Hence, the whole bootstrap code needs to comply with Python 2.4 instead of Python 2.6. Most notably, @-decorators and # {}-format() are to be avoided. import time -import sys import logging import pprint import os
[1/2] ambari git commit: AMBARI-14969. autobootstrap failed on Cenots7 (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.2 1bf225dcf -> a8fd4a660 refs/heads/trunk f734aec99 -> f25dd31aa AMBARI-14969. autobootstrap failed on Cenots7 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f25dd31a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f25dd31a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f25dd31a Branch: refs/heads/trunk Commit: f25dd31aa998b257a7bb9d1efc2aca9144b5f607 Parents: f734aec Author: Andrew Onishuk Authored: Tue Feb 9 12:38:01 2016 +0200 Committer: Andrew Onishuk Committed: Tue Feb 9 12:38:01 2016 +0200 -- ambari-server/src/main/python/bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f25dd31a/ambari-server/src/main/python/bootstrap.py -- diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py index 75bb26a..ad428af 100755 --- a/ambari-server/src/main/python/bootstrap.py +++ b/ambari-server/src/main/python/bootstrap.py @@ -18,12 +18,14 @@ See the License for the specific language governing permissions and limitations under the License. ''' +import sys +sys.path.append("/usr/lib/python2.6/site-packages/") # this file can be run with python2.7 that why we need this + # On Linux, the bootstrap process is supposed to run on hosts that may have installed Python 2.4 and above (CentOS 5). # Hence, the whole bootstrap code needs to comply with Python 2.4 instead of Python 2.6. Most notably, @-decorators and # {}-format() are to be avoided. import time -import sys import logging import pprint import os
ambari git commit: AMBARI-14957 Paging not working properly when filtering with alerts and hostname. (atkach)
Repository: ambari Updated Branches: refs/heads/branch-2.2 d06be5344 -> 1bf225dcf AMBARI-14957 Paging not working properly when filtering with alerts and hostname. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1bf225dc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1bf225dc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1bf225dc Branch: refs/heads/branch-2.2 Commit: 1bf225dcf4bff7ac999657ae17aeae7dbcbbc920 Parents: d06be53 Author: Andrii Tkach Authored: Mon Feb 8 16:41:36 2016 +0200 Committer: Andrii Tkach Committed: Tue Feb 9 12:08:08 2016 +0200 -- ambari-web/app/controllers/global/update_controller.js | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1bf225dc/ambari-web/app/controllers/global/update_controller.js -- diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index c75e7c9..f71afbe 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -122,6 +122,8 @@ App.UpdateController = Em.Controller.extend({ var params = ''; queryParams.forEach(function (param) { + var customKey = param.key; + switch (param.type) { case 'EQUAL': params += param.key + '=' + param.value; @@ -142,10 +144,10 @@ App.UpdateController = Em.Controller.extend({ params += 'sortBy=' + param.key + '.' + param.value; break; case 'CUSTOM': - param.value.forEach(function(item, index){ -param.key = param.key.replace('{' + index + '}', item); + param.value.forEach(function (item, index) { +customKey = customKey.replace('{' + index + '}', item); }, this); - params += param.key; + params += customKey; break; } params += '&';
ambari git commit: AMBARI-14957 Paging not working properly when filtering with alerts and hostname. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 472d62a7b -> f734aec99 AMBARI-14957 Paging not working properly when filtering with alerts and hostname. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f734aec9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f734aec9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f734aec9 Branch: refs/heads/trunk Commit: f734aec99bacb9ec6115574d890b74cc1d9477f5 Parents: 472d62a Author: Andrii Tkach Authored: Mon Feb 8 16:54:55 2016 +0200 Committer: Andrii Tkach Committed: Tue Feb 9 12:04:34 2016 +0200 -- ambari-web/app/controllers/global/update_controller.js | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f734aec9/ambari-web/app/controllers/global/update_controller.js -- diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index 0168398..04e7427 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -118,6 +118,8 @@ App.UpdateController = Em.Controller.extend({ var params = ''; queryParams.forEach(function (param) { + var customKey = param.key; + switch (param.type) { case 'EQUAL': params += param.key + '=' + param.value; @@ -138,10 +140,10 @@ App.UpdateController = Em.Controller.extend({ params += 'sortBy=' + param.key + '.' + param.value; break; case 'CUSTOM': - param.value.forEach(function(item, index){ -param.key = param.key.replace('{' + index + '}', item); + param.value.forEach(function (item, index) { +customKey = customKey.replace('{' + index + '}', item); }, this); - params += param.key; + params += customKey; break; } params += '&';
ambari git commit: AMBARI-14859. Ranger - Keep all temporary files in the tmp directory defined in the Agent's configuration(gautam)
Repository: ambari Updated Branches: refs/heads/branch-2.2 b30fa67b3 -> d06be5344 AMBARI-14859. Ranger - Keep all temporary files in the tmp directory defined in the Agent's configuration(gautam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d06be534 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d06be534 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d06be534 Branch: refs/heads/branch-2.2 Commit: d06be53446783a19947b0739b942a6dca2030288 Parents: b30fa67 Author: Gautam Borad Authored: Tue Jan 12 18:56:35 2016 +0530 Committer: Gautam Borad Committed: Tue Feb 9 15:30:39 2016 +0530 -- .../RANGER/0.4.0/package/scripts/params.py | 2 + .../0.4.0/package/scripts/ranger_admin.py | 50 +++- .../0.4.0/package/scripts/service_check.py | 12 ++--- .../0.4.0/package/scripts/status_params.py | 27 +++ 4 files changed, 61 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d06be534/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py -- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py index b6e5ee9..6b6bf28 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py @@ -45,6 +45,8 @@ host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False) stack_version_unformatted = str(config['hostLevelParams']['stack_version']) hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +upgrade_marker_file = format("{tmp_dir}/rangeradmin_ru.inprogress") + xml_configurations_supported = config['configurations']['ranger-env']['xml_configurations_supported'] create_db_dbuser = config['configurations']['ranger-env']['create_db_dbuser'] http://git-wip-us.apache.org/repos/asf/ambari/blob/d06be534/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py -- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py index a0007b3..5bcf6b9 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py @@ -29,8 +29,6 @@ import os, errno class RangerAdmin(Script): - upgrade_marker_file = '/tmp/rangeradmin_ru.inprogress' - def get_stack_to_component(self): return {"HDP": "ranger-admin"} @@ -67,11 +65,14 @@ class RangerAdmin(Script): setup_ranger_db(upgrade_type=upgrade_type) setup_java_patch(upgrade_type=upgrade_type) -self.set_ru_rangeradmin_in_progress() +self.set_ru_rangeradmin_in_progress(params.upgrade_marker_file) def post_upgrade_restart(self,env, upgrade_type=None): - if os.path.isfile(RangerAdmin.upgrade_marker_file): -os.remove(RangerAdmin.upgrade_marker_file) +import params +env.set_params(params) + +if os.path.isfile(params.upgrade_marker_file): + os.remove(params.upgrade_marker_file) def start(self, env, upgrade_type=None): import params @@ -81,15 +82,18 @@ class RangerAdmin(Script): def status(self, env): +import status_params + +env.set_params(status_params) cmd = 'ps -ef | grep proc_rangeradmin | grep -v grep' code, output = shell.call(cmd, timeout=20) if code != 0: - if self.is_ru_rangeradmin_in_progress(): - Logger.info('Ranger admin process not running - skipping as stack upgrade is in progress') + if self.is_ru_rangeradmin_in_progress(status_params.upgrade_marker_file): +Logger.info('Ranger admin process not running - skipping as stack upgrade is in progress') else: - Logger.debug('Ranger admin process not running') - raise ComponentIsNotRunning() +Logger.debug('Ranger admin process not running') +raise ComponentIsNotRunning() pass def configure(self, env): @@ -102,23 +106,23 @@ class RangerAdmin(Script): ranger('ranger_admin') - def set_ru_rangeradmin_in_progress(self): -config_dir = os.path.dirname(RangerAdmin.upgrade_marker_file) + def set_ru_rangeradmin_in_progress(self, upgrade_marker_file): +config_dir = os.path.dirname(upgrade_marker_file) try: - msg = "Starting Upgrade" -
ambari git commit: AMBARI-14859. Ranger - Keep all temporary files in the tmp directory defined in the Agent's configuration(gautam)
Repository: ambari Updated Branches: refs/heads/trunk 12faf8cba -> 472d62a7b AMBARI-14859. Ranger - Keep all temporary files in the tmp directory defined in the Agent's configuration(gautam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/472d62a7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/472d62a7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/472d62a7 Branch: refs/heads/trunk Commit: 472d62a7b3c0383ad4d95fe659ac87b4a8da3a1f Parents: 12faf8c Author: Gautam Borad Authored: Tue Jan 12 18:56:35 2016 +0530 Committer: Gautam Borad Committed: Tue Feb 9 15:30:01 2016 +0530 -- .../RANGER/0.4.0/package/scripts/params.py | 2 + .../0.4.0/package/scripts/ranger_admin.py | 50 +++- .../0.4.0/package/scripts/service_check.py | 12 ++--- .../0.4.0/package/scripts/status_params.py | 27 +++ 4 files changed, 61 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/472d62a7/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py -- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py index b6e5ee9..6b6bf28 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py @@ -45,6 +45,8 @@ host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False) stack_version_unformatted = str(config['hostLevelParams']['stack_version']) hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +upgrade_marker_file = format("{tmp_dir}/rangeradmin_ru.inprogress") + xml_configurations_supported = config['configurations']['ranger-env']['xml_configurations_supported'] create_db_dbuser = config['configurations']['ranger-env']['create_db_dbuser'] http://git-wip-us.apache.org/repos/asf/ambari/blob/472d62a7/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py -- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py index a0007b3..5bcf6b9 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py @@ -29,8 +29,6 @@ import os, errno class RangerAdmin(Script): - upgrade_marker_file = '/tmp/rangeradmin_ru.inprogress' - def get_stack_to_component(self): return {"HDP": "ranger-admin"} @@ -67,11 +65,14 @@ class RangerAdmin(Script): setup_ranger_db(upgrade_type=upgrade_type) setup_java_patch(upgrade_type=upgrade_type) -self.set_ru_rangeradmin_in_progress() +self.set_ru_rangeradmin_in_progress(params.upgrade_marker_file) def post_upgrade_restart(self,env, upgrade_type=None): - if os.path.isfile(RangerAdmin.upgrade_marker_file): -os.remove(RangerAdmin.upgrade_marker_file) +import params +env.set_params(params) + +if os.path.isfile(params.upgrade_marker_file): + os.remove(params.upgrade_marker_file) def start(self, env, upgrade_type=None): import params @@ -81,15 +82,18 @@ class RangerAdmin(Script): def status(self, env): +import status_params + +env.set_params(status_params) cmd = 'ps -ef | grep proc_rangeradmin | grep -v grep' code, output = shell.call(cmd, timeout=20) if code != 0: - if self.is_ru_rangeradmin_in_progress(): - Logger.info('Ranger admin process not running - skipping as stack upgrade is in progress') + if self.is_ru_rangeradmin_in_progress(status_params.upgrade_marker_file): +Logger.info('Ranger admin process not running - skipping as stack upgrade is in progress') else: - Logger.debug('Ranger admin process not running') - raise ComponentIsNotRunning() +Logger.debug('Ranger admin process not running') +raise ComponentIsNotRunning() pass def configure(self, env): @@ -102,23 +106,23 @@ class RangerAdmin(Script): ranger('ranger_admin') - def set_ru_rangeradmin_in_progress(self): -config_dir = os.path.dirname(RangerAdmin.upgrade_marker_file) + def set_ru_rangeradmin_in_progress(self, upgrade_marker_file): +config_dir = os.path.dirname(upgrade_marker_file) try: - msg = "Starting Upgrade" - if (not
ambari git commit: AMBARI-14875. Ranger Smart configs : Need to hide Audit DB properties if Audit to DB is off (gautam)
Repository: ambari Updated Branches: refs/heads/trunk d9faf7412 -> 12faf8cba AMBARI-14875. Ranger Smart configs : Need to hide Audit DB properties if Audit to DB is off (gautam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/12faf8cb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/12faf8cb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/12faf8cb Branch: refs/heads/trunk Commit: 12faf8cbae92cfa7836e7508ec2df8f2bd41d286 Parents: d9faf74 Author: Gautam Borad Authored: Tue Feb 9 14:04:56 2016 +0530 Committer: Gautam Borad Committed: Tue Feb 9 15:27:36 2016 +0530 -- .../services/RANGER/themes/theme_version_1.json | 20 +- .../services/RANGER/themes/theme_version_2.json | 40 +++- 2 files changed, 39 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/12faf8cb/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json index cb5aa78..e6724cd 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json @@ -525,25 +525,7 @@ }, { "config": "admin-properties/audit_db_password", - "subsection-name": "subsection-ranger-audit-db-row2-col2", - "depends-on": [ -{ - "configs":[ -"ranger-env/xasecure.audit.destination.db" - ], - "if": "${ranger-env/xasecure.audit.destination.db}", - "then": { -"property_value_attributes": { - "visible": true -} - }, - "else": { -"property_value_attributes": { - "visible": false -} - } -} - ] + "subsection-name": "subsection-ranger-audit-db-row2-col2" } ] }, http://git-wip-us.apache.org/repos/asf/ambari/blob/12faf8cb/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json index 2c469a9..cbd27e4 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json @@ -896,11 +896,47 @@ }, { "config": "admin-properties/audit_db_user", - "subsection-name": "subsection-ranger-audit-db-row2-col1" + "subsection-name": "subsection-ranger-audit-db-row2-col1", + "depends-on": [ +{ + "configs":[ +"ranger-env/xasecure.audit.destination.db" + ], + "if": "${ranger-env/xasecure.audit.destination.db}", + "then": { +"property_value_attributes": { + "visible": true +} + }, + "else": { +"property_value_attributes": { + "visible": false +} + } +} + ] }, { "config": "admin-properties/audit_db_name", - "subsection-name": "subsection-ranger-audit-db-row2-col2" + "subsection-name": "subsection-ranger-audit-db-row2-col2", + "depends-on": [ +{ + "configs":[ +"ranger-env/xasecure.audit.destination.db" + ], + "if": "${ranger-env/xasecure.audit.destination.db}", + "then": { +"property_value_attributes": { + "visible": true +} + }, + "else": { +"property_value_attributes": { + "visible": false +} + } +} + ] }, { "config": "admin-properties/audit_db_password",
ambari git commit: AMBARI-14875. Ranger Smart configs : Need to hide Audit DB properties if Audit to DB is off (gautam)
Repository: ambari Updated Branches: refs/heads/branch-2.2 c5e6cb75d -> b30fa67b3 AMBARI-14875. Ranger Smart configs : Need to hide Audit DB properties if Audit to DB is off (gautam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b30fa67b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b30fa67b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b30fa67b Branch: refs/heads/branch-2.2 Commit: b30fa67b3327fda96dc501f81c8e6c42e80d965a Parents: c5e6cb7 Author: Gautam Borad Authored: Tue Feb 9 14:04:56 2016 +0530 Committer: Gautam Borad Committed: Tue Feb 9 15:26:51 2016 +0530 -- .../services/RANGER/themes/theme_version_1.json | 20 +- .../services/RANGER/themes/theme_version_2.json | 40 +++- 2 files changed, 39 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b30fa67b/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json index cb5aa78..e6724cd 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/RANGER/themes/theme_version_1.json @@ -525,25 +525,7 @@ }, { "config": "admin-properties/audit_db_password", - "subsection-name": "subsection-ranger-audit-db-row2-col2", - "depends-on": [ -{ - "configs":[ -"ranger-env/xasecure.audit.destination.db" - ], - "if": "${ranger-env/xasecure.audit.destination.db}", - "then": { -"property_value_attributes": { - "visible": true -} - }, - "else": { -"property_value_attributes": { - "visible": false -} - } -} - ] + "subsection-name": "subsection-ranger-audit-db-row2-col2" } ] }, http://git-wip-us.apache.org/repos/asf/ambari/blob/b30fa67b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json index 2c469a9..cbd27e4 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme_version_2.json @@ -896,11 +896,47 @@ }, { "config": "admin-properties/audit_db_user", - "subsection-name": "subsection-ranger-audit-db-row2-col1" + "subsection-name": "subsection-ranger-audit-db-row2-col1", + "depends-on": [ +{ + "configs":[ +"ranger-env/xasecure.audit.destination.db" + ], + "if": "${ranger-env/xasecure.audit.destination.db}", + "then": { +"property_value_attributes": { + "visible": true +} + }, + "else": { +"property_value_attributes": { + "visible": false +} + } +} + ] }, { "config": "admin-properties/audit_db_name", - "subsection-name": "subsection-ranger-audit-db-row2-col2" + "subsection-name": "subsection-ranger-audit-db-row2-col2", + "depends-on": [ +{ + "configs":[ +"ranger-env/xasecure.audit.destination.db" + ], + "if": "${ranger-env/xasecure.audit.destination.db}", + "then": { +"property_value_attributes": { + "visible": true +} + }, + "else": { +"property_value_attributes": { + "visible": false +} + } +} + ] }, { "config": "admin-properties/audit_db_password",
ambari git commit: AMBARI-14562. Ranger - If configured audit store is 'solr', then audit_store value should be 'solr'(gautam)
Repository: ambari Updated Branches: refs/heads/branch-2.2 97fb8400e -> c5e6cb75d AMBARI-14562. Ranger - If configured audit store is 'solr', then audit_store value should be 'solr'(gautam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c5e6cb75 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c5e6cb75 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c5e6cb75 Branch: refs/heads/branch-2.2 Commit: c5e6cb75de56375e1a52b75c78cb4ab6f3592339 Parents: 97fb840 Author: Gautam Borad Authored: Fri Jan 22 09:25:37 2016 +0530 Committer: Gautam Borad Committed: Tue Feb 9 15:23:32 2016 +0530 -- .../RANGER/0.4.0/package/scripts/setup_ranger_xml.py | 5 + .../services/RANGER/configuration/ranger-admin-site.xml | 10 ++ .../resources/stacks/HDP/2.3/services/stack_advisor.py | 11 +++ .../test/python/stacks/2.3/common/test_stack_advisor.py | 3 ++- 4 files changed, 28 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c5e6cb75/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py -- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py index fcceaa6..4f9b260 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py @@ -192,6 +192,11 @@ def setup_ranger_db(upgrade_type=None): owner = params.unix_user, ) + ModifyPropertiesFile(format("{ranger_home}/install.properties"), +properties = {'audit_store': params.ranger_audit_source_type}, +owner = params.unix_user, + ) + if params.db_flavor.lower() == 'sqla': ModifyPropertiesFile(format("{ranger_home}/install.properties"), properties = {'SQL_CONNECTOR_JAR': format('{ranger_home}/ews/lib/{jdbc_jar_name}')}, http://git-wip-us.apache.org/repos/asf/ambari/blob/c5e6cb75/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml index ab70a82..590b3ed 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml @@ -158,6 +158,16 @@ ranger.audit.source.type solr db or solr, based on the audit destination used + + +ranger-env +xasecure.audit.destination.solr + + +ranger-env +xasecure.audit.destination.db + + http://git-wip-us.apache.org/repos/asf/ambari/blob/c5e6cb75/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 71b0e2a..8892349 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 @@ -625,6 +625,17 @@ class HDP23StackAdvisor(HDP22StackAdvisor): rangerAuditProperty = services["configurations"][item['filename']]["properties"][item['configname']] putRangerAuditProperty(item['target_configname'], rangerAuditProperty) +audit_solr_flag = 'false' +audit_db_flag = 'false' +ranger_audit_source_type = 'solr' +if 'ranger-env' in services['configurations'] and 'xasecure.audit.destination.solr' in services['configurations']["ranger-env"]["properties"]: + audit_solr_flag = services['configurations']["ranger-env"]["properties"]['xasecure.audit.destination.solr'] +if 'ranger-env' in services['configurations'] and 'xasecure.audit.destination.db' in services['configurations']["ranger-env"]["properties"]: + audit_db_flag = services['configurations']["ranger-env"]["properties"]['xasecure.audit.destination.db'] + +if audit_db_flag == 'true' and audit_solr_flag == 'false': + ranger_audit_source_type = 'db' +putRangerAdminProperty('ranger.audit.source.type',ranger_audit_source_type) def recommendYARNConfigurations(self, c