[03/24] ambari git commit: AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB (onechiporenko)
AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e139ef57 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e139ef57 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e139ef57 Branch: refs/heads/branch-dev-patch-upgrade Commit: e139ef57ce0ec3d705489a36cb2d7cc78f6458c1 Parents: 5cb0fad Author: Oleg NechiporenkoAuthored: Mon Feb 8 16:58:17 2016 +0200 Committer: Oleg Nechiporenko Committed: Mon Feb 8 18:52:14 2016 +0200 -- .../manage_alert_notifications_controller.js| 74 +++- ...anage_alert_notifications_controller_test.js | 121 +++ .../views/common/log_file_search_view_test.js | 3 +- 3 files changed, 116 insertions(+), 82 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e139ef57/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js -- diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js index 79e524e..244b8f0 100644 --- a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js +++ b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js @@ -61,9 +61,7 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ value: '', defaultValue: 'custom', disabled: false, - isAll: function () { -return this.get('value') == 'all'; - }.property('value') + isAll: Em.computed.equal('value', 'all') }), method: { label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.method'), @@ -159,7 +157,7 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ * used in Type combobox * @type {Array} */ - methods: ['EMAIL', 'SNMP'], + methods: ['EMAIL', 'SNMP', 'Custom SNMP'], /** * List of available value for Severity Filter @@ -220,7 +218,8 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ 'mail.smtp.from', 'mail.smtp.host', 'mail.smtp.port', -'mail.smtp.starttls.enable' +'mail.smtp.starttls.enable', +'ambari.dispatch-property.script' ], validationMap: { @@ -242,6 +241,16 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ validator: 'retypePasswordValidation' } ], +'Custom SNMP': [ + { +errorKey: 'portError', +validator: 'portValidation' + }, + { +errorKey: 'hostError', +validator: 'hostsValidation' + } +], SNMP: [ { errorKey: 'portError', @@ -322,24 +331,25 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ fillEditCreateInputs: function (addCopyToName) { var inputFields = this.get('inputFields'); var selectedAlertNotification = this.get('selectedAlertNotification'); +var props = selectedAlertNotification.get('properties'); inputFields.set('name.value', (addCopyToName ? 'Copy of ' : '') + selectedAlertNotification.get('name')); inputFields.set('groups.value', selectedAlertNotification.get('groups').toArray()); -inputFields.set('email.value', selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ? - selectedAlertNotification.get('properties')['ambari.dispatch.recipients'].join(', ') : ''); -inputFields.set('SMTPServer.value', selectedAlertNotification.get('properties')['mail.smtp.host']); -inputFields.set('SMTPPort.value', selectedAlertNotification.get('properties')['mail.smtp.port']); -inputFields.set('SMTPUseAuthentication.value', selectedAlertNotification.get('properties')['mail.smtp.auth'] !== "false"); -inputFields.set('SMTPUsername.value', selectedAlertNotification.get('properties')['ambari.dispatch.credential.username']); -inputFields.set('SMTPPassword.value', selectedAlertNotification.get('properties')['ambari.dispatch.credential.password']); -inputFields.set('retypeSMTPPassword.value', selectedAlertNotification.get('properties')['ambari.dispatch.credential.password']); -inputFields.set('SMTPSTARTTLS.value', selectedAlertNotification.get('properties')['mail.smtp.starttls.enable'] !== "false"); -inputFields.set('emailFrom.value', selectedAlertNotification.get('properties')['mail.smtp.from']); -inputFields.set('version.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.version']); -inputFields.set('OIDs.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.trap']); -
[21/24] ambari git commit: AMBARI-14965: Ambari server lists service even though service creation fails (Ajit Kumar via jluniya)
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/branch-dev-patch-upgrade Commit: 73fbe14c2a14619a5023ea0698cda72858c05fbe Parents: 37122a6 Author: Jayush LuniyaAuthored: 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
[07/24] ambari git commit: AMBARI-14949: Ambaripreupload should skip uploading oozie shared lib for upgrade (jluniya)
AMBARI-14949: Ambaripreupload should skip uploading oozie shared lib for upgrade (jluniya) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53526383 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53526383 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53526383 Branch: refs/heads/branch-dev-patch-upgrade Commit: 53526383411f4709a6a59befeee8e68c7420cdc5 Parents: e76099a Author: Jayush LuniyaAuthored: Mon Feb 8 14:36:00 2016 -0800 Committer: Jayush Luniya Committed: Mon Feb 8 14:36:00 2016 -0800 -- .../main/resources/scripts/Ambaripreupload.py | 31 1 file changed, 18 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/53526383/ambari-server/src/main/resources/scripts/Ambaripreupload.py -- diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py b/ambari-server/src/main/resources/scripts/Ambaripreupload.py index 591b7d2..5a20698 100644 --- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py +++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py @@ -85,8 +85,10 @@ with Environment() as env: parser = OptionParser() parser.add_option("-v", "--hdp-version", dest="hdp_version", default="", help="hdp-version used in path of tarballs") - + parser.add_option("-u", "--upgrade", dest="upgrade", action="store_true", +help="flag to indicate script is being run for upgrade", default=False) (options, args) = parser.parse_args() + # See if hdfs path prefix is provided on the command line. If yes, use that value, if no # use empty string as default. @@ -273,19 +275,22 @@ with Environment() as env: oozie_hdfs_user_dir = format("{hdfs_path_prefix}/user/{oozie_user}") kinit_if_needed = '' - params.HdfsResource(format("{oozie_hdfs_user_dir}/share/"), -action="delete_on_execute", -type = 'directory' - ) + if options.upgrade: +Logger.info("Skipping uploading oozie shared lib during upgrade") + else: +params.HdfsResource(format("{oozie_hdfs_user_dir}/share/"), + action="delete_on_execute", + type = 'directory' +) - params.HdfsResource(format("{oozie_hdfs_user_dir}/share"), -action="create_on_execute", -type = 'directory', -mode=0755, -recursive_chmod = True, -owner=oozie_user, -source = oozie_shared_lib, - ) +params.HdfsResource(format("{oozie_hdfs_user_dir}/share"), + action="create_on_execute", + type = 'directory', + mode=0755, + recursive_chmod = True, + owner=oozie_user, + source = oozie_shared_lib, +) print "Copying tarballs..." copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/hadoop/mapreduce.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group)
[13/24] ambari git commit: AMBARI-14967. Incorrect behavior of period combobox/metrics on Dashboard page after resetting all widgets to default (alexantonenko)
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/branch-dev-patch-upgrade Commit: cb3b3ed444812fa34baf05222c21360ec7268c6a Parents: f25dd31 Author: Alex AntonenkoAuthored: 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 () {
[15/24] 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/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/branch-dev-patch-upgrade Commit: 4294500105a3e7f12be3f14801dd319a6b95f489 Parents: dfff43d Author: Lisnichenko DmitroAuthored: 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",
[19/24] ambari git commit: AMBARI-14962 : Auto configure AMS UI to use AMS Datasource (avijayan)
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/branch-dev-patch-upgrade Commit: 14396f2b74115744d6f4c93b97a9911cd1e58ff1 Parents: 38a5225 Author: Aravindan VijayanAuthored: 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"] +
[17/24] ambari git commit: AMBARI-14971 UI - lag in Create Versions page doesn't show confirmation. (ababiichuk)
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/branch-dev-patch-upgrade Commit: 400d49548755a8c50760dd1bfcba81dacaba79f6 Parents: ef1b98b Author: ababiichukAuthored: 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) {
[04/24] ambari git commit: AMBARI-14938. Some user-specified auth-to-local rules fail to render when auto generating auth-to-local rules (rlevas)
AMBARI-14938. Some user-specified auth-to-local rules fail to render when auto generating auth-to-local rules (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a396ff02 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a396ff02 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a396ff02 Branch: refs/heads/branch-dev-patch-upgrade Commit: a396ff0203093ba80460657b4f7a4fecfb2b7ed1 Parents: e139ef5 Author: Robert LevasAuthored: Mon Feb 8 13:39:30 2016 -0500 Committer: Robert Levas Committed: Mon Feb 8 13:39:30 2016 -0500 -- .../server/controller/AuthToLocalBuilder.java | 287 ++--- .../server/controller/KerberosHelperImpl.java | 15 +- .../controller/AuthToLocalBuilderTest.java | 315 --- 3 files changed, 381 insertions(+), 236 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a396ff02/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java index a8fc487..9d6db0a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java @@ -18,7 +18,10 @@ package org.apache.ambari.server.controller; +import org.apache.commons.lang.StringUtils; + import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -40,19 +43,18 @@ import java.util.regex.Pattern; * * Unqualified Principal (only user is specified): * RULE:[1:$1@$0](PRIMARY@REALM)s/.*\/LOCAL_USERNAME/ - * + * * Additionally, for each realm included in the rule set, generate a default realm rule * in the format: RULE:[1:$1@$0](.*@REALM)s/@.{@literal *}// - * + * * Ordering guarantees for the generated rule string are as follows: * - * Rules with the same expected component count are ordered according to match component count - * Rules with different expected component count are ordered according to the default string ordering - * Rules in the form of .*@REALM are ordered after all other rules with the same expected component count + * Rules with the same expected component count are ordered according to match component count + * Rules with different expected component count are ordered according to the default string ordering + * Rules in the form of .*@REALM are ordered after all other rules with the same expected component count * - * */ -public class AuthToLocalBuilder { +public class AuthToLocalBuilder implements Cloneable { public static final ConcatenationType DEFAULT_CONCATENATION_TYPE = ConcatenationType.NEW_LINES; /** @@ -60,43 +62,62 @@ public class AuthToLocalBuilder { */ private Set setRules = new TreeSet(); - /** - * A flag indicating whether case insensitive support to the local username has been requested. This will append an //L switch to the generic realm rule + * The default realm. */ - private boolean caseInsensitiveUser; + private final String defaultRealm; /** * A set of additional realm names to reference when generating rules. */ - private Set additionalRealms = new HashSet(); + private final Set additionalRealms; + /** - * Default constructor. Case insensitive support false by default + * A flag indicating whether case insensitive support to the local username has been requested. This will append an //L switch to the generic realm rule + */ + private boolean caseInsensitiveUser; + + /** + * Constructs a new AuthToLocalBuilder. + * + * @param defaultRealm a String declaring the default realm + * @param additionalRealms a String containing a comma-delimited list of realm names + * to incorporate into the generated rule set + * @param caseInsensitiveUserSupport true indicating that case-insensitivity should be enabled; + * false otherwise */ - public AuthToLocalBuilder() { -this(false, null); + public AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport) { +this(defaultRealm, splitDelimitedString(additionalRealms), caseInsensitiveUserSupport); } /** * Constructs a new AuthToLocalBuilder. * + * @param defaultRealm a String declaring the default realm + * @param additionalRealms a collection of
[14/24] 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/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/branch-dev-patch-upgrade Commit: dfff43d747b0b8c65756e4c0d7623fe7f45c6c4b Parents: cb3b3ed Author: Andrew OnishukAuthored: 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
[08/24] ambari git commit: AMBARI-14963. Cannot login due to a JS error (alexantonenko)
AMBARI-14963. Cannot login due to a JS error (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d9faf741 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d9faf741 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d9faf741 Branch: refs/heads/branch-dev-patch-upgrade Commit: d9faf7412c5d1968ba74d1eab3487b7e374ea002 Parents: 5352638 Author: Alex AntonenkoAuthored: Tue Feb 9 01:41:32 2016 +0200 Committer: Alex Antonenko Committed: Tue Feb 9 02:41:31 2016 +0200 -- ambari-web/app/router.js | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/d9faf741/ambari-web/app/router.js -- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 809979e..720ac0b 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -349,9 +349,18 @@ App.Router = Em.Router.extend({ /** * success callback of router.login.message * @param {object} data + * @param {object} opt + * @param {object} params */ showLoginMessage: function (data, opt, params){ -var response = JSON.parse(data.Settings.content.replace(/\n/g, "\\n")), +try { + var response = JSON.parse(data.Settings.content.replace(/\n/g, "\\n")) +} catch (e) { + this.setClusterData(data, opt, params); + return false; +} + +var text = response.text ? response.text : "", buttonText = response.button ? response.button : Em.I18n.t('ok'), status = response.status && response.status == "true" ? true : false,
[02/24] ambari git commit: AMBARI-14403: Improve Quicklink logic to remove any unnecessary legacy code (dili)
AMBARI-14403: Improve Quicklink logic to remove any unnecessary legacy code (dili) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5cb0fadd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5cb0fadd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5cb0fadd Branch: refs/heads/branch-dev-patch-upgrade Commit: 5cb0faddaee06332ab703c237a7514742fbc3588 Parents: 62f3a3b Author: Di LiAuthored: Mon Feb 8 11:30:26 2016 -0500 Committer: Di Li Committed: Mon Feb 8 11:30:26 2016 -0500 -- .../ambari/server/state/quicklinks/Link.java| 19 +--- .../FALCON/0.5.0.2.1/quicklinks/quicklinks.json | 1 - .../STORM/0.9.1.2.1/quicklinks/quicklinks.json | 1 - .../HDP/2.0.6/services/HBASE/metainfo.xml | 7 ++ .../services/HBASE/quicklinks/quicklinks.json | 97 .../stacks/HDP/2.0.6/services/HDFS/metainfo.xml | 7 ++ .../services/HDFS/quicklinks/quicklinks.json| 76 +++ .../HDP/2.0.6/services/OOZIE/metainfo.xml | 5 +- .../services/OOZIE/quicklinks/quicklinks.json | 1 - .../stacks/HDP/2.0.6/services/YARN/metainfo.xml | 13 +++ .../YARN/quicklinks-mapred/quicklinks.json | 76 +++ .../services/YARN/quicklinks/quicklinks.json| 76 +++ .../services/RANGER/quicklinks/quicklinks.json | 1 - .../services/SPARK/quicklinks/quicklinks.json | 1 - .../ACCUMULO/quicklinks/quicklinks.json | 1 - .../services/ATLAS/quicklinks/quicklinks.json | 1 - .../services/HBASE/quicklinks/quicklinks.json | 6 -- .../services/HDFS/quicklinks/quicklinks.json| 4 - .../services/OOZIE/quicklinks/quicklinks.json | 1 - .../services/RANGER/quicklinks/quicklinks.json | 1 - .../services/SPARK/quicklinks/quicklinks.json | 1 - .../YARN/quicklinks-mapred/quicklinks.json | 4 - .../services/YARN/quicklinks/quicklinks.json| 4 - .../resources/child_quicklinks_to_merge.json| 3 - .../resources/child_quicklinks_to_override.json | 4 - .../src/test/resources/parent_quicklinks.json | 4 - .../assets/data/configurations/quicklinks.json | 4 - .../app/views/common/quick_view_link_view.js| 10 +- 28 files changed, 360 insertions(+), 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5cb0fadd/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java index a0890f1..8800b3a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java @@ -37,9 +37,6 @@ public class Link{ @JsonProperty("url") private String url; - @JsonProperty("template") - private String template; - @JsonProperty("port") private Port port; @@ -67,14 +64,6 @@ public class Link{ this.url = url; } - public String getTemplate() { -return template; - } - - public void setTemplate(String template) { -this.template = template; - } - public String getRequiresUserName() { return requiresUserName; } @@ -93,7 +82,7 @@ public class Link{ public boolean isRemoved(){ //treat a link as removed if the section only contains a name -return (null == port && null == url && null == template && null == label && null == requiresUserName); +return (null == port && null == url && null == label && null == requiresUserName); } public void mergeWithParent(Link parentLink) { @@ -103,18 +92,12 @@ public class Link{ /* merge happens when a child link has some infor but not all of them. * If a child link has nothing but a name, it's treated as being removed from the link list */ -if(null == template && null != parentLink.getTemplate()) - template = parentLink.getTemplate(); - if(null == label && null != parentLink.getLabel()) label = parentLink.getLabel(); if(null == url && null != parentLink.getUrl()) url = parentLink.getUrl(); -if(null == template && null != parentLink.getTemplate()) - template = parentLink.getTemplate(); - if(null == requiresUserName && null != parentLink.getRequiresUserName()) requiresUserName = parentLink.getRequiresUserName(); http://git-wip-us.apache.org/repos/asf/ambari/blob/5cb0fadd/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/quicklinks/quicklinks.json -- diff --git
[16/24] 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/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/branch-dev-patch-upgrade Commit: ef1b98b3c77a5b4ebafbd5cc9c720ad9f13b63e8 Parents: 4294500 Author: Andrew OnishukAuthored: 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
[24/24] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade
Merge branch 'trunk' into branch-dev-patch-upgrade Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c543ef8b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c543ef8b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c543ef8b Branch: refs/heads/branch-dev-patch-upgrade Commit: c543ef8b23f75c828d87e6d0fc4866b567dd5dd7 Parents: 697c309 46bbbf9 Author: Nate ColeAuthored: Wed Feb 10 11:12:38 2016 -0500 Committer: Nate Cole Committed: Wed Feb 10 11:12:38 2016 -0500 -- .../stackVersions/StackVersionsCreateCtrl.js| 7 +- .../main/python/ambari_agent/PythonExecutor.py | 5 +- ambari-metrics/ambari-metrics-assembly/pom.xml | 12 +- .../server/controller/AuthToLocalBuilder.java | 287 ++--- .../server/controller/KerberosHelperImpl.java | 23 +- .../internal/ServiceResourceProvider.java | 197 ++-- .../ambari/server/state/quicklinks/Link.java| 19 +- .../main/python/ambari_server/serverSetup.py| 17 - ambari-server/src/main/python/bootstrap.py | 4 +- .../0.1.0/package/scripts/metrics_grafana.py| 2 + .../package/scripts/metrics_grafana_util.py | 131 .../metrics_grafana_datasource.json.j2 | 33 ++ .../FALCON/0.5.0.2.1/quicklinks/quicklinks.json | 1 - .../1.10.3-10/configuration/kerberos-env.xml| 14 + .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 71 - .../4.0.0.2.0/package/scripts/oozie_server.py | 3 +- .../package/scripts/oozie_server_upgrade.py | 18 +- .../PXF/3.0.0/package/scripts/params.py | 17 +- .../PXF/3.0.0/package/scripts/service_check.py | 81 +++-- .../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 ++ .../STORM/0.9.1.2.1/quicklinks/quicklinks.json | 1 - .../main/resources/scripts/Ambaripreupload.py | 31 +- .../HDP/2.0.6/services/HBASE/metainfo.xml | 7 + .../services/HBASE/quicklinks/quicklinks.json | 97 ++ .../stacks/HDP/2.0.6/services/HDFS/metainfo.xml | 7 + .../services/HDFS/quicklinks/quicklinks.json| 76 + .../HDP/2.0.6/services/OOZIE/metainfo.xml | 5 +- .../services/OOZIE/quicklinks/quicklinks.json | 1 - .../stacks/HDP/2.0.6/services/YARN/metainfo.xml | 13 + .../YARN/quicklinks-mapred/quicklinks.json | 76 + .../services/YARN/quicklinks/quicklinks.json| 76 + .../main/resources/stacks/HDP/2.1/metainfo.xml | 2 +- .../services/RANGER/quicklinks/quicklinks.json | 1 - .../services/RANGER/themes/theme_version_1.json | 20 +- .../services/SPARK/quicklinks/quicklinks.json | 1 - .../ACCUMULO/quicklinks/quicklinks.json | 1 - .../services/ATLAS/quicklinks/quicklinks.json | 1 - .../services/HBASE/quicklinks/quicklinks.json | 6 - .../services/HDFS/quicklinks/quicklinks.json| 4 - .../services/OOZIE/quicklinks/quicklinks.json | 1 - .../services/RANGER/quicklinks/quicklinks.json | 1 - .../services/RANGER/themes/theme_version_2.json | 40 ++- .../services/SPARK/quicklinks/quicklinks.json | 1 - .../YARN/quicklinks-mapred/quicklinks.json | 4 - .../services/YARN/quicklinks/quicklinks.json| 4 - .../controller/AuthToLocalBuilderTest.java | 315 --- .../AMBARI_METRICS/test_metrics_grafana.py | 19 +- .../stacks/2.0.6/OOZIE/test_oozie_server.py | 172 +- .../resources/child_quicklinks_to_merge.json| 3 - .../resources/child_quicklinks_to_override.json | 4 - .../src/test/resources/parent_quicklinks.json | 4 - .../assets/data/configurations/quicklinks.json | 4 - .../app/controllers/global/update_controller.js | 8 +- .../manage_alert_notifications_controller.js| 74 +++-- .../app/controllers/wizard/step4_controller.js | 122 +-- ambari-web/app/data/HDP2/site_properties.js | 7 + ambari-web/app/router.js| 59 ++-- .../app/views/common/quick_view_link_view.js| 10 +- ambari-web/app/views/main/dashboard/widgets.js | 5 + ...anage_alert_notifications_controller_test.js | 121 --- .../test/controllers/wizard/step4_test.js | 40 ++- .../views/common/log_file_search_view_test.js | 3 +- .../test/views/main/dashboard/widgets_test.js | 42 ++- 66 files changed, 1730 insertions(+), 792 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c543ef8b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js -- diff --cc
[20/24] ambari git commit: AMBARI-14962 : Auto configure AMS UI to use AMS Datasource - Commit 2 (avijayan)
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/branch-dev-patch-upgrade Commit: 37122a6d3aa7f5b5cb48c85a420be1c389010951 Parents: 14396f2 Author: Aravindan VijayanAuthored: 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",
[18/24] ambari git commit: AMBARI-14974 Ambari maven builds fail on trunk (dsen)
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/branch-dev-patch-upgrade Commit: 38a52256e0d421fe52beef4e4860b99676b5 Parents: 400d495 Author: Dmytro SenAuthored: 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
[09/24] ambari git commit: AMBARI-14875. Ranger Smart configs : Need to hide Audit DB properties if Audit to DB is off (gautam)
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/branch-dev-patch-upgrade Commit: 12faf8cbae92cfa7836e7508ec2df8f2bd41d286 Parents: d9faf74 Author: Gautam BoradAuthored: 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",
[23/24] ambari git commit: AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk)
AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46bbbf9c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46bbbf9c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46bbbf9c Branch: refs/heads/branch-dev-patch-upgrade Commit: 46bbbf9c2c72b52f107d4d929ab3dc6dc05577d4 Parents: feb50e3 Author: Andrew OnishukAuthored: Wed Feb 10 13:20:54 2016 +0200 Committer: Andrew Onishuk Committed: Wed Feb 10 13:20:54 2016 +0200 -- .../src/main/python/ambari_server/serverSetup.py | 17 - 1 file changed, 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/46bbbf9c/ambari-server/src/main/python/ambari_server/serverSetup.py -- diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py index 511da27..c370257 100644 --- a/ambari-server/src/main/python/ambari_server/serverSetup.py +++ b/ambari-server/src/main/python/ambari_server/serverSetup.py @@ -432,23 +432,6 @@ class JDKSetup(object): else: progress_func = download_progress -if get_silent(): - if not java_home_var: -#No java_home_var set, detect if java is already installed -if os.environ.has_key(JAVA_HOME): - args.java_home = os.environ[JAVA_HOME] - - properties.process_pair(JAVA_HOME_PROPERTY, args.java_home) - properties.removeOldProp(JDK_NAME_PROPERTY) - properties.removeOldProp(JCE_NAME_PROPERTY) - - self._ensure_java_home_env_var_is_set(args.java_home) - self.jdk_index = self.custom_jdk_number - return -else: - # For now, changing the existing JDK to make sure we use a supported one - pass - if java_home_var: change_jdk = get_YN_input("Do you want to change Oracle JDK [y/n] (n)? ", False) if not change_jdk:
[22/24] ambari git commit: AMBARI-14959: Implement service check for secured PXF service (lavjain via jaoki)
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/branch-dev-patch-upgrade Commit: feb50e3a3f5edb1105780d06254bb9538d19063e Parents: 73fbe14 Author: Jun AokiAuthored: 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
[05/24] ambari git commit: AMBARI-14846. Dependencies popup is displayed even when all dependent services are selected (alexantonenko)
AMBARI-14846. Dependencies popup is displayed even when all dependent services are selected (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f905a024 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f905a024 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f905a024 Branch: refs/heads/branch-dev-patch-upgrade Commit: f905a0243ec34df9c74cc76551cecd53a8251523 Parents: a396ff0 Author: Alex AntonenkoAuthored: Mon Feb 8 21:29:39 2016 +0200 Committer: Alex Antonenko Committed: Mon Feb 8 21:29:47 2016 +0200 -- .../app/controllers/wizard/step4_controller.js | 122 +++ .../test/controllers/wizard/step4_test.js | 40 +- 2 files changed, 136 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f905a024/ambari-web/app/controllers/wizard/step4_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js index 90479ac..a8ad7fc 100644 --- a/ambari-web/app/controllers/wizard/step4_controller.js +++ b/ambari-web/app/controllers/wizard/step4_controller.js @@ -86,13 +86,23 @@ App.WizardStep4Controller = Em.ArrayController.extend({ */ ambariMetricsValidation: function (callback) { var ambariMetricsService = this.findProperty('serviceName', 'AMBARI_METRICS'); -if (ambariMetricsService && !ambariMetricsService.get('isSelected')) { - this.addValidationError({ -id: 'ambariMetricsCheck', -type: 'WARNING', -callback: this.ambariMetricsCheckPopup, -callbackParams: [callback] - }); +if (ambariMetricsService) { + if(!ambariMetricsService.get('isSelected')) { +this.addValidationError({ + id: 'ambariMetricsCheck', + type: 'WARNING', + callback: this.ambariMetricsCheckPopup, + callbackParams: [callback] +}); + } + else { +//metrics is selected, remove the metrics error from errorObject array +var metricsError = this.get('errorStack').filterProperty('id',"ambariMetricsCheck"); +if(metricsError) +{ + this.get('errorStack').removeObject(metricsError[0]); +} + } } }, @@ -103,13 +113,23 @@ App.WizardStep4Controller = Em.ArrayController.extend({ */ rangerValidation: function (callback) { var rangerService = this.findProperty('serviceName', 'RANGER'); -if (rangerService && rangerService.get('isSelected') && !rangerService.get('isInstalled')) { - this.addValidationError({ -id: 'rangerRequirements', -type: 'WARNING', -callback: this.rangerRequirementsPopup, -callbackParams: [callback] - }); +if (rangerService && !rangerService.get('isInstalled')) { + if(rangerService.get('isSelected')) { +this.addValidationError({ + id: 'rangerRequirements', + type: 'WARNING', + callback: this.rangerRequirementsPopup, + callbackParams: [callback] +}); + } + else { +//Ranger is selected, remove the Ranger error from errorObject array +var rangerError = this.get('errorStack').filterProperty('id',"rangerRequirements"); +if(rangerError) +{ + this.get('errorStack').removeObject(rangerError[0]); +} + } } }, @@ -120,14 +140,24 @@ App.WizardStep4Controller = Em.ArrayController.extend({ */ sparkValidation: function (callback) { var sparkService = this.findProperty('serviceName', 'SPARK'); -if (sparkService && sparkService.get('isSelected') && !sparkService.get('isInstalled') && +if (sparkService && !sparkService.get('isInstalled') && App.get('currentStackName') == 'HDP' && App.get('currentStackVersionNumber') == '2.2') { - this.addValidationError({ -id: 'sparkWarning', -type: 'WARNING', -callback: this.sparkWarningPopup, -callbackParams: [callback] - }); + if(sparkService.get('isSelected')) { +this.addValidationError({ + id: 'sparkWarning', + type: 'WARNING', + callback: this.sparkWarningPopup, + callbackParams: [callback] +}); + } + else { +//Spark is selected, remove the Spark error from errorObject array +var sparkError = this.get('errorStack').filterProperty('id',"sparkWarning"); +if(sparkError) +{ + this.get('errorStack').removeObject(sparkError[0]); +} + } } }, @@ -317,6 +347,15 @@ App.WizardStep4Controller = Em.ArrayController.extend({ callbackParams: [services, 'multipleDFS',
[12/24] 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/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/branch-dev-patch-upgrade Commit: f25dd31aa998b257a7bb9d1efc2aca9144b5f607 Parents: f734aec Author: Andrew OnishukAuthored: 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
[06/24] ambari git commit: AMBARI-14950. EU: Oozie service check failed after downgrade with multiple Oozie servers since rerunning prepare-war removes webapps/oozie folder (alejandro)
AMBARI-14950. EU: Oozie service check failed after downgrade with multiple Oozie servers since rerunning prepare-war removes webapps/oozie folder (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e76099a2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e76099a2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e76099a2 Branch: refs/heads/branch-dev-patch-upgrade Commit: e76099a275793607a86e7c34eb91c89db74021d6 Parents: f905a02 Author: Alejandro FernandezAuthored: Mon Feb 8 11:43:12 2016 -0800 Committer: Alejandro Fernandez Committed: Mon Feb 8 11:43:14 2016 -0800 -- .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 71 ++-- .../4.0.0.2.0/package/scripts/oozie_server.py | 3 +- .../package/scripts/oozie_server_upgrade.py | 18 +- .../stacks/2.0.6/OOZIE/test_oozie_server.py | 172 +-- 4 files changed, 143 insertions(+), 121 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e76099a2/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py -- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py index 24a35ad..7591bad 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py @@ -32,10 +32,15 @@ from resource_management.libraries.script.script import Script from resource_management.core.resources.packaging import Package from resource_management.core.shell import as_user from resource_management.core.shell import as_sudo +from resource_management.core import shell +from resource_management.core.exceptions import Fail +from resource_management.core.logger import Logger + from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl from ambari_commons import OSConst from ambari_commons.inet_utils import download_file + @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY) def oozie(is_server=False): import params @@ -191,7 +196,59 @@ def oozie_ownership(): owner = params.oozie_user, group = params.user_group ) - + + +def prepare_war(): + """ + Attempt to call prepare-war command if the marker file doesn't exist or its content doesn't equal the expected command. + The marker file is stored in /usr/hdp/current/oozie-server/.prepare_war_cmd + """ + import params + + prepare_war_cmd_file = format("{oozie_home}/.prepare_war_cmd") + + # DON'T CHANGE THE VALUE SINCE IT'S USED TO DETERMINE WHETHER TO RUN THE COMMAND OR NOT BY READING THE MARKER FILE. + # Oozie tmp dir should be /var/tmp/oozie and is already created by a function above. + command = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war {oozie_secure}") + command = command.strip() + + run_prepare_war = False + if os.path.exists(prepare_war_cmd_file): +cmd = "" +with open(prepare_war_cmd_file, "r") as f: + cmd = f.readline().strip() + +if command != cmd: + run_prepare_war = True + Logger.info(format("Will run prepare war cmd since marker file {prepare_war_cmd_file} has contents which differ.\n" \ + "Expected: {command}.\nActual: {cmd}.")) + else: +run_prepare_war = True +Logger.info(format("Will run prepare war cmd since marker file {prepare_war_cmd_file} is missing.")) + + if run_prepare_war: +# Time-consuming to run +Execute(command, +user=params.oozie_user +) + +return_code, output = shell.call(command, user=params.oozie_user, logoutput=False, quiet=False) +if output is None: + output = "" + +if return_code != 0 or "New Oozie WAR file with added".lower() not in output.lower(): + message = "Unexpected Oozie WAR preparation output {0}".format(output) + Logger.error(message) + raise Fail(message) + +# Generate marker file +File(prepare_war_cmd_file, + content=command, + mode=0644, +) + else: +Logger.info(format("No need to run prepare-war since marker file {prepare_war_cmd_file} already exists.")) + def oozie_server_specific(): import params @@ -259,22 +316,12 @@ def oozie_server_specific(): not_if = no_op_test, ) - prepare_war_cmd_file = format("{oozie_home}/.prepare_war_cmd") - prepare_war_cmd = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war {oozie_secure}") - skip_prepare_war_cmd = format("test -f {prepare_war_cmd_file} && [[ `cat {prepare_war_cmd_file}` == '{prepare_war_cmd}' ]]") +
[11/24] ambari git commit: AMBARI-14957 Paging not working properly when filtering with alerts and hostname. (atkach)
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/branch-dev-patch-upgrade Commit: f734aec99bacb9ec6115574d890b74cc1d9477f5 Parents: 472d62a Author: Andrii TkachAuthored: 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 += '&';
[01/24] ambari git commit: AMBARI-14956. If cluster is not deployed login message is shown 2-3 seconds (alexantonenko)
Repository: ambari Updated Branches: refs/heads/branch-dev-patch-upgrade 697c309c1 -> c543ef8b2 AMBARI-14956. If cluster is not deployed login message is shown 2-3 seconds (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/62f3a3bb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/62f3a3bb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/62f3a3bb Branch: refs/heads/branch-dev-patch-upgrade Commit: 62f3a3bb7f72c5564b45b8d1fd64a567471084c1 Parents: f60472d Author: Alex AntonenkoAuthored: Mon Feb 8 15:56:28 2016 +0200 Committer: Alex Antonenko Committed: Mon Feb 8 17:27:01 2016 +0200 -- ambari-web/app/router.js | 48 +++ 1 file changed, 30 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/62f3a3bb/ambari-web/app/router.js -- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 360480f..809979e 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -320,22 +320,10 @@ App.Router = Em.Router.extend({ App.ajax.send({ name: 'router.login.message', sender: self, -success: 'showLoginMessage' - -}); - - // no need to load cluster data if it's already loaded - if (self.get('clusterData')) { -self.loginGetClustersSuccessCallback(self.get('clusterData'), {}, requestData); - } - else { -App.ajax.send({ - name: 'router.login.clusters', - sender: self, - data: requestData, - success: 'loginGetClustersSuccessCallback' -}); - } +data: requestData, +success: 'showLoginMessage', +error: 'showLoginMessage' + }); }); }, @@ -362,11 +350,12 @@ App.Router = Em.Router.extend({ * success callback of router.login.message * @param {object} data */ - showLoginMessage: function (data){ + showLoginMessage: function (data, opt, params){ var response = JSON.parse(data.Settings.content.replace(/\n/g, "\\n")), text = response.text ? response.text : "", buttonText = response.button ? response.button : Em.I18n.t('ok'), - status = response.status && response.status == "true" ? true : false; + status = response.status && response.status == "true" ? true : false, + self = this; if(text && status){ return App.ModalPopup.show({ @@ -379,9 +368,11 @@ App.Router = Em.Router.extend({ secondary: null, onPrimary: function () { + self.setClusterData(data, opt, params); this.hide(); }, onClose: function () { + self.setClusterData(data, opt, params); this.hide(); }, didInsertElement: function () { @@ -391,6 +382,27 @@ App.Router = Em.Router.extend({ } }, + setClusterData: function (data, opt, params) { +var + self = this, + requestData = { +loginName: params.loginName, +loginData: data + }; +// no need to load cluster data if it's already loaded +if (this.get('clusterData')) { + this.loginGetClustersSuccessCallback(self.get('clusterData'), {}, requestData); +} +else { + App.ajax.send({ +name: 'router.login.clusters', +sender: self, +data: requestData, +success: 'loginGetClustersSuccessCallback' + }); +} + }, + /** * success callback of login request
ambari git commit: AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via yusaku)
Repository: ambari Updated Branches: refs/heads/branch-2.2 0d811cf57 -> 8c9465b09 AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8c9465b0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8c9465b0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8c9465b0 Branch: refs/heads/branch-2.2 Commit: 8c9465b09bd5bc103dd3d194adcfad9726d1659a Parents: 0d811cf Author: Yusaku SakoAuthored: Wed Feb 10 10:05:27 2016 -0800 Committer: Yusaku Sako Committed: Wed Feb 10 10:06:33 2016 -0800 -- ambari-metrics/ambari-metrics-grafana/README.md | 20 +++ .../ambari-metrics/datasource.js| 127 +-- .../ambari-metrics/partials/query.editor.html | 6 +- .../screenshots/20-templating.png | Bin 0 -> 694376 bytes 4 files changed, 82 insertions(+), 71 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8c9465b0/ambari-metrics/ambari-metrics-grafana/README.md -- diff --git a/ambari-metrics/ambari-metrics-grafana/README.md b/ambari-metrics/ambari-metrics-grafana/README.md index 0a138e8..7eb84a7 100644 --- a/ambari-metrics/ambari-metrics-grafana/README.md +++ b/ambari-metrics/ambari-metrics-grafana/README.md @@ -240,4 +240,24 @@ http://GRAFANA_HOST:3000 --- + +### Templating +**Templating allows you to dynamically change graphs by selecting your host from dropdown. To created a templated dashboard, you can follow these steps.** + +> 1. Click on the "cog" on the top, select "Templating" +> 2. Click on "+ New" +> 3. Enter a name for your variable. Ex: "hosts". +> 4. Type: query +> 5. Datasource: This should be set to the name you had chosen for your Datasource. Default is "AMBARI_METRICS" +> 6. Query: This needs to be "hosts". It is case sensitive as well. +> 7. Once you've entered the query and you focus your cursor anywhere else, you should see the "Preview of values" updated with the hostnames in your cluster. +> 8. You can close the Templating Variables section. +> 9. You should now have a dropdown on your dashboard with hosts from your cluster. +> 10. When you now add a graph, and select your component and metric, the plotted graph will show you metrics for the selected hostname from the dropdown. +> 11. The legend on the graph will also now update with the selected host. + +**Templalted dashboards do support multiple metrics in a single graph.** + + +![Templating](screenshots/20-templating.png) http://git-wip-us.apache.org/repos/asf/ambari/blob/8c9465b0/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js -- diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js index 374501c..e89ad0e 100644 --- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js +++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js @@ -27,7 +27,7 @@ define([ var module = angular.module('grafana.services'); - module.factory('AmbariMetricsDatasource', function ($q, backendSrv) { + module.factory('AmbariMetricsDatasource', function ($q, backendSrv, templateSrv) { /** * AMS Datasource Constructor */ @@ -43,7 +43,9 @@ define([ .then(function (items) { allMetrics = []; appIds = []; - var fake = "timeline_metric_store_watcher"; delete items[fake]; + //We remove a couple of components from the list that do not contain any + //pertinent metrics. + delete items.timeline_metric_store_watcher; delete items.amssmoketestfake; for (var key in items) { if (items.hasOwnProperty(key)) { items[key].forEach(function (_item) { @@ -97,10 +99,11 @@ define([ } var series = []; var metricData = res.metrics[0].metrics; + var hostLegend = res.metrics[0].hostname ? ' on ' + res.metrics[0].hostname : ''; var timeSeries = {}; if (target.hosts === undefined || target.hosts.trim() === "") { timeSeries = { - target: target.metric, + target: target.metric + hostLegend, datapoints: [] }; } else { @@ -119,81 +122,42 @@ define([ }; }; - var precisionSetting = ''; + var getHostAppIdData = function(target) { -if (target.shouldAddPrecision) {
ambari git commit: AMBARI-14979. Ambari Upgrade should not automatically add stack properties that reference localhost like dfs.namenode.secondary.http-address, mark with DONT_ADD_ON_UPGRADE (alejandr
Repository: ambari Updated Branches: refs/heads/trunk 4870e1f89 -> 946ac82e7 AMBARI-14979. Ambari Upgrade should not automatically add stack properties that reference localhost like dfs.namenode.secondary.http-address, mark with DONT_ADD_ON_UPGRADE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/946ac82e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/946ac82e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/946ac82e Branch: refs/heads/trunk Commit: 946ac82e7aeabc926ce33a7a6b277a6be1f72f5f Parents: 4870e1f Author: Alejandro FernandezAuthored: Tue Feb 9 13:45:14 2016 -0800 Committer: Alejandro Fernandez Committed: Wed Feb 10 11:27:55 2016 -0800 -- .../ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml | 2 ++ .../ATLAS/0.1.0.2.3/configuration/application-properties.xml | 1 + .../0.5.0.2.1/configuration/falcon-startup.properties.xml| 1 + .../HBASE/0.96.0.2.0/configuration/hbase-site.xml| 1 + .../HDFS/2.1.0.2.0/configuration/core-site.xml | 1 + .../HDFS/2.1.0.2.0/configuration/hdfs-site.xml | 3 +++ .../HIVE/0.12.0.2.0/configuration/hive-site.xml | 3 +++ .../HIVE/0.12.0.2.0/configuration/webhcat-site.xml | 1 + .../KAFKA/0.8.1.2.2/configuration/kafka-broker.xml | 2 ++ .../configuration/ranger-knox-plugin-properties.xml | 1 + .../OOZIE/4.0.0.2.0/configuration/oozie-site.xml | 1 + .../OOZIE/4.2.0.2.3/configuration/oozie-site.xml | 1 + .../RANGER/0.4.0/configuration/ranger-env.xml| 1 + .../RANGER_KMS/0.5.0.2.3/configuration/kms-site.xml | 1 + .../STORM/0.9.1.2.1/configuration/storm-site.xml | 1 + .../YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml | 2 ++ .../YARN/2.1.0.2.0/configuration/yarn-site.xml | 8 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml | 2 ++ .../HDP/2.1/services/OOZIE/configuration/oozie-site.xml | 1 + .../stacks/HDP/2.1/services/YARN/configuration/yarn-site.xml | 3 +++ .../HBASE/configuration/ranger-hbase-plugin-properties.xml | 1 + .../HDFS/configuration/ranger-hdfs-plugin-properties.xml | 4 ++-- .../stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml | 4 .../HIVE/configuration/ranger-hive-plugin-properties.xml | 1 + .../STORM/configuration/ranger-storm-plugin-properties.xml | 1 + .../stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml | 2 ++ .../HDP/2.3/services/KAFKA/configuration/kafka-broker.xml| 1 + .../KAFKA/configuration/ranger-kafka-plugin-properties.xml | 1 + .../HDP/2.3/services/RANGER/configuration/ranger-env.xml | 2 ++ .../HDP/2.3/services/STORM/configuration/storm-site.xml | 2 ++ 30 files changed, 54 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/946ac82e/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml -- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml index 2e75768..c2e0200 100644 --- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml @@ -24,6 +24,7 @@ instance.volumes hdfs://localhost:8020/apps/accumulo/data +DONT_ADD_ON_UPGRADE Location of Accumulo data files in HDFS. false @@ -33,6 +34,7 @@ instance.zookeeper.host localhost:2181 +DONT_ADD_ON_UPGRADE Comma-separated list of ZooKeeper server:port pairs. http://git-wip-us.apache.org/repos/asf/ambari/blob/946ac82e/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml -- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml index 74b1537..ed9f1bc 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml @@ -102,6 +102,7 @@ atlas.server.bind.address localhost +DONT_ADD_ON_UPGRADE
ambari git commit: AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via yusaku)
Repository: ambari Updated Branches: refs/heads/trunk ac5ca8fd1 -> 8f3b9c49d AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8f3b9c49 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8f3b9c49 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8f3b9c49 Branch: refs/heads/trunk Commit: 8f3b9c49d3fecf7db43b16ef8c06571fd2f79ed9 Parents: ac5ca8f Author: Yusaku SakoAuthored: Wed Feb 10 10:05:27 2016 -0800 Committer: Yusaku Sako Committed: Wed Feb 10 10:05:27 2016 -0800 -- ambari-metrics/ambari-metrics-grafana/README.md | 20 +++ .../ambari-metrics/datasource.js| 127 +-- .../ambari-metrics/partials/query.editor.html | 6 +- .../screenshots/20-templating.png | Bin 0 -> 694376 bytes 4 files changed, 82 insertions(+), 71 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3b9c49/ambari-metrics/ambari-metrics-grafana/README.md -- diff --git a/ambari-metrics/ambari-metrics-grafana/README.md b/ambari-metrics/ambari-metrics-grafana/README.md index 0a138e8..7eb84a7 100644 --- a/ambari-metrics/ambari-metrics-grafana/README.md +++ b/ambari-metrics/ambari-metrics-grafana/README.md @@ -240,4 +240,24 @@ http://GRAFANA_HOST:3000 --- + +### Templating +**Templating allows you to dynamically change graphs by selecting your host from dropdown. To created a templated dashboard, you can follow these steps.** + +> 1. Click on the "cog" on the top, select "Templating" +> 2. Click on "+ New" +> 3. Enter a name for your variable. Ex: "hosts". +> 4. Type: query +> 5. Datasource: This should be set to the name you had chosen for your Datasource. Default is "AMBARI_METRICS" +> 6. Query: This needs to be "hosts". It is case sensitive as well. +> 7. Once you've entered the query and you focus your cursor anywhere else, you should see the "Preview of values" updated with the hostnames in your cluster. +> 8. You can close the Templating Variables section. +> 9. You should now have a dropdown on your dashboard with hosts from your cluster. +> 10. When you now add a graph, and select your component and metric, the plotted graph will show you metrics for the selected hostname from the dropdown. +> 11. The legend on the graph will also now update with the selected host. + +**Templalted dashboards do support multiple metrics in a single graph.** + + +![Templating](screenshots/20-templating.png) http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3b9c49/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js -- diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js index 374501c..e89ad0e 100644 --- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js +++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js @@ -27,7 +27,7 @@ define([ var module = angular.module('grafana.services'); - module.factory('AmbariMetricsDatasource', function ($q, backendSrv) { + module.factory('AmbariMetricsDatasource', function ($q, backendSrv, templateSrv) { /** * AMS Datasource Constructor */ @@ -43,7 +43,9 @@ define([ .then(function (items) { allMetrics = []; appIds = []; - var fake = "timeline_metric_store_watcher"; delete items[fake]; + //We remove a couple of components from the list that do not contain any + //pertinent metrics. + delete items.timeline_metric_store_watcher; delete items.amssmoketestfake; for (var key in items) { if (items.hasOwnProperty(key)) { items[key].forEach(function (_item) { @@ -97,10 +99,11 @@ define([ } var series = []; var metricData = res.metrics[0].metrics; + var hostLegend = res.metrics[0].hostname ? ' on ' + res.metrics[0].hostname : ''; var timeSeries = {}; if (target.hosts === undefined || target.hosts.trim() === "") { timeSeries = { - target: target.metric, + target: target.metric + hostLegend, datapoints: [] }; } else { @@ -119,81 +122,42 @@ define([ }; }; - var precisionSetting = ''; + var getHostAppIdData = function(target) { -if (target.shouldAddPrecision) { -
ambari git commit: AMBARI-14865: Auto start - Maintenance mode of components should be respected when handling agent registration.
Repository: ambari Updated Branches: refs/heads/trunk 46bbbf9c2 -> ac5ca8fd1 AMBARI-14865: Auto start - Maintenance mode of components should be respected when handling agent registration. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ac5ca8fd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac5ca8fd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac5ca8fd Branch: refs/heads/trunk Commit: ac5ca8fd1cd51360f7394c1fd85f8a062a4fb8e2 Parents: 46bbbf9 Author: Nahappan SomasundaramAuthored: Mon Feb 1 14:22:15 2016 -0800 Committer: Nahappan Somasundaram Committed: Wed Feb 10 09:27:47 2016 -0800 -- .../main/python/ambari_agent/RecoveryManager.py | 41 +++-- .../test/python/ambari_agent/TestActionQueue.py | 2 +- .../python/ambari_agent/TestRecoveryManager.py | 88 +--- .../ambari/server/agent/HeartBeatHandler.java | 39 - .../ambari/server/agent/RecoveryConfig.java | 18 +--- .../server/agent/TestHeartbeatHandler.java | 78 - 6 files changed, 167 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ac5ca8fd/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py index b5795b2..ed537ca 100644 --- a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py +++ b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py @@ -88,7 +88,6 @@ class RecoveryManager: self.allowed_desired_states = [self.STARTED, self.INSTALLED] self.allowed_current_states = [self.INIT, self.INSTALLED] self.enabled_components = [] -self.disabled_components = [] self.statuses = {} self.__status_lock = threading.RLock() self.__command_lock = threading.RLock() @@ -107,7 +106,7 @@ class RecoveryManager: self.actions = {} -self.update_config(6, 60, 5, 12, recovery_enabled, auto_start_only, "", "") +self.update_config(6, 60, 5, 12, recovery_enabled, auto_start_only, "") pass @@ -213,19 +212,12 @@ class RecoveryManager: pass """ - Whether specific components are enabled/disabled for recovery. Being enabled takes - precedence over being disabled. When specific components are enabled then only - those components are enabled. When specific components are disabled then all of - the other components are enabled. + Whether specific components are enabled for recovery. """ def configured_for_recovery(self, component): -if len(self.disabled_components) == 0 and len(self.enabled_components) == 0: - return True -if len(self.disabled_components) > 0 and component not in self.disabled_components \ -and len(self.enabled_components) == 0: - return True if len(self.enabled_components) > 0 and component in self.enabled_components: return True + return False def requires_recovery(self, component): @@ -547,8 +539,8 @@ class RecoveryManager: "maxCount" : 10, "windowInMinutes" : 60, "retryGap" : 0, - "disabledComponents" : "a,b", - "enabledComponents" : "c,d"} + "components" : "a,b" + } """ recovery_enabled = False @@ -558,7 +550,6 @@ class RecoveryManager: retry_gap = 5 max_lifetime_count = 12 enabled_components = "" -disabled_components = "" if reg_resp and "recoveryConfig" in reg_resp: @@ -578,17 +569,16 @@ class RecoveryManager: if 'maxLifetimeCount' in config: max_lifetime_count = self._read_int_(config['maxLifetimeCount'], max_lifetime_count) - if 'enabledComponents' in config: -enabled_components = config['enabledComponents'] - if 'disabledComponents' in config: -disabled_components = config['disabledComponents'] + if 'components' in config: +enabled_components = config['components'] + self.update_config(max_count, window_in_min, retry_gap, max_lifetime_count, recovery_enabled, auto_start_only, - enabled_components, disabled_components) + enabled_components) pass def update_config(self, max_count, window_in_min, retry_gap, max_lifetime_count, recovery_enabled, -auto_start_only, enabled_components, disabled_components): +auto_start_only, enabled_components): """ Update recovery configuration, recovery is disabled if configuration values are not correct @@ -619,7 +609,6 @@ class RecoveryManager: self.retry_gap_in_sec = retry_gap * 60 self.auto_start_only =
ambari git commit: AMBARI-14972 - Add PK to servicecomponentdesiredstate Table To Support FK Relationships (jonathanhurley) (part2)
Repository: ambari Updated Branches: refs/heads/branch-dev-patch-upgrade c543ef8b2 -> 2a9f49c0e AMBARI-14972 - Add PK to servicecomponentdesiredstate Table To Support FK Relationships (jonathanhurley) (part2) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2a9f49c0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2a9f49c0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2a9f49c0 Branch: refs/heads/branch-dev-patch-upgrade Commit: 2a9f49c0e3a1839076fd271cb7caf09b3fc897f4 Parents: c543ef8 Author: Jonathan HurleyAuthored: Wed Feb 10 12:47:31 2016 -0500 Committer: Jonathan Hurley Committed: Wed Feb 10 12:47:38 2016 -0500 -- .../apache/ambari/funtest/server/tests/DeleteServiceTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2a9f49c0/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java -- diff --git a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java index 472bdc4..747ae95 100644 --- a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java +++ b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java @@ -39,7 +39,6 @@ import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity; import org.apache.ambari.server.orm.entities.HostComponentStateEntity; import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity; import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntityPK; -import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntityPK; import org.apache.ambari.server.state.State; import org.apache.commons.httpclient.HttpStatus; @@ -54,6 +53,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; + /** * Simple test that starts the local ambari server, * tests it's status and shuts down the server. @@ -181,8 +181,7 @@ public class DeleteServiceTest extends ServerTestBase { /** * ServiceComponentDesiredStateDAO */ -ServiceComponentDesiredStateEntityPK serviceComponentDesiredStateEntityPK = injector.getInstance(ServiceComponentDesiredStateEntityPK.class); -ServiceComponentDesiredStateEntity serviceComponentDesiredStateEntity = serviceComponentDesiredStateDAO.findByPK(serviceComponentDesiredStateEntityPK); +ServiceComponentDesiredStateEntity serviceComponentDesiredStateEntity = serviceComponentDesiredStateDAO.findById(0L); assertTrue(serviceComponentDesiredStateEntity == null); /**
ambari git commit: AMBARI-14995 AMS Grafana component should package plugin from source code. (dsen)
Repository: ambari Updated Branches: refs/heads/trunk 8f3b9c49d -> 4870e1f89 AMBARI-14995 AMS Grafana component should package plugin from source code. (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4870e1f8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4870e1f8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4870e1f8 Branch: refs/heads/trunk Commit: 4870e1f89b155521713d63d8feef18f610f44f58 Parents: 8f3b9c4 Author: Dmytro SenAuthored: Wed Feb 10 20:34:26 2016 +0200 Committer: Dmytro Sen Committed: Wed Feb 10 20:34:26 2016 +0200 -- ambari-metrics/ambari-metrics-grafana/pom.xml | 16 ++-- ambari-metrics/pom.xml| 1 - 2 files changed, 6 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4870e1f8/ambari-metrics/ambari-metrics-grafana/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-grafana/pom.xml b/ambari-metrics/ambari-metrics-grafana/pom.xml index 8304416..c737b2b 100644 --- a/ambari-metrics/ambari-metrics-grafana/pom.xml +++ b/ambari-metrics/ambari-metrics-grafana/pom.xml @@ -103,16 +103,12 @@ dest="${project.build.directory}/grafana" compression="gzip" /> - - + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/4870e1f8/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index 9a39122..1f87683 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -52,7 +52,6 @@ hadoop-2.6.0.2.2.4.2-0002 grafana-2.6.0 https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz - https://github.com/u39kun/ambari-grafana/raw/master/dist/ambari-grafana.tgz /usr/lib/python2.6/site-packages/resource_monitoring
ambari git commit: AMBARI-14979. Ambari Upgrade should not automatically add stack properties that reference localhost like dfs.namenode.secondary.http-address, mark with DONT_ADD_ON_UPGRADE (alejandr
Repository: ambari Updated Branches: refs/heads/branch-2.2 1abfb8bd0 -> 99f00ca8a AMBARI-14979. Ambari Upgrade should not automatically add stack properties that reference localhost like dfs.namenode.secondary.http-address, mark with DONT_ADD_ON_UPGRADE (alejandro) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/99f00ca8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/99f00ca8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/99f00ca8 Branch: refs/heads/branch-2.2 Commit: 99f00ca8a9e1e777cd2e1d27470c984c4771dfef Parents: 1abfb8b Author: Alejandro FernandezAuthored: Mon Feb 8 18:39:58 2016 -0800 Committer: Alejandro Fernandez Committed: Wed Feb 10 11:27:00 2016 -0800 -- .../ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml | 2 ++ .../ATLAS/0.1.0.2.3/configuration/application-properties.xml | 1 + .../0.5.0.2.1/configuration/falcon-startup.properties.xml| 1 + .../HBASE/0.96.0.2.0/configuration/hbase-site.xml| 1 + .../HDFS/2.1.0.2.0/configuration/core-site.xml | 1 + .../HDFS/2.1.0.2.0/configuration/hdfs-site.xml | 3 +++ .../HIVE/0.12.0.2.0/configuration/hive-site.xml | 3 +++ .../HIVE/0.12.0.2.0/configuration/webhcat-site.xml | 1 + .../KAFKA/0.8.1.2.2/configuration/kafka-broker.xml | 2 ++ .../configuration/ranger-knox-plugin-properties.xml | 1 + .../OOZIE/4.0.0.2.0/configuration/oozie-site.xml | 1 + .../OOZIE/4.2.0.2.3/configuration/oozie-site.xml | 1 + .../RANGER/0.4.0/configuration/ranger-env.xml| 1 + .../RANGER_KMS/0.5.0.2.3/configuration/kms-site.xml | 1 + .../STORM/0.9.1.2.1/configuration/storm-site.xml | 1 + .../YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml | 2 ++ .../YARN/2.1.0.2.0/configuration/yarn-site.xml | 8 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml | 2 ++ .../HDP/2.1/services/OOZIE/configuration/oozie-site.xml | 1 + .../stacks/HDP/2.1/services/YARN/configuration/yarn-site.xml | 3 +++ .../HBASE/configuration/ranger-hbase-plugin-properties.xml | 1 + .../HDFS/configuration/ranger-hdfs-plugin-properties.xml | 4 ++-- .../stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml | 4 .../HIVE/configuration/ranger-hive-plugin-properties.xml | 1 + .../STORM/configuration/ranger-storm-plugin-properties.xml | 1 + .../stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml | 2 ++ .../HDP/2.3/services/KAFKA/configuration/kafka-broker.xml| 1 + .../KAFKA/configuration/ranger-kafka-plugin-properties.xml | 1 + .../2.3/services/RANGER/configuration/ranger-admin-site.xml | 1 + .../HDP/2.3/services/RANGER/configuration/ranger-env.xml | 2 ++ .../HDP/2.3/services/STORM/configuration/storm-site.xml | 2 ++ 31 files changed, 55 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/99f00ca8/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml -- diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml index 2e75768..c2e0200 100644 --- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml +++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml @@ -24,6 +24,7 @@ instance.volumes hdfs://localhost:8020/apps/accumulo/data +DONT_ADD_ON_UPGRADE Location of Accumulo data files in HDFS. false @@ -33,6 +34,7 @@ instance.zookeeper.host localhost:2181 +DONT_ADD_ON_UPGRADE Comma-separated list of ZooKeeper server:port pairs. http://git-wip-us.apache.org/repos/asf/ambari/blob/99f00ca8/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml -- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml index 82dacb6..986dfa1 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml @@ -102,6 +102,7 @@ atlas.server.bind.address
[2/2] ambari git commit: AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan)
AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0d52ebc0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0d52ebc0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0d52ebc0 Branch: refs/heads/trunk Commit: 0d52ebc05593ebce6e3ab37535bf1345df8f8492 Parents: 49e3351 Author: Aravindan VijayanAuthored: Wed Feb 10 12:29:23 2016 -0800 Committer: Aravindan Vijayan Committed: Wed Feb 10 12:29:23 2016 -0800 -- .../0.1.0/package/scripts/metrics_grafana_util.py | 6 -- .../0.1.0/package/templates/metrics_grafana_datasource.json.j2 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0d52ebc0/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 index c4a91e1..5ab40b0 100644 --- 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 @@ -58,8 +58,9 @@ def create_ams_datasource(): Logger.info("Ambari Metrics Grafana datasource already present. Checking Metrics Collector URL") datasource_url = datasources_json[i]["url"] -if datasource_url == (params.metric_collector_host + ":" + params.metric_collector_port - + "/ws/v1/timeline/metrics") : +if datasource_url == (params.ams_grafana_protocol + "://" ++ params.metric_collector_host + ":" ++ params.metric_collector_port): Logger.info("Metrics Collector URL validation succeeded. Skipping datasource creation") GRAFANA_CONNECT_TRIES = 0 # No need to create datasource again @@ -84,6 +85,7 @@ def create_ams_datasource(): try: ams_datasource_json = Template('metrics_grafana_datasource.json.j2', ams_datasource_name=METRICS_GRAFANA_DATASOURCE_NAME, + ams_grafana_protocol=params.ams_grafana_protocol, ams_collector_host=params.metric_collector_host, ams_collector_port=params.metric_collector_port).get_content() http://git-wip-us.apache.org/repos/asf/ambari/blob/0d52ebc0/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 1b03a2d..a803da5 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 @@ -20,7 +20,7 @@ "name": "{{ams_datasource_name}}", "type": "ambarimetrics", "access": "proxy", - "url": "{{ams_collector_host}}:{{ams_collector_port}}/ws/v1/timeline/metrics", + "url": "{{ams_grafana_protocol}}://{{ams_collector_host}}:{{ams_collector_port}}", "password": "", "user": "", "database": "",
ambari git commit: AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly Escaped (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/branch-2.2 99f00ca8a -> 238a7698d AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly Escaped (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/238a7698 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/238a7698 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/238a7698 Branch: refs/heads/branch-2.2 Commit: 238a7698d1d5e9867e8f6f5ae009368d53db0bf3 Parents: 99f00ca Author: Jonathan HurleyAuthored: Tue Feb 9 18:38:55 2016 -0500 Committer: Jonathan Hurley Committed: Wed Feb 10 15:14:39 2016 -0500 -- ambari-project/pom.xml | 2 +- ambari-server/pom.xml | 5 -- .../dispatchers/AlertScriptDispatcher.java | 18 +- .../services/AlertNoticeDispatchService.java| 2 +- .../state/services/CachedAlertFlushService.java | 2 +- .../dispatchers/AlertScriptDispatcherTest.java | 61 6 files changed, 80 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/238a7698/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index 4d0b3af..4384298 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -220,7 +220,7 @@ com.google.guava guava -14.0.1 +16.0 com.google.code.findbugs http://git-wip-us.apache.org/repos/asf/ambari/blob/238a7698/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index b292565..39ca740 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1904,11 +1904,6 @@ 4.2.5 - com.google.guava - guava - 14.0.1 - - com.google.code.findbugs jsr305 1.3.9 http://git-wip-us.apache.org/repos/asf/ambari/blob/238a7698/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java index 092aaf4..907588d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java @@ -40,6 +40,8 @@ import org.apache.commons.lang.SystemUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.escape.Escaper; +import com.google.common.escape.Escapers; import com.google.inject.Inject; /** @@ -82,6 +84,18 @@ public class AlertScriptDispatcher implements NotificationDispatcher { private static final long DEFAULT_SCRIPT_TIMEOUT = 5000L; /** + * Used to escape text being passed into the shell command. + */ + public static final Escaper SHELL_ESCAPE; + + static { +final Escapers.Builder builder = Escapers.builder(); +builder.addEscape('\"', "\\\""); +builder.addEscape('!', "\\!"); +SHELL_ESCAPE = builder.build(); + } + + /** * Configuration data from the ambari.properties file. */ @Inject @@ -242,8 +256,8 @@ public class AlertScriptDispatcher implements NotificationDispatcher { // these could have spaces in them, so quote them so they don't mess up the // command line -String alertLabel = "\"" + definition.getLabel() + "\""; -String alertText = "\"" + alertInfo.getAlertText() + "\""; +String alertLabel = "\"" + SHELL_ESCAPE.escape(definition.getLabel()) + "\""; +String alertText = "\"" + SHELL_ESCAPE.escape(alertInfo.getAlertText()) + "\""; Object[] params = new Object[] { script, definitionName, alertLabel, serviceName, alertState.name(), alertText }; http://git-wip-us.apache.org/repos/asf/ambari/blob/238a7698/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java index 3a88f37..a27bc1d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java +++
ambari git commit: AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly Escaped (jonathanhurley)
Repository: ambari Updated Branches: refs/heads/trunk 946ac82e7 -> 5e6a5556b AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly Escaped (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5e6a5556 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5e6a5556 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5e6a5556 Branch: refs/heads/trunk Commit: 5e6a5556b2a40435c6d35d7851e88d896350f53d Parents: 946ac82 Author: Jonathan HurleyAuthored: Tue Feb 9 18:38:55 2016 -0500 Committer: Jonathan Hurley Committed: Wed Feb 10 15:12:42 2016 -0500 -- ambari-funtest/pom.xml | 5 -- ambari-project/pom.xml | 2 +- ambari-server/pom.xml | 5 -- .../dispatchers/AlertScriptDispatcher.java | 18 +- .../services/AlertNoticeDispatchService.java| 2 +- .../state/services/CachedAlertFlushService.java | 2 +- .../dispatchers/AlertScriptDispatcherTest.java | 61 7 files changed, 80 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-funtest/pom.xml -- diff --git a/ambari-funtest/pom.xml b/ambari-funtest/pom.xml index b9c591f..4fa342f 100644 --- a/ambari-funtest/pom.xml +++ b/ambari-funtest/pom.xml @@ -496,11 +496,6 @@ 4.2.5 - com.google.guava - guava - 14.0.1 - - com.google.code.findbugs jsr305 1.3.9 http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index f19ca14..ed94004 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -220,7 +220,7 @@ com.google.guava guava -14.0.1 +16.0 com.google.code.findbugs http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index b500fb2..51fd88b 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1179,11 +1179,6 @@ 4.2.5 - com.google.guava - guava - 14.0.1 - - com.google.code.findbugs jsr305 1.3.9 http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java index 092aaf4..907588d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java @@ -40,6 +40,8 @@ import org.apache.commons.lang.SystemUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.escape.Escaper; +import com.google.common.escape.Escapers; import com.google.inject.Inject; /** @@ -82,6 +84,18 @@ public class AlertScriptDispatcher implements NotificationDispatcher { private static final long DEFAULT_SCRIPT_TIMEOUT = 5000L; /** + * Used to escape text being passed into the shell command. + */ + public static final Escaper SHELL_ESCAPE; + + static { +final Escapers.Builder builder = Escapers.builder(); +builder.addEscape('\"', "\\\""); +builder.addEscape('!', "\\!"); +SHELL_ESCAPE = builder.build(); + } + + /** * Configuration data from the ambari.properties file. */ @Inject @@ -242,8 +256,8 @@ public class AlertScriptDispatcher implements NotificationDispatcher { // these could have spaces in them, so quote them so they don't mess up the // command line -String alertLabel = "\"" + definition.getLabel() + "\""; -String alertText = "\"" + alertInfo.getAlertText() + "\""; +String alertLabel = "\"" + SHELL_ESCAPE.escape(definition.getLabel()) + "\""; +String alertText = "\"" + SHELL_ESCAPE.escape(alertInfo.getAlertText()) + "\""; Object[] params = new Object[] { script, definitionName, alertLabel, serviceName, alertState.name(), alertText };
[1/2] ambari git commit: AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan)
Repository: ambari Updated Branches: refs/heads/trunk 5e6a5556b -> 0d52ebc05 AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/49e33511 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/49e33511 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/49e33511 Branch: refs/heads/trunk Commit: 49e33511c4306e2c4f43916405ff223cdd901d97 Parents: 5e6a555 Author: Aravindan VijayanAuthored: Wed Feb 10 12:28:26 2016 -0800 Committer: Aravindan Vijayan Committed: Wed Feb 10 12:28:26 2016 -0800 -- .../timeline/HBaseTimelineMetricStore.java | 18 +-- .../metrics/timeline/PhoenixHBaseAccessor.java | 21 ++-- .../timeline/TimelineMetricConfiguration.java | 10 ++ .../server/upgrade/UpgradeCatalog222.java | 116 ++- .../0.1.0/configuration/ams-site.xml| 37 -- .../stacks/HDP/2.0.6/services/stack_advisor.py | 5 +- .../server/upgrade/UpgradeCatalog222Test.java | 21 +++- .../stacks/2.2/common/test_stack_advisor.py | 5 +- 8 files changed, 203 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/49e33511/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java index 5ee8b44..b5ec6e8 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java @@ -143,14 +143,16 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin aggregatorDailyThread.start(); } - int initDelay = configuration.getTimelineMetricsServiceWatcherInitDelay(); - int delay = configuration.getTimelineMetricsServiceWatcherDelay(); - // Start the watchdog - executorService.scheduleWithFixedDelay( -new TimelineMetricStoreWatcher(this, configuration), initDelay, delay, -TimeUnit.SECONDS); - LOG.info("Started watchdog for timeline metrics store with initial " + -"delay = " + initDelay + ", delay = " + delay); + if (!configuration.isTimelineMetricsServiceWatcherDisabled()) { +int initDelay = configuration.getTimelineMetricsServiceWatcherInitDelay(); +int delay = configuration.getTimelineMetricsServiceWatcherDelay(); +// Start the watchdog +executorService.scheduleWithFixedDelay( + new TimelineMetricStoreWatcher(this, configuration), initDelay, delay, + TimeUnit.SECONDS); +LOG.info("Started watchdog for timeline metrics store with initial " + + "delay = " + initDelay + ", delay = " + delay); + } isInitialized = true; } http://git-wip-us.apache.org/repos/asf/ambari/blob/49e33511/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java index 7fa1d2d..1c86ebb 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java @@ -221,14 +221,14 @@ public class PhoenixHBaseAccessor { String encoding = metricsConf.get(HBASE_ENCODING_SCHEME, DEFAULT_ENCODING); String compression = metricsConf.get(HBASE_COMPRESSION_SCHEME, DEFAULT_TABLE_COMPRESSION); -String precisionTtl = metricsConf.get(PRECISION_TABLE_TTL, "86400"); //1 day -String hostMinTtl =
[2/2] ambari git commit: AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan)
AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e42e05af Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e42e05af Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e42e05af Branch: refs/heads/branch-2.2 Commit: e42e05af08f877005de2cf5c8eccd332e146795a Parents: 238a769 Author: Aravindan VijayanAuthored: Wed Feb 10 09:50:19 2016 -0800 Committer: Aravindan Vijayan Committed: Wed Feb 10 12:21:21 2016 -0800 -- .../timeline/HBaseTimelineMetricStore.java | 18 +-- .../metrics/timeline/PhoenixHBaseAccessor.java | 21 ++-- .../timeline/TimelineMetricConfiguration.java | 10 ++ .../server/upgrade/UpgradeCatalog222.java | 116 ++- .../0.1.0/configuration/ams-site.xml| 37 -- .../stacks/HDP/2.0.6/services/stack_advisor.py | 5 +- .../server/upgrade/UpgradeCatalog222Test.java | 24 +++- .../stacks/2.2/common/test_stack_advisor.py | 5 +- 8 files changed, 205 insertions(+), 31 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e42e05af/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java index 5ee8b44..b5ec6e8 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java @@ -143,14 +143,16 @@ public class HBaseTimelineMetricStore extends AbstractService implements Timelin aggregatorDailyThread.start(); } - int initDelay = configuration.getTimelineMetricsServiceWatcherInitDelay(); - int delay = configuration.getTimelineMetricsServiceWatcherDelay(); - // Start the watchdog - executorService.scheduleWithFixedDelay( -new TimelineMetricStoreWatcher(this, configuration), initDelay, delay, -TimeUnit.SECONDS); - LOG.info("Started watchdog for timeline metrics store with initial " + -"delay = " + initDelay + ", delay = " + delay); + if (!configuration.isTimelineMetricsServiceWatcherDisabled()) { +int initDelay = configuration.getTimelineMetricsServiceWatcherInitDelay(); +int delay = configuration.getTimelineMetricsServiceWatcherDelay(); +// Start the watchdog +executorService.scheduleWithFixedDelay( + new TimelineMetricStoreWatcher(this, configuration), initDelay, delay, + TimeUnit.SECONDS); +LOG.info("Started watchdog for timeline metrics store with initial " + + "delay = " + initDelay + ", delay = " + delay); + } isInitialized = true; } http://git-wip-us.apache.org/repos/asf/ambari/blob/e42e05af/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java index 71e65f7..aa930bd 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java @@ -219,14 +219,14 @@ public class PhoenixHBaseAccessor { String encoding = metricsConf.get(HBASE_ENCODING_SCHEME, DEFAULT_ENCODING); String compression = metricsConf.get(HBASE_COMPRESSION_SCHEME, DEFAULT_TABLE_COMPRESSION); -String precisionTtl = metricsConf.get(PRECISION_TABLE_TTL, "86400"); //1 day -String hostMinTtl = metricsConf.get(HOST_MINUTE_TABLE_TTL, "604800"); //7 days -String
[1/2] ambari git commit: AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan)
Repository: ambari Updated Branches: refs/heads/branch-2.2 238a7698d -> 20aaff5fa AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/20aaff5f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/20aaff5f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/20aaff5f Branch: refs/heads/branch-2.2 Commit: 20aaff5faf2468c8839fa54eb1f8603786b37e5b Parents: e42e05a Author: Aravindan VijayanAuthored: Wed Feb 10 12:21:14 2016 -0800 Committer: Aravindan Vijayan Committed: Wed Feb 10 12:21:21 2016 -0800 -- .../0.1.0/package/scripts/metrics_grafana_util.py | 6 -- .../0.1.0/package/templates/metrics_grafana_datasource.json.j2 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/20aaff5f/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 index c4a91e1..5ab40b0 100644 --- 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 @@ -58,8 +58,9 @@ def create_ams_datasource(): Logger.info("Ambari Metrics Grafana datasource already present. Checking Metrics Collector URL") datasource_url = datasources_json[i]["url"] -if datasource_url == (params.metric_collector_host + ":" + params.metric_collector_port - + "/ws/v1/timeline/metrics") : +if datasource_url == (params.ams_grafana_protocol + "://" ++ params.metric_collector_host + ":" ++ params.metric_collector_port): Logger.info("Metrics Collector URL validation succeeded. Skipping datasource creation") GRAFANA_CONNECT_TRIES = 0 # No need to create datasource again @@ -84,6 +85,7 @@ def create_ams_datasource(): try: ams_datasource_json = Template('metrics_grafana_datasource.json.j2', ams_datasource_name=METRICS_GRAFANA_DATASOURCE_NAME, + ams_grafana_protocol=params.ams_grafana_protocol, ams_collector_host=params.metric_collector_host, ams_collector_port=params.metric_collector_port).get_content() http://git-wip-us.apache.org/repos/asf/ambari/blob/20aaff5f/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 1b03a2d..a803da5 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 @@ -20,7 +20,7 @@ "name": "{{ams_datasource_name}}", "type": "ambarimetrics", "access": "proxy", - "url": "{{ams_collector_host}}:{{ams_collector_port}}/ws/v1/timeline/metrics", + "url": "{{ams_grafana_protocol}}://{{ams_collector_host}}:{{ams_collector_port}}", "password": "", "user": "", "database": "",
ambari git commit: AMBARI-14983. Auto-start services: Show list of Services/Component with status indicator (Zhe (Joe) Wang via srimanth)
Repository: ambari Updated Branches: refs/heads/trunk 0d52ebc05 -> 364ee0269 AMBARI-14983. Auto-start services: Show list of Services/Component with status indicator (Zhe (Joe) Wang via srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/364ee026 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/364ee026 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/364ee026 Branch: refs/heads/trunk Commit: 364ee0269f1fecfd58e7bdfca846270850db040f Parents: 0d52ebc Author: Srimanth GunturiAuthored: Wed Feb 10 12:38:42 2016 -0800 Committer: Srimanth Gunturi Committed: Wed Feb 10 12:38:48 2016 -0800 -- .../main/admin/service_auto_start.js| 161 ++- ambari-web/app/routes/main.js | 8 + ambari-web/app/styles/application.less | 5 + .../templates/main/admin/service_auto_start.hbs | 46 +- .../service_auto_start/component_auto_start.hbs | 19 +++ ambari-web/app/utils/ajax/ajax.js | 21 +++ ambari-web/app/views.js | 1 + .../app/views/main/admin/service_auto_start.js | 14 +- .../service_auto_start/component_auto_start.js | 57 +++ 9 files changed, 319 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/364ee026/ambari-web/app/controllers/main/admin/service_auto_start.js -- diff --git a/ambari-web/app/controllers/main/admin/service_auto_start.js b/ambari-web/app/controllers/main/admin/service_auto_start.js index fd288ed..4071292 100644 --- a/ambari-web/app/controllers/main/admin/service_auto_start.js +++ b/ambari-web/app/controllers/main/admin/service_auto_start.js @@ -21,6 +21,11 @@ var App = require('app'); App.MainAdminServiceAutoStartController = Em.Controller.extend({ name: 'mainAdminServiceAutoStartController', + clusterConfigs: null, + componentsConfigs: [], + isSaveDisabled: true, + valueChanged: false, + loadClusterConfig: function () { return App.ajax.send({ name: 'config.tags.site', @@ -31,6 +36,161 @@ App.MainAdminServiceAutoStartController = Em.Controller.extend({ }); }, + loadComponentsConfigs: function () { +return App.ajax.send({ + name: 'components.get_category', + sender: this, + success: 'loadComponentsConfigsSuccess' +}); + }, + + loadComponentsConfigsSuccess: function (data) { +this.set('componentsConfigs', data.items); + }, + + tabs: function() { +var services = {}; +var tabs = []; +this.get('componentsConfigs').forEach(function(component) { + var serviceComponentInfo = component.ServiceComponentInfo; + if (serviceComponentInfo.category === "MASTER" || serviceComponentInfo.category === "SLAVE") { +var componentRecovery = Ember.Object.create({ + display_name: App.format.role(serviceComponentInfo.component_name), + component_name: serviceComponentInfo.component_name, + //recovery_enabled: serviceComponentInfo.recovery_enabled === 'true', + recovery_enabled: false, + valueChanged: false, + service_name: serviceComponentInfo.service_name +}); +if (services[serviceComponentInfo.service_name]) { + services[serviceComponentInfo.service_name].get('componentRecovery').push(componentRecovery); + services[serviceComponentInfo.service_name].set('enabledComponents', services[serviceComponentInfo.service_name].get('enabledComponents') + (componentRecovery.get('recovery_enabled') ? 1 : 0)); + services[serviceComponentInfo.service_name].set('totalComponents', services[serviceComponentInfo.service_name].get('totalComponents') + 1); +} else { + services[serviceComponentInfo.service_name] = Ember.Object.create({ +service_name: serviceComponentInfo.service_name, +display_name: App.format.role(serviceComponentInfo.service_name), +headingClass: "." + serviceComponentInfo.service_name, +isActive: false, +componentRecovery: [componentRecovery], +enabledComponents: componentRecovery.recovery_enabled ? 1 : 0, +totalComponents: 1, +indicator: function() { + var percentage = this.get('enabledComponents') / this.get('totalComponents'); + var indicator = "icon-adjust"; + if (percentage === 1) { +indicator = "icon-circle"; + } else if (percentage === 0) { +indicator = "icon-circle-blank"; + } + return indicator; +}.property('enabledComponents', 'totalComponents') + }); +} + } +
ambari git commit: AMBARI-14995 AMS Grafana component should package plugin from source code. (dsen)
Repository: ambari Updated Branches: refs/heads/branch-2.2 8c9465b09 -> 1abfb8bd0 AMBARI-14995 AMS Grafana component should package plugin from source code. (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1abfb8bd Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1abfb8bd Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1abfb8bd Branch: refs/heads/branch-2.2 Commit: 1abfb8bd07faded1d206aca8fb7070e703fc8a99 Parents: 8c9465b Author: Dmytro SenAuthored: Wed Feb 10 20:34:26 2016 +0200 Committer: Dmytro Sen Committed: Wed Feb 10 20:37:01 2016 +0200 -- ambari-metrics/ambari-metrics-grafana/pom.xml | 16 ++-- ambari-metrics/pom.xml| 1 - 2 files changed, 6 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1abfb8bd/ambari-metrics/ambari-metrics-grafana/pom.xml -- diff --git a/ambari-metrics/ambari-metrics-grafana/pom.xml b/ambari-metrics/ambari-metrics-grafana/pom.xml index 2f83c3c..391b0e9 100644 --- a/ambari-metrics/ambari-metrics-grafana/pom.xml +++ b/ambari-metrics/ambari-metrics-grafana/pom.xml @@ -103,16 +103,12 @@ dest="${project.build.directory}/grafana" compression="gzip" /> - - + + + + + http://git-wip-us.apache.org/repos/asf/ambari/blob/1abfb8bd/ambari-metrics/pom.xml -- diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml index 8a10faf..8c53cd7 100644 --- a/ambari-metrics/pom.xml +++ b/ambari-metrics/pom.xml @@ -47,7 +47,6 @@ hadoop-2.6.0.2.2.4.2-0002 grafana-2.6.0 https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz - https://github.com/u39kun/ambari-grafana/raw/master/dist/ambari-grafana.tgz /usr/lib/python2.6/site-packages/resource_monitoring
ambari git commit: AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in HA mode (missing part) (bhuvnesh2703 via jaoki)
Repository: ambari Updated Branches: refs/heads/trunk 364ee0269 -> c147b27e9 AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in HA mode (missing part) (bhuvnesh2703 via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c147b27e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c147b27e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c147b27e Branch: refs/heads/trunk Commit: c147b27e9bb886ba0380e2b926903343a568ad9d Parents: 364ee02 Author: Jun AokiAuthored: Wed Feb 10 16:45:15 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 10 16:45:15 2016 -0800 -- .../resources/common-services/HAWQ/2.0.0/metainfo.xml | 10 ++ .../HAWQ/2.0.0/package/scripts/hawq_constants.py | 1 + .../HAWQ/2.0.0/package/scripts/hawqstandby.py | 6 -- 3 files changed, 15 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml -- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml index 21ab445..ce625eb 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml @@ -76,6 +76,16 @@ PYTHON 600 + + + ACTIVATE_STANDBY + +scripts/hawqstandby.py +PYTHON +1200 + + + HDFS/HDFS_CLIENT http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py -- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py index 01de99a..6a2d9ba 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py @@ -27,6 +27,7 @@ YARN = "yarn" CLUSTER = "cluster" IMMEDIATE = "immediate" FAST = "fast" +ACTIVATE = "activate" # Users root_user = "root" http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py -- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py index 7f5bab4..7da7f6d 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py @@ -51,8 +51,10 @@ class HawqStandby(Script): from hawqstatus import get_pid_file check_process_status(get_pid_file()) - def activatestandby(self, env): -pass + def activate_standby(self, env): +import utils +utils.exec_hawq_operation(hawq_constants.ACTIVATE, "{0} -a -M {1} -v".format(hawq_constants.STANDBY, hawq_constants.FAST)) + if __name__ == "__main__": HawqStandby().execute()
ambari git commit: AMBARI-14881: Enable/Disable Custom Commands on Host Component page (goutamtadi via jaoki)
Repository: ambari Updated Branches: refs/heads/branch-2.2 20aaff5fa -> c98abf3a6 AMBARI-14881: Enable/Disable Custom Commands on Host Component page (goutamtadi via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c98abf3a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c98abf3a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c98abf3a Branch: refs/heads/branch-2.2 Commit: c98abf3a6489489b07481724f607b5bf3c684f5d Parents: 20aaff5 Author: Jun AokiAuthored: Wed Feb 10 16:22:25 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 10 16:22:25 2016 -0800 -- ambari-web/app/templates/main/host/details/host_component.hbs | 2 +- ambari-web/app/views/main/host/details/host_component_view.js | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c98abf3a/ambari-web/app/templates/main/host/details/host_component.hbs -- diff --git a/ambari-web/app/templates/main/host/details/host_component.hbs b/ambari-web/app/templates/main/host/details/host_component.hbs index 23cdb7c..69dc598 100644 --- a/ambari-web/app/templates/main/host/details/host_component.hbs +++ b/ambari-web/app/templates/main/host/details/host_component.hbs @@ -134,7 +134,7 @@ {{/if}} {{#each command in view.customCommands}} - + {{command.label}} {{/each}} http://git-wip-us.apache.org/repos/asf/ambari/blob/c98abf3a/ambari-web/app/views/main/host/details/host_component_view.js -- diff --git a/ambari-web/app/views/main/host/details/host_component_view.js b/ambari-web/app/views/main/host/details/host_component_view.js index 9aabe42..bef5517 100644 --- a/ambari-web/app/views/main/host/details/host_component_view.js +++ b/ambari-web/app/views/main/host/details/host_component_view.js @@ -329,14 +329,15 @@ App.HostComponentView = Em.View.extend({ return; } - var isContextPresent = command in App.HostComponentActionMap.getMap(self) && App.HostComponentActionMap.getMap(self)[command].context; + var commandMap = App.HostComponentActionMap.getMap(self)[command]; customCommands.push({ label: self.getCustomCommandLabel(command), service: component.get('serviceName'), hosts: hostComponent.get('hostName'), -context: isContextPresent ? App.HostComponentActionMap.getMap(self)[command].context : null, +context: (!!commandMap && !!commandMap.context) ? commandMap.context : null, component: component.get('componentName'), -command: command +command: command, +disabled: !!commandMap ? !!commandMap.disabled : false }); });
[1/2] ambari git commit: AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.2 e191a4fe4 -> 0d811cf57 refs/heads/trunk feb50e3a3 -> 46bbbf9c2 AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46bbbf9c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46bbbf9c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46bbbf9c Branch: refs/heads/trunk Commit: 46bbbf9c2c72b52f107d4d929ab3dc6dc05577d4 Parents: feb50e3 Author: Andrew OnishukAuthored: Wed Feb 10 13:20:54 2016 +0200 Committer: Andrew Onishuk Committed: Wed Feb 10 13:20:54 2016 +0200 -- .../src/main/python/ambari_server/serverSetup.py | 17 - 1 file changed, 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/46bbbf9c/ambari-server/src/main/python/ambari_server/serverSetup.py -- diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py index 511da27..c370257 100644 --- a/ambari-server/src/main/python/ambari_server/serverSetup.py +++ b/ambari-server/src/main/python/ambari_server/serverSetup.py @@ -432,23 +432,6 @@ class JDKSetup(object): else: progress_func = download_progress -if get_silent(): - if not java_home_var: -#No java_home_var set, detect if java is already installed -if os.environ.has_key(JAVA_HOME): - args.java_home = os.environ[JAVA_HOME] - - properties.process_pair(JAVA_HOME_PROPERTY, args.java_home) - properties.removeOldProp(JDK_NAME_PROPERTY) - properties.removeOldProp(JCE_NAME_PROPERTY) - - self._ensure_java_home_env_var_is_set(args.java_home) - self.jdk_index = self.custom_jdk_number - return -else: - # For now, changing the existing JDK to make sure we use a supported one - pass - if java_home_var: change_jdk = get_YN_input("Do you want to change Oracle JDK [y/n] (n)? ", False) if not change_jdk:
[2/2] ambari git commit: AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk)
AMBARI-14990. 'ambari-server setup -s' should not pickup $JAVA_HOME as jdk location (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0d811cf5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0d811cf5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0d811cf5 Branch: refs/heads/branch-2.2 Commit: 0d811cf57a326b360dfb0f71247979c31674d8a4 Parents: e191a4f Author: Andrew OnishukAuthored: Wed Feb 10 13:20:58 2016 +0200 Committer: Andrew Onishuk Committed: Wed Feb 10 13:20:58 2016 +0200 -- .../src/main/python/ambari_server/serverSetup.py | 17 - 1 file changed, 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0d811cf5/ambari-server/src/main/python/ambari_server/serverSetup.py -- diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py index 511da27..c370257 100644 --- a/ambari-server/src/main/python/ambari_server/serverSetup.py +++ b/ambari-server/src/main/python/ambari_server/serverSetup.py @@ -432,23 +432,6 @@ class JDKSetup(object): else: progress_func = download_progress -if get_silent(): - if not java_home_var: -#No java_home_var set, detect if java is already installed -if os.environ.has_key(JAVA_HOME): - args.java_home = os.environ[JAVA_HOME] - - properties.process_pair(JAVA_HOME_PROPERTY, args.java_home) - properties.removeOldProp(JDK_NAME_PROPERTY) - properties.removeOldProp(JCE_NAME_PROPERTY) - - self._ensure_java_home_env_var_is_set(args.java_home) - self.jdk_index = self.custom_jdk_number - return -else: - # For now, changing the existing JDK to make sure we use a supported one - pass - if java_home_var: change_jdk = get_YN_input("Do you want to change Oracle JDK [y/n] (n)? ", False) if not change_jdk:
ambari git commit: Revert "AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB (onechiporenko)"
Repository: ambari Updated Branches: refs/heads/trunk 3242a5590 -> ba604ea6b Revert "AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB (onechiporenko)" This reverts commit e139ef57ce0ec3d705489a36cb2d7cc78f6458c1. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ba604ea6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ba604ea6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ba604ea6 Branch: refs/heads/trunk Commit: ba604ea6be57bcbd5cff2219b0d821e6ff16d695 Parents: 3242a55 Author: Yusaku SakoAuthored: Wed Feb 10 17:28:20 2016 -0800 Committer: Yusaku Sako Committed: Wed Feb 10 17:28:20 2016 -0800 -- .../manage_alert_notifications_controller.js| 74 +--- ...anage_alert_notifications_controller_test.js | 121 --- .../views/common/log_file_search_view_test.js | 3 +- 3 files changed, 82 insertions(+), 116 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ba604ea6/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js -- diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js index 244b8f0..79e524e 100644 --- a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js +++ b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js @@ -61,7 +61,9 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ value: '', defaultValue: 'custom', disabled: false, - isAll: Em.computed.equal('value', 'all') + isAll: function () { +return this.get('value') == 'all'; + }.property('value') }), method: { label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.method'), @@ -157,7 +159,7 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ * used in Type combobox * @type {Array} */ - methods: ['EMAIL', 'SNMP', 'Custom SNMP'], + methods: ['EMAIL', 'SNMP'], /** * List of available value for Severity Filter @@ -218,8 +220,7 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ 'mail.smtp.from', 'mail.smtp.host', 'mail.smtp.port', -'mail.smtp.starttls.enable', -'ambari.dispatch-property.script' +'mail.smtp.starttls.enable' ], validationMap: { @@ -241,16 +242,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ validator: 'retypePasswordValidation' } ], -'Custom SNMP': [ - { -errorKey: 'portError', -validator: 'portValidation' - }, - { -errorKey: 'hostError', -validator: 'hostsValidation' - } -], SNMP: [ { errorKey: 'portError', @@ -331,25 +322,24 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ fillEditCreateInputs: function (addCopyToName) { var inputFields = this.get('inputFields'); var selectedAlertNotification = this.get('selectedAlertNotification'); -var props = selectedAlertNotification.get('properties'); inputFields.set('name.value', (addCopyToName ? 'Copy of ' : '') + selectedAlertNotification.get('name')); inputFields.set('groups.value', selectedAlertNotification.get('groups').toArray()); -inputFields.set('email.value', props['ambari.dispatch.recipients'] ? - props['ambari.dispatch.recipients'].join(', ') : ''); -inputFields.set('SMTPServer.value', props['mail.smtp.host']); -inputFields.set('SMTPPort.value', props['mail.smtp.port']); -inputFields.set('SMTPUseAuthentication.value', props['mail.smtp.auth'] !== "false"); -inputFields.set('SMTPUsername.value', props['ambari.dispatch.credential.username']); -inputFields.set('SMTPPassword.value', props['ambari.dispatch.credential.password']); -inputFields.set('retypeSMTPPassword.value', props['ambari.dispatch.credential.password']); -inputFields.set('SMTPSTARTTLS.value', props['mail.smtp.starttls.enable'] !== "false"); -inputFields.set('emailFrom.value', props['mail.smtp.from']); -inputFields.set('version.value', props['ambari.dispatch.snmp.version']); -inputFields.set('OIDs.value', props['ambari.dispatch.snmp.oids.trap']); -inputFields.set('community.value', props['ambari.dispatch.snmp.community']); -inputFields.set('host.value', props['ambari.dispatch.recipients'] ? - props['ambari.dispatch.recipients'].join(', ') : ''); -inputFields.set('port.value', props['ambari.dispatch.snmp.port']); +inputFields.set('email.value',
ambari git commit: AMBARI-14964: AMS cannot be installed on trunk (avijayan via jaoki)
Repository: ambari Updated Branches: refs/heads/trunk c147b27e9 -> 3242a5590 AMBARI-14964: AMS cannot be installed on trunk (avijayan via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3242a559 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3242a559 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3242a559 Branch: refs/heads/trunk Commit: 3242a5590a6cf84f9cd664e38c7ae8b1c2fe968a Parents: c147b27 Author: Jun AokiAuthored: Wed Feb 10 17:12:48 2016 -0800 Committer: Jun Aoki Committed: Wed Feb 10 17:12:48 2016 -0800 -- .../libraries/functions/package_conditions.py | 7 ++- .../stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml | 2 +- .../common-services/AMBARI_METRICS/0.1.0/metainfo.xml | 2 ++ .../AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py | 4 +++- .../AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py | 5 - .../AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py index 0fb0fe4..4ca3b7b 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py @@ -19,7 +19,8 @@ limitations under the License. Ambari Agent """ -__all__ = ["is_lzo_enabled", "should_install_phoenix", "should_install_ams_collector", "should_install_mysql", "should_install_mysl_connector"] +__all__ = ["is_lzo_enabled", "should_install_phoenix", "should_install_ams_collector", "should_install_ams_grafana", + "should_install_mysql", "should_install_mysl_connector"] import os from resource_management.libraries.script import Script @@ -41,6 +42,10 @@ def should_install_ams_collector(): config = Script.get_config() return 'role' in config and config['role'] == "METRICS_COLLECTOR" +def should_install_ams_grafana(): + config = Script.get_config() + return 'role' in config and config['role'] == "METRICS_GRAFANA" + def should_install_mysql(): config = Script.get_config() hive_database = config['configurations']['hive-env']['hive_database'] http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml -- diff --git a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml index be99b83..fe3b860 100644 --- a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml +++ b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml @@ -69,7 +69,7 @@ ambari-metrics-collector - package_chooser.should_install_ams_collector() + should_install_ams_collector ambari-metrics-monitor http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml -- diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml index c3dbc6b..3a832eb 100644 --- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml +++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml @@ -83,6 +83,7 @@ ambari-metrics-collector true + should_install_ams_collector ambari-metrics-monitor @@ -95,6 +96,7 @@ ambari-metrics-grafana true + should_install_ams_grafana gcc http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py -- diff --git