ambari git commit: AMBARI-9259 Configs: the configs version control bar is not filling the width. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 8ebade750 -> 0dbcee264 AMBARI-9259 Configs: the configs version control bar is not filling the width. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0dbcee26 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0dbcee26 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0dbcee26 Branch: refs/heads/trunk Commit: 0dbcee2644a93e41bd0740b8d1a443d63a0e240b Parents: 8ebade7 Author: Andrii Tkach Authored: Thu Jan 22 13:33:15 2015 +0200 Committer: Andrii Tkach Committed: Thu Jan 22 13:33:15 2015 +0200 -- ambari-web/app/styles/config_history_flow.less | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0dbcee26/ambari-web/app/styles/config_history_flow.less -- diff --git a/ambari-web/app/styles/config_history_flow.less b/ambari-web/app/styles/config_history_flow.less index 2f4265a..372ec69 100644 --- a/ambari-web/app/styles/config_history_flow.less +++ b/ambari-web/app/styles/config_history_flow.less @@ -186,6 +186,12 @@ .version-info-bar-wrapper { position: fixed; z-index: 2; +width: 747px; + } + @media (min-width: 1200px) { +.version-info-bar-wrapper { + width: 960px; +} } .version-info-bar { background-image: -moz-linear-gradient(top, @top-nav-bg-color-from, @top-nav-bg-color-to); @@ -202,7 +208,7 @@ border-radius: 4px; margin: 5px 0; padding: 5px; -width: 747px; +width: 100%; .icon-remove-circle { color: #ff;
[2/2] ambari git commit: AMBARI-9260 Kerberos Wizard: no warning before closing the wizard. (ababiichuk)
AMBARI-9260 Kerberos Wizard: no warning before closing the wizard. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5f4adaa6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5f4adaa6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5f4adaa6 Branch: refs/heads/trunk Commit: 5f4adaa6cd57755a39ffdd6891bbac11a459931e Parents: 752a52b Author: aBabiichuk Authored: Thu Jan 22 14:05:21 2015 +0200 Committer: aBabiichuk Committed: Thu Jan 22 15:59:56 2015 +0200 -- ambari-web/app/assets/test/tests.js | 1 + .../main/admin/kerberos/wizard_controller.js| 10 ++- ambari-web/app/messages.js | 3 + ambari-web/app/routes/add_kerberos_routes.js| 68 .../kerberos/kerberos_wizard_controler_tets.js | 40 5 files changed, 94 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5f4adaa6/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index 827ccb8..33abd6e 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -50,6 +50,7 @@ var files = ['test/init_model_test', 'test/controllers/main/alerts/add_alert_definition/step1_controller_test', 'test/controllers/main/alerts/manage_alert_notifications_controller_test', 'test/controllers/main/admin/kerberos_test', + 'test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets', 'test/controllers/main/admin/kerberos/step4_controller_test', 'test/controllers/main/admin/stack_and_upgrade_controller_test', 'test/controllers/main/admin/serviceAccounts_controller_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/5f4adaa6/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js index ef7a351..18d5a03 100644 --- a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js +++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js @@ -264,7 +264,15 @@ App.KerberosWizardController = App.WizardController.extend({ this.saveRequestIds(undefined); this.saveTasksRequestIds(undefined); }, - + /** + * shows popup with to warn user + * @param primary + */ + warnBeforeExitPopup: function(primary) { +var primaryText = Em.I18n.t('common.exitAnyway'); +var msg = Em.I18n.t('admin.kerberos.wizard.exit.msg'); +return App.showConfirmationPopup(primary, msg, null, null, primaryText) + }, /** * Clear all temporary data */ http://git-wip-us.apache.org/repos/asf/ambari/blob/5f4adaa6/ambari-web/app/messages.js -- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 8c00958..d8026a6 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -976,6 +976,9 @@ Em.I18n.translations = { 'admin.kerberos.wizard.header':'Enable Kerberos Wizard', 'admin.kerberos.button.enable': 'Enable Kerberos', 'admin.kerberos.button.disable': 'Disable Kerberos', + 'admin.kerberos.wizard.exit.msg': 'Enable Security is in progress. You must allow the wizard to complete for Ambari to be in usable state. ' + +'If you choose to quit, you must follow manual instructions to activate or disable security as documented in the Ambari User Guide. ' + +'Do you really want to exit Kerberos Security Wizard?', 'admin.kerberos.wizard.step1.header': 'Get Started', 'admin.kerberos.wizard.step2.header': 'Configure Kerberos', 'admin.kerberos.wizard.step3.header': 'Install and Test Kerberos', http://git-wip-us.apache.org/repos/asf/ambari/blob/5f4adaa6/ambari-web/app/routes/add_kerberos_routes.js -- diff --git a/ambari-web/app/routes/add_kerberos_routes.js b/ambari-web/app/routes/add_kerberos_routes.js index a70cd31..90ce279 100644 --- a/ambari-web/app/routes/add_kerberos_routes.js +++ b/ambari-web/app/routes/add_kerberos_routes.js @@ -34,39 +34,53 @@ module.exports = App.WizardRoute.extend({ secondary: null, onClose: function () { - var step2Controller = router.get('kerberosWizardStep2Controller'); - if (step2Controller.get('testConnectionInProgress')) { -step2Controller.showConnectionInProgressPopup(this.exitWizard); - } else { -this.exitWizard(); + var self = this; + switch(kerberosWizardController.get('curr
[1/2] ambari git commit: AMBARI-9256 Host versions page is not updated. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 0dbcee264 -> 5f4adaa6c AMBARI-9256 Host versions page is not updated. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/752a52b2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/752a52b2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/752a52b2 Branch: refs/heads/trunk Commit: 752a52b2d5d3240128d42748bc543570d258d214 Parents: 0dbcee2 Author: aBabiichuk Authored: Thu Jan 22 12:28:18 2015 +0200 Committer: aBabiichuk Committed: Thu Jan 22 15:59:54 2015 +0200 -- ambari-web/app/config.js | 2 +- ambari-web/app/controllers/global/update_controller.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/752a52b2/ambari-web/app/config.js -- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index f05adc7..606920b 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -61,7 +61,7 @@ App.supports = { preUpgradeCheck: true, stackUpgrade: true, autoRollbackHA: false, - alwaysEnableManagedMySQLForHive: true, + alwaysEnableManagedMySQLForHive: false, preKerberizeCheck: false, automatedKerberos: true, ranger: false, http://git-wip-us.apache.org/repos/asf/ambari/blob/752a52b2/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 b8db91e..8b7f896 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -167,8 +167,8 @@ App.UpdateController = Em.Controller.extend({ } else { if (App.router.get('currentState.parentState.name') == 'hostDetails' && - (App.router.get('currentState.name') == 'summary' || App.router.get('currentState.name') == 'alerts' )) { -hostDetailsFilter = App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/(summary|alerts)/)[1]; + ['summary', 'alerts', 'stackVersions'].contains(App.router.get('currentState.name'))) { +hostDetailsFilter = App.router.get('location.lastSetURL').match(/\/hosts\/(.*)\/(summary|alerts|stackVersions)/)[1]; App.updater.updateInterval('updateHost', App.get('componentsUpdateInterval')); } else {
[2/3] ambari git commit: AMBARI-9264 Stack and Versions: Integrate view/edit repositories with API. (ababiichuk)
AMBARI-9264 Stack and Versions: Integrate view/edit repositories with API. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/11efa2f5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/11efa2f5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/11efa2f5 Branch: refs/heads/trunk Commit: 11efa2f5580b28acb3484586c2f74d5b9adfc17d Parents: 5f4adaa Author: aBabiichuk Authored: Thu Jan 22 16:41:20 2015 +0200 Committer: aBabiichuk Committed: Thu Jan 22 16:41:20 2015 +0200 -- ambari-web/app/assets/test/tests.js |2 +- .../main/admin/stack_and_upgrade_controller.js | 111 +- ambari-web/app/messages.js |1 + .../admin/stack_upgrade/edit_repositories.hbs | 20 +- ambari-web/app/utils/ajax/ajax.js | 26 + ambari-web/app/views.js |2 +- ambari-web/app/views/common/controls_view.js| 1224 ++ .../stack_upgrade/upgrade_version_box_view.js | 40 +- ambari-web/app/views/wizard/controls_view.js| 1208 - .../admin/stack_and_upgrade_controller_test.js | 50 + .../test/views/common/controls_view_test.js | 606 + .../test/views/wizard/controls_view_test.js | 606 - 12 files changed, 2064 insertions(+), 1832 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/11efa2f5/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index 33abd6e..d02a375 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -211,10 +211,10 @@ var files = ['test/init_model_test', 'test/views/common/configs/service_config_container_view_test', 'test/views/common/configs/service_configs_by_category_view_test', 'test/views/common/configs/custom_category_views/notification_configs_view_test', + 'test/views/common/controls_view_test', 'test/views/wizard/step3/hostLogPopupBody_view_test', 'test/views/wizard/step3/hostWarningPopupBody_view_test', 'test/views/wizard/step3/hostWarningPopupFooter_view_test', - 'test/views/wizard/controls_view_test', 'test/views/wizard/step0_view_test', 'test/views/wizard/step1_view_test', 'test/views/wizard/step2_view_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/11efa2f5/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js index 232826d..d98a816 100644 --- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js +++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js @@ -401,8 +401,115 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, }); }, - saveRepoOS: function () { -//TODO integrate with API + /** + * transform repo data into json for + * saving changes to repository version + * @param {Em.Object} repo + * @returns {{operating_systems: Array}} + */ + prepareRepoForSaving: function(repo) { +var repoVersion = { "operating_systems": [] }; + +repo.get('operatingSystems').forEach(function (os, k) { + repoVersion.operating_systems.push({ +"OperatingSystems": { + "os_type": os.get("osType") +}, +"repositories": [] + }); + os.get('repositories').forEach(function (repository) { +repoVersion.operating_systems[k].repositories.push({ + "Repositories": { +"base_url": repository.get('baseUrl'), +"repo_id": repository.get('repoId'), +"repo_name": repository.get('repoName') + } +}); + }); +}); +return repoVersion; + }, + + /** + * perform validation if skip is false and run save if + * validation successfull or run save without validation is skip is true + * @param {Em.Object} repo + * @param {boolean} skip + * @returns {$.Deferred} + */ + saveRepoOS: function (repo, skip) { +var self = this; +var deferred = $.Deferred(); +this.validateRepoVersions(repo, skip).done(function(data) { + if (data.length > 0) { +deferred.resolve(data); + } else { +var repoVersion = self.prepareRepoForSaving(repo); + +App.ajax.send({ + name: 'admin.stack_versions.edit.repo', + sender: this, + data: { +stackName: App.get('currentStackName'), +stackVersion: App.get('currentStackVersionNumber'), +repoVersionId: repo.get('repoVersionId'), +
[1/3] ambari git commit: AMBARI-9264 Stack and Versions: Integrate view/edit repositories with API. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 5f4adaa6c -> 92b05b9ba http://git-wip-us.apache.org/repos/asf/ambari/blob/11efa2f5/ambari-web/app/views/wizard/controls_view.js -- diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js deleted file mode 100644 index b0a26ab..000 --- a/ambari-web/app/views/wizard/controls_view.js +++ /dev/null @@ -1,1208 +0,0 @@ -/** - * 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. - */ - -var App = require('app'); - -/** - * Abstract view for config fields. - * Add popover support to control - */ -App.ServiceConfigPopoverSupport = Ember.Mixin.create({ - - /** - * Config object. It will instance of App.ServiceConfigProperty - */ - serviceConfig: null, - attributeBindings:['readOnly'], - isPopoverEnabled: true, - - didInsertElement: function () { -$('body').tooltip({ - selector: '[data-toggle=tooltip]', - placement: 'top' -}); -// if description for this serviceConfig not exist, then no need to show popover -if (this.get('isPopoverEnabled') !== 'false' && this.get('serviceConfig.description')) { - App.popover(this.$(), { -title: Em.I18n.t('installer.controls.serviceConfigPopover.title').format( - this.get('serviceConfig.displayName'), - (this.get('serviceConfig.displayName') == this.get('serviceConfig.name')) ? '' : this.get('serviceConfig.name') -), -content: this.get('serviceConfig.description'), -placement: 'right', -trigger: 'hover' - }); -} - }, - - willDestroyElement: function() { -this.$().popover('destroy'); - }, - - readOnly: function () { -return !this.get('serviceConfig.isEditable'); - }.property('serviceConfig.isEditable') -}); - -/** - * mixin set class that serve as unique element identificator, - * id not used in order to avoid collision with ember ids - */ -App.ServiceConfigCalculateId = Ember.Mixin.create({ - idClass: Ember.computed(function () { -var label = Em.get(this, 'serviceConfig.name') ? Em.get(this, 'serviceConfig.name').toLowerCase().replace(/\./g, '-') : '', -fileName = Em.get(this, 'serviceConfig.filename') ? Em.get(this, 'serviceConfig.filename').toLowerCase().replace(/\./g, '-') : '', -group = Em.get(this, 'serviceConfig.group.name') || 'default'; -isOrigin = Em.get(this, 'serviceConfig.compareConfigs.length') > 0 ? '-origin' : ''; -return 'service-config-' + label + '-' + fileName + '-' + group + isOrigin; - }), - classNameBindings: 'idClass' -}); - -/** - * Default input control - * @type {*} - */ -App.ServiceConfigTextField = Ember.TextField.extend(App.ServiceConfigPopoverSupport, App.ServiceConfigCalculateId, { - - valueBinding: 'serviceConfig.value', - classNameBindings: 'textFieldClassName', - placeholderBinding: 'serviceConfig.defaultValue', - - keyPress: function (event) { -if (event.keyCode == 13) { - return false; -} - }, - //Set editDone true for last edited config text field parameter - focusOut: function (event) { -this.get('serviceConfig').set("editDone", true); - }, - //Set editDone false for all current category config text field parameter - focusIn: function (event) { -if (!this.get('serviceConfig.isOverridden') && !this.get('serviceConfig.isComparison')) { - this.get("parentView.categoryConfigsAll").setEach("editDone", false); -} - }, - - textFieldClassName: function () { -if (this.get('serviceConfig.unit')) { - return ['input-small']; -} else if (this.get('serviceConfig.displayType') === 'principal') { - return ['span12']; -} else { - return ['span9']; -} - }.property('serviceConfig.displayType', 'serviceConfig.unit') - -}); - -/** - * Customized input control with Units type specified - * @type {Em.View} - */ -App.ServiceConfigTextFieldWithUnit = Ember.View.extend(App.ServiceConfigPopoverSupport, { - valueBinding: 'serviceConfig.value', - classNames: ['input-append', 'with-unit'], - placeholderBinding: 'serviceConfig.defaultValue', - - templateName: require('templates/wizard/controls_service_config_textfie
[3/3] ambari git commit: AMBARI-9252 Versions: cannot register version. (Richard Zang via ababiichuk)
AMBARI-9252 Versions: cannot register version. (Richard Zang via ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/92b05b9b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92b05b9b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92b05b9b Branch: refs/heads/trunk Commit: 92b05b9baeb87c58e6c1ef57751336e2e437722f Parents: 11efa2f Author: aBabiichuk Authored: Thu Jan 22 16:57:22 2015 +0200 Committer: aBabiichuk Committed: Thu Jan 22 16:57:22 2015 +0200 -- .../scripts/controllers/stackVersions/StackVersionsCreateCtrl.js | 4 +--- .../ui/admin-web/app/views/stackVersions/stackVersionPage.html | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/92b05b9b/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 18a5700..f31f4fc 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 @@ -53,15 +53,13 @@ angular.module('ambariAdminConsole') $scope.save = function () { return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack.selected).then(function (invalidUrls) { if (invalidUrls.length === 0) { -// TODO repoSubversion input out of sync here, could be related to ng-pattern. Need to find out. -if (!$scope.repoSubversion) { $scope.repoSubversion = angular.element('[name="version"]')[0].value; } Stack.addRepo($scope.upgradeStack.selected, $scope.repoSubversion, $scope.osList) .success(function () { var versionName = $scope.upgradeStack.selected.stack_version + '.' + $scope.repoSubversion; var stackName = $scope.upgradeStack.selected.stack_name; Alert.success('Created version ' + '' - + stackName + versionName + + + stackName + '-' + versionName + ''); $location.path('/stackVersions'); }) http://git-wip-us.apache.org/repos/asf/ambari/blob/92b05b9b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html -- diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html index 11d42f9..1484c14 100644 --- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html +++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html @@ -42,13 +42,13 @@ Version . - {{currentVersionInput}} Invalid.
ambari git commit: AMBARI-9263 "Installing"-link on version-box doesn't work. (atkach)
Repository: ambari Updated Branches: refs/heads/trunk 92b05b9ba -> 45407a22a AMBARI-9263 "Installing"-link on version-box doesn't work. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/45407a22 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/45407a22 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/45407a22 Branch: refs/heads/trunk Commit: 45407a22aeb782d75c7f07d63daf0a84cff575d3 Parents: 92b05b9 Author: Andrii Tkach Authored: Thu Jan 22 16:34:50 2015 +0200 Committer: Andrii Tkach Committed: Thu Jan 22 17:11:55 2015 +0200 -- .../app/controllers/main/admin/stack_and_upgrade_controller.js | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/45407a22/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js -- diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js index d98a816..282ea20 100644 --- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js +++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js @@ -522,6 +522,10 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage, */ installRepoVersionSuccess: function (data, opt, params) { App.db.set('repoVersionInstall', 'id', [data.Requests.id]); +App.clusterStatus.setClusterStatus({ + wizardControllerName: this.get('name'), + localdb: App.db.data +}); }, /**
ambari git commit: AMBARI-9250 - LDAP Group sync truncates whitespace in group name (tbeerbower)
Repository: ambari Updated Branches: refs/heads/trunk 45407a22a -> 603775cfe AMBARI-9250 - LDAP Group sync truncates whitespace in group name (tbeerbower) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/603775cf Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/603775cf Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/603775cf Branch: refs/heads/trunk Commit: 603775cfef58cb10c68c2eddfc7712915f10a8c7 Parents: 45407a2 Author: tbeerbower Authored: Wed Jan 21 17:36:11 2015 -0500 Committer: tbeerbower Committed: Thu Jan 22 10:18:47 2015 -0500 -- ambari-server/src/main/python/ambari-server.py | 2 +- .../src/test/python/TestAmbariServer.py | 21 2 files changed, 22 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/603775cf/ambari-server/src/main/python/ambari-server.py -- diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py index 0f56f84..ea072ab 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -2901,7 +2901,7 @@ def get_ldap_event_spec_names(file, specs, new_specs): new_spec = new_specs[0] with open(file, 'r') as names_file: names = names_file.read() -new_spec['names'] = ''.join(names.split()) +new_spec['names'] = names.replace('\n', '').replace('\t', '') names_file.close() specs += new_specs else: http://git-wip-us.apache.org/repos/asf/ambari/blob/603775cf/ambari-server/src/test/python/TestAmbariServer.py -- diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py index 408c088..4484458 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/ambari-server/src/test/python/TestAmbariServer.py @@ -5187,6 +5187,27 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV self.assertTrue("not configured" in fe.reason) pass + @patch("__builtin__.open") + @patch("os.path.exists") + def test_get_ldap_event_spec_names(self, os_path_exists_mock, open_mock): +os_path_exists_mock.return_value = 1 +f = MagicMock() +f.__enter__().read.return_value = "\n\n\t some group, \tanother group, \n\t\tgrp, \ngroup*\n\n\n\n" + +open_mock.return_value = f + +bodies = [{"Event":{"specs":[]}}] +body = bodies[0] +events = body['Event'] +specs = events['specs'] + +new_specs = [{"principal_type":"groups","sync_type":"specific","names":""}] + +_ambari_server_.get_ldap_event_spec_names("groups.txt", specs, new_specs) + +self.assertEquals("[{'Event': {'specs': [{'principal_type': 'groups', 'sync_type': 'specific', 'names': ' some group, another group, grp, group*'}]}}]", str(bodies)) +pass + @patch.object(_ambari_server_, "read_password") def test_configure_ldap_password(self, read_password_method): out = StringIO.StringIO()
ambari git commit: AMBARI-9266. When multiple Oozie servers installed and one of them stopped, service icon is red.(vbrodetskyi)
Repository: ambari Updated Branches: refs/heads/trunk 603775cfe -> e14f3530f AMBARI-9266. When multiple Oozie servers installed and one of them stopped, service icon is red.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e14f3530 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e14f3530 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e14f3530 Branch: refs/heads/trunk Commit: e14f3530fb7fbf86af475221ae1141e6032a43a8 Parents: 603775c Author: Vitaly Brodetskyi Authored: Sat Jan 10 13:07:55 2015 +0200 Committer: Vitaly Brodetskyi Committed: Sat Jan 10 13:07:55 2015 +0200 -- .../internal/ServiceResourceProvider.java | 97 .../internal/ServiceResourceProviderTest.java | 96 +++ 2 files changed, 177 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e14f3530/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 ac2a3bb..e11accb 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 @@ -17,19 +17,9 @@ */ package org.apache.ambari.server.controller.internal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - +import com.google.inject.assistedinject.Assisted; +import com.google.inject.assistedinject.AssistedInject; +import com.google.inject.persist.Transactional; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.ClusterNotFoundException; import org.apache.ambari.server.DuplicateResourceException; @@ -70,9 +60,18 @@ import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.State; import org.apache.commons.lang.StringUtils; -import com.google.inject.assistedinject.Assisted; -import com.google.inject.assistedinject.AssistedInject; -import com.google.inject.persist.Transactional; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Resource provider for service resources. @@ -110,6 +109,7 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider serviceStateMap.put("HBASE", new HBaseServiceState()); serviceStateMap.put("FLUME", new FlumeServiceState()); serviceStateMap.put("HIVE", new HiveServiceState()); +serviceStateMap.put("OOZIE", new OozieServiceState()); } private static final ServiceState DEFAULT_SERVICE_STATE = new DefaultServiceState(); @@ -1055,6 +1055,71 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider } /** + * Calculator of Oozie service state. + */ + protected static class OozieServiceState implements ServiceState { + +@Override +public State getState(AmbariManagementController controller,String clusterName, String serviceName) { + AmbariMetaInfo ambariMetaInfo = controller.getAmbariMetaInfo(); + Clusters clusters = controller.getClusters(); + + if (clusterName != null && clusterName.length() > 0) { +try { + Cluster cluster = clusters.getCluster(clusterName); + if (cluster != null) { +StackId stackId = cluster.getDesiredStackVersion(); + +ServiceComponentHostRequest request = new ServiceComponentHostRequest(clusterName, +serviceName, null, null, null); + +Set hostComponentResponses = + controller.getHostComponents(Collections.singleton(request)); + +int oozieServerActiveCount = 0; +State nonStartedState= null; + +for (ServiceComponentHostResponse hostComponentResponse : hostComponentResponses ) { + try { +ComponentInfo componentInfo = ambariMetaInfo.getComponent(stackId.getStackName(), +stackId.getStackVersion(), hostComp
ambari git commit: AMBARI-9249. Downloads configuration files have not same values that files at nodes. (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/trunk e14f3530f -> 6a552002d AMBARI-9249. Downloads configuration files have not same values that files at nodes. (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6a552002 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6a552002 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6a552002 Branch: refs/heads/trunk Commit: 6a552002d27cf79886edd8205faaba5d3469454c Parents: e14f353 Author: Lisnichenko Dmitro Authored: Thu Jan 22 17:21:49 2015 +0200 Committer: Lisnichenko Dmitro Committed: Thu Jan 22 17:24:11 2015 +0200 -- .../main/python/resource_management/libraries/script/script.py| 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6a552002/ambari-common/src/main/python/resource_management/libraries/script/script.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py index 9fe6957..683397a 100644 --- a/ambari-common/src/main/python/resource_management/libraries/script/script.py +++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py @@ -412,6 +412,9 @@ class Script(object): Generates config files and stores them as an archive in tmp_dir based on xml_configs_list and env_configs_list from commandParams """ +import params +env.set_params(params) + config = self.get_config() xml_configs_list = config['commandParams']['xml_configs_list']
ambari git commit: AMBARI-9267 Versions: missing string on Hosts page and service versions incorrect. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 6a552002d -> 3ba23d27c AMBARI-9267 Versions: missing string on Hosts page and service versions incorrect. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3ba23d27 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3ba23d27 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3ba23d27 Branch: refs/heads/trunk Commit: 3ba23d27c0aa284087a910e21928f119fc3d4228 Parents: 6a55200 Author: aBabiichuk Authored: Thu Jan 22 17:32:29 2015 +0200 Committer: aBabiichuk Committed: Thu Jan 22 17:32:59 2015 +0200 -- ambari-web/app/assets/test/tests.js | 2 +- ambari-web/app/messages.js | 2 + ambari-web/app/models/host.js | 3 +- ambari-web/app/models/host_stack_version.js | 8 ++-- .../main/admin/stack_upgrade/services.hbs | 2 +- .../kerberos/kerberos_wizard_controler_test.js | 40 .../kerberos/kerberos_wizard_controler_tets.js | 40 .../test/models/host_stack_version_test.js | 20 -- 8 files changed, 67 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index d02a375..ccfffe3 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -50,7 +50,7 @@ var files = ['test/init_model_test', 'test/controllers/main/alerts/add_alert_definition/step1_controller_test', 'test/controllers/main/alerts/manage_alert_notifications_controller_test', 'test/controllers/main/admin/kerberos_test', - 'test/controllers/main/admin/kerberos/kerberos_wizard_controler_tets', + 'test/controllers/main/admin/kerberos/kerberos_wizard_controler_test', 'test/controllers/main/admin/kerberos/step4_controller_test', 'test/controllers/main/admin/stack_and_upgrade_controller_test', 'test/controllers/main/admin/serviceAccounts_controller_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/messages.js -- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 548bb4c..0e41150 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1989,6 +1989,8 @@ Em.I18n.translations = { 'hosts.host.stackVersions.status.installing': 'Installing', 'hosts.host.stackVersions.status.current': 'Current', 'hosts.host.stackVersions.status.out_of_sync': 'Out of sync', + 'hosts.host.stackVersions.status.upgrading': 'Upgrading', + 'hosts.host.stackVersions.status.upgrade_failed': 'Upgrade Failed', 'hosts.host.metrics.dataUnavailable':'Data Unavailable', 'hosts.host.metrics.cpu':'CPU Usage', http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/models/host.js -- diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js index 6fcc692..1f3f6d4 100644 --- a/ambari-web/app/models/host.js +++ b/ambari-web/app/models/host.js @@ -60,7 +60,8 @@ App.Host = DS.Model.extend({ isRequested: DS.attr('boolean'), currentVersion: function () { -return this.get('stackVersions').findProperty('isCurrent').get('repoVersion'); +var current = this.get('stackVersions').findProperty('isCurrent'); +return current ? current.get('repoVersion') : null; }.property('stackVersions.@each.isCurrent'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/models/host_stack_version.js -- diff --git a/ambari-web/app/models/host_stack_version.js b/ambari-web/app/models/host_stack_version.js index 4c9438f..a5817d3 100644 --- a/ambari-web/app/models/host_stack_version.js +++ b/ambari-web/app/models/host_stack_version.js @@ -53,7 +53,9 @@ App.HostStackVersion.statusDefinition = [ "INSTALLING", "INSTALL_FAILED", "OUT_OF_SYNC", - "CURRENT" + "CURRENT", + "UPGRADING", + "UPGRADE_FAILED" ]; /** @@ -62,7 +64,7 @@ App.HostStackVersion.statusDefinition = [ * @return {string} */ App.HostStackVersion.formatStatus = function (status) { - return status ? + return App.HostStackVersion.statusDefinition.contains(status) ? Em.I18n.t('hosts.host.stackVersions.status.' + status.toLowerCase()) : -Em.I18n.t('common.unknown'); +status.toCapital(); }; http://git-wip-us.apache.org/repos/asf/ambari/blob/3ba23d27/ambari-web/app/templates/main/admin/stack_upgrade/services.hbs --
ambari git commit: AMBARI-9265. Incorrect Ambari-DDL-MySQL-CREATE.sql file (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/trunk 3ba23d27c -> 8d4af5707 AMBARI-9265. Incorrect Ambari-DDL-MySQL-CREATE.sql file (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8d4af570 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8d4af570 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8d4af570 Branch: refs/heads/trunk Commit: 8d4af57074607ce1b6d01fc2bf5b59c7e9cceeb8 Parents: 3ba23d2 Author: Lisnichenko Dmitro Authored: Thu Jan 22 18:11:20 2015 +0200 Committer: Lisnichenko Dmitro Committed: Thu Jan 22 18:11:20 2015 +0200 -- .../org/apache/ambari/server/upgrade/UpgradeCatalog200.java| 2 +- ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql | 4 ++-- ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql | 4 ++-- .../src/main/resources/Ambari-DDL-Postgres-CREATE.sql | 6 ++ .../src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 2 +- .../apache/ambari/server/upgrade/UpgradeCatalog200Test.java| 1 + 6 files changed, 13 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4af570/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java index 3a043b9..783f7a2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog200.java @@ -260,7 +260,7 @@ public class UpgradeCatalog200 extends AbstractUpgradeCatalog { private void createArtifactTable() throws SQLException { ArrayList columns = new ArrayList(); columns.add(new DBColumnInfo("artifact_name", String.class, 255, null, false)); -columns.add(new DBColumnInfo("foreign_keys", String.class, null, null, false)); +columns.add(new DBColumnInfo("foreign_keys", String.class, 255, null, false)); columns.add(new DBColumnInfo("artifact_data", char[].class, null, null, false)); dbAccessor.createTable(ARTIFACT_TABLE, columns, "artifact_name", "foreign_keys"); } http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4af570/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql index 972053c..21ba270 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql @@ -519,8 +519,8 @@ CREATE TABLE repo_version ( CREATE TABLE artifact ( artifact_name VARCHAR(255) NOT NULL, - foreign_keys LONGTEXT NOT NULL, - artifact_data VARCHAR(4096) NOT NULL, + foreign_keys VARCHAR(255) NOT NULL, + artifact_data LONGTEXT NOT NULL, PRIMARY KEY(artifact_name, foreign_keys)); -- altering tables by creating unique constraints-- http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4af570/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql index 0117fed..cab6dfa 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql @@ -509,8 +509,8 @@ CREATE TABLE repo_version ( CREATE TABLE artifact ( artifact_name VARCHAR2(255) NOT NULL, - foreign_keys CLOB NOT NULL, - artifact_data VARCHAR2(4096) NOT NULL, + foreign_keys VARCHAR2(255) NOT NULL, + artifact_data CLOB NOT NULL, PRIMARY KEY(artifact_name, foreign_keys)); altering tables by creating unique constraints-- http://git-wip-us.apache.org/repos/asf/ambari/blob/8d4af570/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql -- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql index 7ce9fc0..81f6c50 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql @@ -508,6 +508,12 @@ CREATE TABLE repo_version ( PRIMARY KEY(repo_version_id) ); +CREATE TABLE ambari.artifact ( + artifact_name VARCHAR(255) NOT NULL, + artifact_data TEXT NOT NULL, + foreign_keys VARCHAR(255) NOT NULL
ambari git commit: AMBARI-9271. During enabling HA Hive Metastore Stop failed (aonishuk)
Repository: ambari Updated Branches: refs/heads/trunk 8d4af5707 -> 9f296a25c AMBARI-9271. During enabling HA Hive Metastore Stop failed (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9f296a25 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9f296a25 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9f296a25 Branch: refs/heads/trunk Commit: 9f296a25c67db4c21b059b102785cd93482b38e8 Parents: 8d4af57 Author: Andrew Onishuk Authored: Thu Jan 22 19:09:13 2015 +0200 Committer: Andrew Onishuk Committed: Thu Jan 22 19:09:13 2015 +0200 -- .../HIVE/0.12.0.2.0/package/scripts/hive_service.py | 4 +++- .../test/python/stacks/2.0.6/HIVE/test_hive_metastore.py | 10 -- .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py | 10 -- .../test/python/stacks/2.1/HIVE/test_hive_metastore.py| 10 -- 4 files changed, 27 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py -- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py index a89d299..56e968a 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py @@ -111,7 +111,9 @@ def hive_service(name, action='start', rolling_restart=False): ) # check if stopped the process, else fail the task -Execute(format("! ({process_id_exists_command})") +Execute(format("! ({process_id_exists_command})"), + tries=20, + try_sleep=3, ) File(pid_file, http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py index 6eef93f..8140223 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py @@ -73,7 +73,10 @@ class TestHiveMetastore(RMFTestCase): self.assertResourceCalled('Execute', 'sudo kill -9 `cat /var/run/hive/hive.pid`', not_if = '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1) )', ) -self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',) +self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)', + tries = 20, + try_sleep = 3, +) self.assertResourceCalled('File', '/var/run/hive/hive.pid', action = ['delete'], ) @@ -127,7 +130,10 @@ class TestHiveMetastore(RMFTestCase): self.assertResourceCalled('Execute', 'sudo kill -9 `cat /var/run/hive/hive.pid`', not_if = '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1) || ( sleep 5 && ! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1) )', ) -self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)',) +self.assertResourceCalled('Execute', '! (ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive.pid` >/dev/null 2>&1)', + tries = 20, + try_sleep = 3, +) self.assertResourceCalled('File', '/var/run/hive/hive.pid', action = ['delete'], ) http://git-wip-us.apache.org/repos/asf/ambari/blob/9f296a25/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py index 527c4c7..6d211ff 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py +++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py @@ -93,7 +93,10 @@ class TestHiveServer(RMFTestCase): self.assertResourceCalled('Execute', 'sudo kill -9 `cat /var
[1/2] ambari git commit: AMBARI-8605 Query predicate .matches doesn't work for stacks endpoint with passed logical OR(URL-encoding) (dsen)
Repository: ambari Updated Branches: refs/heads/trunk 9f296a25c -> 0edce3c4f AMBARI-8605 Query predicate .matches doesn't work for stacks endpoint with passed logical OR(URL-encoding) (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0edce3c4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0edce3c4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0edce3c4 Branch: refs/heads/trunk Commit: 0edce3c4f275b2ebca042e1fd8fb877acb7c5336 Parents: f77be4c Author: Dmytro Sen Authored: Thu Jan 22 18:24:19 2015 +0200 Committer: Dmytro Sen Committed: Thu Jan 22 19:23:35 2015 +0200 -- .../api/services/ResultPostProcessorImpl.java | 13 +- .../server/api/services/StacksService.java | 47 ++-- .../server/api/services/StacksServiceTest.java | 19 +++- 3 files changed, 63 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0edce3c4/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java index 8d17846..61afee2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java @@ -61,7 +61,18 @@ public class ResultPostProcessorImpl implements ResultPostProcessor { @Override public void process(Result result) { -processNode(result.getResultTree(), m_request.getURI()); +// Decode query string only +// Path should not be decoded here (username can contain '?') +String href = m_request.getURI(); +int pos = href.indexOf('?'); +if (pos != -1) { + try { +href = href.substring(0, pos + 1) + URLDecoder.decode(href.substring(pos + 1), "UTF-8"); + } catch (UnsupportedEncodingException e) { +throw new RuntimeException("Unable to decode URI: " + e, e); + } +} +processNode(result.getResultTree(), href); } /** http://git-wip-us.apache.org/repos/asf/ambari/blob/0edce3c4/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java index 366accf..74c7b57 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java @@ -22,6 +22,7 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -42,6 +43,9 @@ import javax.ws.rs.core.UriInfo; import org.apache.ambari.server.api.predicate.QueryLexer; import org.apache.ambari.server.api.resources.ResourceInstance; import org.apache.ambari.server.controller.spi.Resource; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.message.BasicNameValuePair; /** * Service for stacks management. @@ -426,23 +430,38 @@ public class StacksService extends BaseService { return m_delegate.getPathSegments(b); } +/** + * Converts the new corrected property names to the old names for the backend. + * Because both the /stacks and /stacks2 api use the same underlying classes, we + * need to convert the new corrected property names to the old names for the backend. + * This should be removed when /stacks2 is removed and we can change the property names + * in the resource definitions to the new form. + */ +private String normalizeComponentNames(String value) { + if (value == null) { +return null; + } + value = value.replaceAll("services/", "stackServices/"); + value = value.replaceAll("components/", "serviceComponents/"); + value = value.replaceAll("operating_systems/", "operatingSystems/"); + return value; +} + @Override public URI getRequestUri() { - String uri; - try { -uri = URLDecoder.decode(m_delegate.getRequestUri().toASCIIString(), "UTF-8"); - } catch (UnsupportedEncodingException e) { -throw new RuntimeException("Unable to decode URI: " + e, e); - } - uri = uri.replaceAll("serv
[2/2] ambari git commit: AMBARI-8605 Query predicate .matches doesn't work for stacks endpoint with passed logical OR (dsen)
AMBARI-8605 Query predicate .matches doesn't work for stacks endpoint with passed logical OR (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f77be4c4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f77be4c4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f77be4c4 Branch: refs/heads/trunk Commit: f77be4c4df25aef336f00a7aa9bc0591b347dfb6 Parents: 9f296a2 Author: Dmytro Sen Authored: Thu Jan 22 15:13:08 2015 +0200 Committer: Dmytro Sen Committed: Thu Jan 22 19:23:35 2015 +0200 -- .../ambari/server/api/predicate/QueryLexer.java | 195 +-- .../server/api/predicate/QueryLexerTest.java| 51 - 2 files changed, 231 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f77be4c4/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java index b645040..e7051a1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java @@ -62,6 +62,7 @@ public class QueryLexer { */ private static final Set SET_IGNORE = new HashSet(); + /** * Constructor. * Register token handlers. @@ -88,14 +89,18 @@ public class QueryLexer { listHandlers = new ArrayList(); listHandlers.add(new CloseBracketTokenHandler()); -listHandlers.add(new ValueOperandTokenHandler()); +listHandlers.add(new ComplexValueOperandTokenHandler()); TOKEN_HANDLERS.put(Token.TYPE.RELATIONAL_OPERATOR_FUNC, listHandlers); listHandlers = new ArrayList(); listHandlers.add(new CloseBracketTokenHandler()); listHandlers.add(new LogicalOperatorTokenHandler()); -TOKEN_HANDLERS.put(Token.TYPE.VALUE_OPERAND, listHandlers); TOKEN_HANDLERS.put(Token.TYPE.BRACKET_CLOSE, listHandlers); + +listHandlers = new ArrayList(listHandlers); +// complex value operands can span multiple tokens +listHandlers.add(0, new ComplexValueOperandTokenHandler()); +TOKEN_HANDLERS.put(Token.TYPE.VALUE_OPERAND, listHandlers); } @@ -139,6 +144,9 @@ public class QueryLexer { tok + "\', previous token type=" + ctx.getLastTokenType()); } } + +ctx.validateEndState(); + return ctx.getTokenList().toArray(new Token[ctx.getTokenList().size()]); } @@ -234,6 +242,23 @@ public class QueryLexer { private Set m_propertiesToIgnore = new HashSet(); /** + * Bracket score. This score is the difference between the number of + * opening brackets and the number of closing brackets processed by + * a handler. Only handlers which process values containing brackets + * will be interested in this information. + */ +private int bracketScore = 0; + +/** + * Intermediate tokens are tokens which are used by a handler which may + * process several adjacent tokens. A handler might push intermediate + * tokens and then in subsequent invocations combine/alter/remove/etc + * these tokens prior to adding them to the context tokens. + */ +private Deque m_intermediateTokens = new ArrayDeque(); + + +/** * Constructor. */ private ScanContext() { @@ -329,6 +354,86 @@ public class QueryLexer { m_propertiesToIgnore.addAll(ignoredProperties); } } + +/** + * Add an intermediate token. + * + * @param token the token to add + */ +public void pushIntermediateToken(Token token) { + if (m_ignoreSegmentEndToken == null) { +m_intermediateTokens.add(token); + } else if (token.getType() == m_ignoreSegmentEndToken) { +m_ignoreSegmentEndToken = null; + } +} + +/** + * Return the intermediate tokens if any. + * + * @return the intermediate tokens. Will never return null. + */ +public Deque getIntermediateTokens() { + return m_intermediateTokens; +} + +/** + * Move all intermediate tokens to the context tokens. + */ +public void addIntermediateTokens() { + m_listTokens.addAll(m_intermediateTokens); + m_intermediateTokens.clear(); +} + +/** + * Obtain the bracket score. This count is the number of outstanding opening brackets. + * A value of 0 indicates all opening and closing brackets are matched + * @return the current bracket score + */ +public int getBracketScore() { + return bracketScore; +} + +/** + * Increment the bracket score by n. This indicates that n unmatched
ambari git commit: AMBARI-9185. Add Kafka metric sink implementation to enable sink to AMS. Debian packaging changes.
Repository: ambari Updated Branches: refs/heads/trunk 0edce3c4f -> ac240927a AMBARI-9185. Add Kafka metric sink implementation to enable sink to AMS. Debian packaging changes. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ac240927 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ac240927 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ac240927 Branch: refs/heads/trunk Commit: ac240927ab0d836f0fd57df4589787b5799ce03c Parents: 0edce3c Author: Siddharth Wagle Authored: Thu Jan 22 09:24:13 2015 -0800 Committer: Siddharth Wagle Committed: Thu Jan 22 09:24:18 2015 -0800 -- ambari-metrics/ambari-metrics-assembly/pom.xml | 1 + .../src/main/package/deb/control/postinst| 11 --- 2 files changed, 9 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ac240927/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 8614421..6236187 100644 --- a/ambari-metrics/ambari-metrics-assembly/pom.xml +++ b/ambari-metrics/ambari-metrics-assembly/pom.xml @@ -614,6 +614,7 @@ /var/lib/ambari-metrics-collector /usr/lib/ambari-metrics-hadoop-sink /usr/lib/ambari-metrics-kafka-sink +/usr/lib/ambari-metrics-kafka-sink/lib /usr/lib/flume/lib /usr/lib/storm/lib http://git-wip-us.apache.org/repos/asf/ambari/blob/ac240927/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst -- diff --git a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst index 1955680..e87b9f0 100644 --- a/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst +++ b/ambari-metrics/ambari-metrics-assembly/src/main/package/deb/control/postinst @@ -15,15 +15,20 @@ # limitations under the License HADOOP_LINK_NAME="/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar" -FLUME_LINK_NAME="/usr/lib/flume/lib/ambari-metrics-flume-sink.jar" HADOOP_SINK_JAR="/usr/lib/ambari-metrics-hadoop-sink/${hadoop.sink.jar}" + +FLUME_LINK_NAME="/usr/lib/flume/lib/ambari-metrics-flume-sink.jar" FLUME_SINK_JAR="/usr/lib/flume/lib/${flume.sink.jar}" + +KAFKA_LINK_NAME="/usr/lib/ambari-metrics-kafka-sink/ambari-metrics-kafka-sink.jar" +KAFKA_SINK_JAR="/usr/lib/ambari-metrics-kafka-sink/${kafka.sink.jar}" + #link for storm jar not required with current loading #STORM_SINK_JAR="/usr/lib/storm/lib/${storm.sink.jar}" #STORM_LINK_NAME="/usr/lib/storm/lib/ambari-metrics-storm-sink.jar" -JARS=(${HADOOP_SINK_JAR} ${FLUME_SINK_JAR}) -LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME}) +JARS=(${HADOOP_SINK_JAR} ${FLUME_SINK_JAR} ${KAFKA_SINK_JAR}) +LINKS=(${HADOOP_LINK_NAME} ${FLUME_LINK_NAME} ${KAFKA_LINK_NAME}) for index in ${!LINKS[*]} do
ambari git commit: AMBARI-9278. Allow hostname customization for metric monitor. (swagle)
Repository: ambari Updated Branches: refs/heads/trunk ac240927a -> 373afaad7 AMBARI-9278. Allow hostname customization for metric monitor. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/373afaad Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/373afaad Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/373afaad Branch: refs/heads/trunk Commit: 373afaad7ff826ab7e1a284527e399fd033611bb Parents: ac24092 Author: Siddharth Wagle Authored: Thu Jan 22 12:10:10 2015 -0800 Committer: Siddharth Wagle Committed: Thu Jan 22 12:10:10 2015 -0800 -- .../src/main/python/core/config_reader.py | 3 ++ .../src/main/python/core/controller.py | 4 +-- .../src/main/python/core/host_info.py | 29 ++-- .../src/main/python/core/metric_collector.py| 4 +-- .../src/main/python/main.py | 3 +- .../src/test/python/core/TestHostInfo.py| 10 +++ .../src/test/python/core/TestMetricCollector.py | 2 +- 7 files changed, 40 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/373afaad/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py index 463c98c..f43f512 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py @@ -182,6 +182,9 @@ class Configuration: def get_server_address(self): return self.get("default", "metrics_server") + def get_hostname_script(self): +return self.get("default", "hostname_script") + def get_log_level(self): return self.get("default", "debug_level", "INFO") http://git-wip-us.apache.org/repos/asf/ambari/blob/373afaad/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/controller.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/controller.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/controller.py index e0ef804..1713501 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/controller.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/controller.py @@ -41,11 +41,11 @@ class Controller(threading.Thread): self.config = config self.metrics_config = config.getMetricGroupConfig() self.events_cache = [] -hostinfo = HostInfo() +hostinfo = HostInfo(config) self.application_metric_map = ApplicationMetricMap(hostinfo.get_hostname(), hostinfo.get_ip_address()) self.event_queue = Queue(config.get_max_queue_size()) -self.metric_collector = MetricsCollector(self.event_queue, self.application_metric_map) +self.metric_collector = MetricsCollector(self.event_queue, self.application_metric_map, hostinfo) self.server_url = config.get_server_address() self.sleep_interval = config.get_collector_sleep_interval() self._stop_handler = stop_handler http://git-wip-us.apache.org/repos/asf/ambari/blob/373afaad/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py index 020b84e..37c55cb 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py @@ -26,8 +26,11 @@ import platform import socket import time import threading +import socket +import subprocess logger = logging.getLogger() +cached_hostname = None def bytes2human(n): bytes = float(n) @@ -35,13 +38,14 @@ def bytes2human(n): return '%.2f' % gigabytes pass - class HostInfo(): - def __init__(self): + + def __init__(self, config): self.__last_network_io_time = 0 self.__last_network_data = {} self.__last_network_lock = threading.Lock() self.__host_static_info = self.get_host_static_info() +self.__config = config def get_cpu_times(self): """ @@ -245,7 +249,26 @@ class HostInfo(): pass def get_hostname(self): -return socket.getfqdn() +global cached_hostname +if cached_hostname is not None: + return cached_hostname + +try:
ambari git commit: AMBARI-9280. Ambari upgrade 1.4.4->2.0.0 fails (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/trunk 373afaad7 -> 77ae28e84 AMBARI-9280. Ambari upgrade 1.4.4->2.0.0 fails (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/77ae28e8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/77ae28e8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/77ae28e8 Branch: refs/heads/trunk Commit: 77ae28e8410ae2141c5140f8b72cca9e5e7983c8 Parents: 373afaa Author: Lisnichenko Dmitro Authored: Thu Jan 22 22:30:07 2015 +0200 Committer: Lisnichenko Dmitro Committed: Thu Jan 22 22:30:07 2015 +0200 -- .../src/main/python/ambari_server/serverConfiguration.py| 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/77ae28e8/ambari-server/src/main/python/ambari_server/serverConfiguration.py -- diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py index 44c30ce..5547e44 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -56,7 +56,10 @@ BOOTSTRAP_DIR_PROPERTY = "bootstrap.dir" AMBARI_CONF_VAR = "AMBARI_CONF_DIR" AMBARI_PROPERTIES_FILE = "ambari.properties" -AMBARI_PROPERTIES_BACKUP_FILE = "ambari.properties.backup" +if OSCheck.is_windows_family(): + AMBARI_PROPERTIES_BACKUP_FILE = "ambari.properties.backup" +else: + AMBARI_PROPERTIES_BACKUP_FILE = "ambari.properties.rpmsave" GET_FQDN_SERVICE_URL = "server.fqdn.service.url"
ambari git commit: AMBARI-9277. Blueprint configuration processing creates invalid templeton.hive.properties during cluster deployment. (rnettleton)
Repository: ambari Updated Branches: refs/heads/trunk 77ae28e84 -> 0a46a47ea AMBARI-9277. Blueprint configuration processing creates invalid templeton.hive.properties during cluster deployment. (rnettleton) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0a46a47e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0a46a47e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0a46a47e Branch: refs/heads/trunk Commit: 0a46a47eafe9e85331de237deca95f6ac06cb786 Parents: 77ae28e Author: Bob Nettleton Authored: Thu Jan 22 15:40:34 2015 -0500 Committer: Bob Nettleton Committed: Thu Jan 22 15:41:09 2015 -0500 -- .../BlueprintConfigurationProcessor.java| 2 +- .../BlueprintConfigurationProcessorTest.java| 141 +++ 2 files changed, 142 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0a46a47e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java index e7219e9..d2af1d7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java @@ -1162,7 +1162,7 @@ public class BlueprintConfigurationProcessor { multiCoreSiteMap.put("hadoop.proxyuser.hive.hosts", new MultipleHostTopologyUpdater("HIVE_SERVER")); multiCoreSiteMap.put("hadoop.proxyuser.HTTP.hosts", new MultipleHostTopologyUpdater("WEBHCAT_SERVER")); multiCoreSiteMap.put("hadoop.proxyuser.hcat.hosts", new MultipleHostTopologyUpdater("WEBHCAT_SERVER")); -multiWebhcatSiteMap.put("templeton.hive.properties", new MultipleHostTopologyUpdater("HIVE_SERVER")); +multiWebhcatSiteMap.put("templeton.hive.properties", new SingleHostTopologyUpdater("HIVE_METASTORE")); multiWebhcatSiteMap.put("templeton.kerberos.principal", new MultipleHostTopologyUpdater("WEBHCAT_SERVER")); hiveEnvMap.put("hive_hostname", new SingleHostTopologyUpdater("HIVE_SERVER")); multiHiveSiteMap.put("hive.zookeeper.quorum", new MultipleHostTopologyUpdater("ZOOKEEPER_SERVER")); http://git-wip-us.apache.org/repos/asf/ambari/blob/0a46a47e/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java index 9f47163..cac1602 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java @@ -1246,6 +1246,147 @@ public class BlueprintConfigurationProcessorTest { } @Test + public void testHiveConfigClusterUpdateCustomValue() throws Exception { +final String expectedHostGroupName = "host_group_1"; + +final String expectedPropertyValue = + "hive.metastore.local=false,hive.metastore.uris=thrift://headnode0.ivantestcluster2-ssh.d1.internal.cloudapp.net:9083,hive.user.install.directory=/user"; + +EasyMockSupport mockSupport = new EasyMockSupport(); + +HostGroup mockHostGroupOne = mockSupport.createMock(HostGroup.class); + + expect(mockHostGroupOne.getComponents()).andReturn(Collections.singleton("HIVE_METASTORE")).atLeastOnce(); + expect(mockHostGroupOne.getHostInfo()).andReturn(Collections.singleton("test-host-one")).atLeastOnce(); + +mockSupport.replayAll(); + +Map> configProperties = + new HashMap>(); + +Map webHCatSiteProperties = + new HashMap(); + +configProperties.put("webhcat-site", webHCatSiteProperties); + +// setup properties that include host information +webHCatSiteProperties.put("templeton.hive.properties", + expectedPropertyValue); + +BlueprintConfigurationProcessor configProcessor = + new BlueprintConfigurationProcessor(configProperties); + +Map mapOfHostGroups = + new HashMap(); +mapOfHostGroups.put(expectedHostGroupName, mockHostGroupOne); + +// call top-level cluster config update method +configProcessor.doUpdateForClusterCreate(mapOfHostGroups, null); + +assertEquals("Unexpected c
[2/2] ambari git commit: AMBARI-9268. Config changes doesn't affect client components (alexantonenko)
AMBARI-9268. Config changes doesn't affect client components (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1d01d35a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1d01d35a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1d01d35a Branch: refs/heads/trunk Commit: 1d01d35a6cc612ca4562371fa84e4a3064a05f91 Parents: 2e10a75 Author: Alex Antonenko Authored: Thu Jan 22 20:59:05 2015 +0200 Committer: Alex Antonenko Committed: Thu Jan 22 22:50:29 2015 +0200 -- ambari-web/app/models/service.js | 2 +- ambari-web/test/models/service_test.js | 31 ++--- 2 files changed, 25 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1d01d35a/ambari-web/app/models/service.js -- diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js index 69fa446..3de8001 100644 --- a/ambari-web/app/models/service.js +++ b/ambari-web/app/models/service.js @@ -95,7 +95,7 @@ App.Service = DS.Model.extend({ * actual_configs, then a restart is required. */ isRestartRequired: function () { -var rhc = this.get('hostComponents').filterProperty('staleConfigs', true); +var rhc = App.HostComponent.find().filterProperty('service.serviceName', this.get('serviceName')).filterProperty('staleConfigs', true); var hc = {}; rhc.forEach(function(_rhc) { var hostName = _rhc.get('hostName'); http://git-wip-us.apache.org/repos/asf/ambari/blob/1d01d35a/ambari-web/test/models/service_test.js -- diff --git a/ambari-web/test/models/service_test.js b/ambari-web/test/models/service_test.js index f93f0e0..ad7d7fa 100644 --- a/ambari-web/test/models/service_test.js +++ b/ambari-web/test/models/service_test.js @@ -140,7 +140,9 @@ var service, ], [ { -serviceName: 'HIVE', +service: { + serviceName: 'HIVE' +}, staleConfigs: false } ] @@ -148,6 +150,9 @@ var service, hostComponentsDataTrue = [ [ Em.Object.create({ +service: { + serviceName: 'HDFS' +}, staleConfigs: true, displayName: 'service0' }) @@ -157,6 +162,9 @@ var service, host: { publicHostName: 'host0' }, +service: { + serviceName: 'HDFS' +}, staleConfigs: true, displayName: 'service1' }) @@ -214,19 +222,28 @@ describe('App.Service', function () { }); describe('#isRestartRequired', function () { +var mockHostComponentModel = function (mock) { + sinon.stub(App.HostComponent, 'find', function () { +return mock; + }); +} +beforeEach(function () { + service.reopen({ +serviceName: 'HDFS' + }); +}); +afterEach(function () { + App.HostComponent.find.restore(); +}); hostComponentsDataFalse.forEach(function (item) { it('should be false', function () { -service.reopen({ - hostComponents: item -}); +mockHostComponentModel(item); expect(service.get('isRestartRequired')).to.be.false; }); }); hostComponentsDataTrue.forEach(function (item) { it('should be true', function () { -service.reopen({ - hostComponents: item -}); +mockHostComponentModel(item); expect(service.get('isRestartRequired')).to.be.true; }); });
[1/2] ambari git commit: AMBARI-9273. Hide Ranger from showing up in the list of services in Install Wizard (but must appear in Add Services and Stacks page) (alexantonenko)
Repository: ambari Updated Branches: refs/heads/trunk 0a46a47ea -> 1d01d35a6 AMBARI-9273. Hide Ranger from showing up in the list of services in Install Wizard (but must appear in Add Services and Stacks page) (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2e10a752 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2e10a752 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2e10a752 Branch: refs/heads/trunk Commit: 2e10a7528cc2b675702582636dd3cab12c1757f4 Parents: 0a46a47 Author: Alex Antonenko Authored: Thu Jan 22 20:34:01 2015 +0200 Committer: Alex Antonenko Committed: Thu Jan 22 22:50:28 2015 +0200 -- ambari-web/app/config.js | 1 - ambari-web/app/controllers/wizard/step4_controller.js | 2 +- ambari-web/app/models/stack_service.js| 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2e10a752/ambari-web/app/config.js -- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index 606920b..978c26b 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -64,7 +64,6 @@ App.supports = { alwaysEnableManagedMySQLForHive: false, preKerberizeCheck: false, automatedKerberos: true, - ranger: false, customizeAgentUserAccount: false, installGanglia: false, opsDuringRollingUpgrade: false http://git-wip-us.apache.org/repos/asf/ambari/blob/2e10a752/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 ad1d210..673545f 100644 --- a/ambari-web/app/controllers/wizard/step4_controller.js +++ b/ambari-web/app/controllers/wizard/step4_controller.js @@ -218,7 +218,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({ * @method isDFSStack */ isDFSStack: function () { - var bDFSStack = false; + var bDFSStack = false; var dfsServices = ['HDFS', 'GLUSTERFS']; var availableServices = this.filterProperty('isInstalled',false); availableServices.forEach(function(service){ http://git-wip-us.apache.org/repos/asf/ambari/blob/2e10a752/ambari-web/app/models/stack_service.js -- diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js index 517499b..f7b03ca 100644 --- a/ambari-web/app/models/stack_service.js +++ b/ambari-web/app/models/stack_service.js @@ -87,6 +87,9 @@ App.StackService = DS.Model.extend({ if(!App.supports.installGanglia) { skipServices.push('GANGLIA'); } +if(App.router.get('clusterInstallCompleted') != true){ + skipServices.push('RANGER'); +} return skipServices.contains(this.get('serviceName')); }.property('serviceName'),
ambari git commit: AMBARI-9283. Python logging fails with non-ascii characters in Mysql password (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/trunk 1d01d35a6 -> 06277ee15 AMBARI-9283. Python logging fails with non-ascii characters in Mysql password (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/06277ee1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/06277ee1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/06277ee1 Branch: refs/heads/trunk Commit: 06277ee15a9fb451147237873f28371d1c0ab3c4 Parents: 1d01d35 Author: Lisnichenko Dmitro Authored: Thu Jan 22 23:18:42 2015 +0200 Committer: Lisnichenko Dmitro Committed: Thu Jan 22 23:18:42 2015 +0200 -- .../TestDirectoryResource.py| 6 +++--- .../TestExecuteHadoopResource.py| 2 +- .../resource_management/TestFileResource.py | 4 ++-- .../resource_management/TestLinkResource.py | 4 ++-- .../TestMonitorWebserverResource.py | 22 +++- .../python/resource_management/TestScript.py| 2 +- .../resource_management/TestUserResource.py | 1 + .../python/resource_management/core/base.py | 2 +- 8 files changed, 23 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/06277ee1/ambari-agent/src/test/python/resource_management/TestDirectoryResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestDirectoryResource.py b/ambari-agent/src/test/python/resource_management/TestDirectoryResource.py index 0705922..fe64400 100644 --- a/ambari-agent/src/test/python/resource_management/TestDirectoryResource.py +++ b/ambari-agent/src/test/python/resource_management/TestDirectoryResource.py @@ -112,7 +112,7 @@ class TestDirectoryResource(TestCase): ) self.fail("Must fail because parent directory /a/b/c doesn't exist") except Fail as e: - self.assertEqual("Applying Directory['/a/b/c/d'] failed, parent directory /a/b/c doesn't exist", + self.assertEqual('Applying u"Directory[\'/a/b/c/d\']" failed, parent directory /a/b/c doesn\'t exist', str(e)) @patch.object(os.path, "exists") @@ -131,7 +131,7 @@ class TestDirectoryResource(TestCase): ) self.fail("Must fail because file /a/b/c/d already exists") except Fail as e: - self.assertEqual("Applying Directory['/a/b/c/d'] failed, file /a/b/c/d already exists", + self.assertEqual('Applying u"Directory[\'/a/b/c/d\']" failed, file /a/b/c/d already exists', str(e)) @patch.object(shutil, "rmtree") @@ -171,5 +171,5 @@ class TestDirectoryResource(TestCase): ) self.fail("Must fail because /a/b/c/d is not a directory") except Fail as e: - self.assertEqual("Applying Directory['/a/b/c/d'] failed, /a/b/c/d is not a directory", + self.assertEqual('Applying u"Directory[\'/a/b/c/d\']" failed, /a/b/c/d is not a directory', str(e)) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/06277ee1/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py index 6ca6f36..a368e5d 100644 --- a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py +++ b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py @@ -176,7 +176,7 @@ class TestExecuteHadoopResource(TestCase): ) self.assertEqual(execute_mock.call_count, 2) self.assertEqual(str(execute_mock.call_args_list[0][0][0]), - "Execute['path -kt keytab principal']") + 'u"Execute[\'path -kt keytab principal\']"') self.assertEqual(execute_mock.call_args_list[0][0][0].command, 'path -kt keytab principal') self.assertEqual(execute_mock.call_args_list[0][0][0].arguments, http://git-wip-us.apache.org/repos/asf/ambari/blob/06277ee1/ambari-agent/src/test/python/resource_management/TestFileResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestFileResource.py b/ambari-agent/src/test/python/resource_management/TestFileResource.py index 063de19..28fa610 100644 --- a/ambari-agent/src/test/python/resource_management/TestFileResource.py +++ b/ambari-agent/src/test/python/resource_management/TestFileResource.py @@ -48,7 +48,7 @@ class TestFileResource(TestCase): self.fail("Must fail when directory with name 'path' exist") except Fail as e: -
ambari git commit: AMBARI-9279. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem (rlevas)
Repository: ambari Updated Branches: refs/heads/trunk 06277ee15 -> 08738a55d AMBARI-9279. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/08738a55 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/08738a55 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/08738a55 Branch: refs/heads/trunk Commit: 08738a55d5558e0850ab6c6e33b5ef94a11932ee Parents: 06277ee Author: Robert Levas Authored: Thu Jan 22 16:29:52 2015 -0500 Committer: Robert Levas Committed: Thu Jan 22 16:30:00 2015 -0500 -- .../common-services/YARN/2.1.0.2.0/package/scripts/yarn.py | 5 + .../src/test/python/stacks/2.0.6/YARN/test_nodemanager.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/08738a55/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py -- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py index 3bd4825..4ae649c 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py @@ -70,6 +70,11 @@ def yarn(name = None): mode=0775 ) +if params.security_enabled: + smokeuser_directories = [os.path.join(dir, 'usercache' ,params.smokeuser) + for dir in params.nm_local_dirs.split(',')] + for directory in smokeuser_directories: +Execute(format("chown -R {params.smokeuser} {directory}")) Directory([params.yarn_pid_dir_prefix, params.yarn_pid_dir, params.yarn_log_dir], owner=params.yarn_user, group=params.user_group, http://git-wip-us.apache.org/repos/asf/ambari/blob/08738a55/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py index fbf01c6..d852ad1 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py @@ -438,6 +438,7 @@ class TestNodeManager(RMFTestCase): mode = 0775, cd_access='a' ) +self.assertResourceCalled('Execute', 'chown -R ambari-qa /hadoop/yarn/local/usercache/ambari-qa') self.assertResourceCalled('Directory', '/var/run/hadoop-yarn', owner = 'yarn', group = 'hadoop', @@ -751,4 +752,4 @@ class TestNodeManager(RMFTestCase): hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) -put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) \ No newline at end of file +put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"})
ambari git commit: AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle)
Repository: ambari Updated Branches: refs/heads/trunk 08738a55d -> af5372656 AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af537265 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af537265 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af537265 Branch: refs/heads/trunk Commit: af5372656b9679b10e2792da8dd0ca4510ba1962 Parents: 08738a5 Author: Siddharth Wagle Authored: Thu Jan 22 13:26:29 2015 -0800 Committer: Siddharth Wagle Committed: Thu Jan 22 13:33:50 2015 -0800 -- .../src/main/python/core/config_reader.py | 16 ++-- .../src/main/python/core/host_info.py | 1 - 2 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/af537265/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py index f43f512..62a5f16 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py @@ -61,7 +61,6 @@ class ConfigDefaultsLinux(ConfigDefaults): configDefaults = ConfigDefaults() - config = ConfigParser.RawConfigParser() CONFIG_FILE_PATH = configDefaults.get_config_file_path() @@ -84,6 +83,8 @@ STOP_ACTION = "stop" RESTART_ACTION = "restart" STATUS_ACTION = "status" +AMBARI_AGENT_CONF = '/etc/ambari-agent/conf/ambari-agent.ini' + config_content = """ [default] debug_level = INFO @@ -139,6 +140,7 @@ metric_group_info = """ } """ + class Configuration: def __init__(self): @@ -160,6 +162,13 @@ class Configuration: } pass +self.hostname_script = None +ambari_agent_config = ConfigParser.RawConfigParser() +if os.path.exists(AMBARI_AGENT_CONF): + ambari_agent_config.read(AMBARI_AGENT_CONF) + self.hostname_script = ambari_agent_config.get('agent', 'hostname_script') +pass + def getConfig(self): return self.config @@ -183,7 +192,10 @@ class Configuration: return self.get("default", "metrics_server") def get_hostname_script(self): -return self.get("default", "hostname_script") +if self.hostname_script: + return self.hostname_script +else: + return self.get("default", "hostname_script") def get_log_level(self): return self.get("default", "debug_level", "INFO") http://git-wip-us.apache.org/repos/asf/ambari/blob/af537265/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py index 37c55cb..caa972c 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py @@ -23,7 +23,6 @@ import psutil import os from collections import namedtuple import platform -import socket import time import threading import socket
ambari git commit: AMBARI-9226. Alerts: "Use authentication" checked but should not be
Repository: ambari Updated Branches: refs/heads/trunk af5372656 -> 6110665c6 AMBARI-9226. Alerts: "Use authentication" checked but should not be Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6110665c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6110665c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6110665c Branch: refs/heads/trunk Commit: 6110665c6ab2e126492e40d6ff99f2e3edf62b31 Parents: af53726 Author: Srimanth Gunturi Authored: Thu Jan 22 11:15:46 2015 -0800 Committer: Srimanth Gunturi Committed: Thu Jan 22 13:44:43 2015 -0800 -- .../main/alerts/manage_alert_notifications_controller.js | 4 ++-- .../main/alerts/manage_alert_notifications_controller_test.js| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/6110665c/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 bc03905..be8c3e9 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 @@ -290,11 +290,11 @@ App.ManageAlertNotificationsController = Em.Controller.extend({ 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']); +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']); +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']); http://git-wip-us.apache.org/repos/asf/ambari/blob/6110665c/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js -- diff --git a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js index 9f3c498..054dcd5 100644 --- a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js +++ b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js @@ -296,7 +296,7 @@ describe('App.ManageAlertNotificationsController', function () { value: '25' }, SMTPUseAuthentication: { - value: "true" + value: true }, SMTPUsername: { value: 'user' @@ -308,7 +308,7 @@ describe('App.ManageAlertNotificationsController', function () { value: 'pass' }, SMTPSTARTTLS: { - value: "true" + value: true }, emailFrom: { value: 'from'
ambari git commit: AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas)
Repository: ambari Updated Branches: refs/heads/trunk 6110665c6 -> 859279a37 AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/859279a3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/859279a3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/859279a3 Branch: refs/heads/trunk Commit: 859279a37d098bd4da89ec2e7c08c837f8698f15 Parents: 6110665 Author: Robert Levas Authored: Thu Jan 22 17:08:15 2015 -0500 Committer: Robert Levas Committed: Thu Jan 22 17:08:31 2015 -0500 -- .../AmbariManagementControllerImpl.java | 62 +--- .../AmbariManagementControllerImplTest.java | 58 ++ .../AmbariManagementControllerTest.java | 6 +- 3 files changed, 102 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/859279a3/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index dd18e8d..7e4ce69 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1196,7 +1196,51 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle cluster.setClusterName(request.getClusterName()); } -// set or create configuration mapping (and optionally create the map of properties) +// -- +// Check to see if the security state is being changed... if so, attempt to enable or disable +// Kerberos +boolean toggleKerberos = false; + +String desiredSecurityState = null; +List desiredConfig = request.getDesiredConfig(); +if (desiredConfig != null) { + for (ConfigurationRequest configurationRequest : desiredConfig) { +if ("cluster-env".equals(configurationRequest.getType())) { + Map properties = configurationRequest.getProperties(); + + if ((properties == null) || properties.isEmpty()) { +Config configClusterEnv = cluster.getConfig(configurationRequest.getType(), configurationRequest.getVersionTag()); +if (configClusterEnv != null) { + properties = configClusterEnv.getProperties(); +} + } + + desiredSecurityState = (properties == null) ? null : properties.get("security_enabled"); +} + } +} + +if(desiredSecurityState != null) { + Config configClusterEnv = cluster.getDesiredConfigByType("cluster-env"); + if (configClusterEnv == null) { +String message = "The 'cluster-env' configuration is not available"; +LOG.error(message); +throw new AmbariException(message); + } + + Map clusterEnvProperties = configClusterEnv.getProperties(); + if (clusterEnvProperties == null) { +String message = "The 'cluster-env' configuration properties are not available"; +LOG.error(message); +throw new AmbariException(message); + } + + toggleKerberos = !desiredSecurityState.equals(clusterEnvProperties.get("security_enabled")); +} +// -- + + +// set or create configuration mapping (and optionally create the map of properties) if (null != request.getDesiredConfig()) { Set configs = new HashSet(); String note = null; @@ -1326,13 +1370,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle } RequestStageContainer requestStageContainer = null; -Map services = cluster.getServices(); -if ((services != null) && services.containsKey("KERBEROS")) { - // Handle either adding or removing Kerberos from the cluster. This may generate multiple stages - // or not depending the current state of the cluster. The main configuration used to determine - // whether Kerberos is to be added or removed is cluster-config/security_enabled. - requestStageContainer = kerberosHelper.toggleKerberos(cluster, - request.getKerberosDescriptor(), null); +if(toggleKerberos) { + Map services = cluster.getServices(); + if ((services != null) && services.containsKey("KERBEROS")) { +// Handle either adding or removing Kerberos from the cluster. This may generate multiple stages +// or not depending the current state of the cluster.
[05/14] ambari git commit: AMBARI-9149. Test principal and keytab required for service check should be created as part of kerberos service check action (rlevas)
AMBARI-9149. Test principal and keytab required for service check should be created as part of kerberos service check action (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/339e8a76 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/339e8a76 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/339e8a76 Branch: refs/heads/2.0-preview Commit: 339e8a76a4b43c5ba12953a3cd66558647eda4a9 Parents: 9f29148 Author: Robert Levas Authored: Wed Jan 21 13:51:45 2015 -0500 Committer: Yusaku Sako Committed: Wed Jan 21 12:21:46 2015 -0800 -- .../AmbariManagementControllerImpl.java | 33 +- .../server/controller/KerberosHelper.java | 876 --- .../internal/RequestStageContainer.java | 24 +- .../KERBEROS/1.10.3-10/kerberos.json| 17 + .../main/resources/stacks/HDP/2.2/kerberos.json | 2 +- .../AmbariCustomCommandExecutionHelperTest.java | 49 +- .../BackgroundCustomCommandExecutionTest.java | 16 +- .../server/controller/KerberosHelperTest.java | 327 ++- 8 files changed, 992 insertions(+), 352 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/339e8a76/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index ae57d1f..dd18e8d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -2823,12 +2823,31 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle actionExecutionHelper.validateAction(actionRequest); } +long requestId = actionManager.getNextRequestId(); +RequestStageContainer requestStageContainer = new RequestStageContainer( +requestId, +null, +requestFactory, +actionManager, +actionRequest); + +// If the request is to perform the Kerberos service check, set up the stages to +// ensure that the (cluster-level) smoke user principal and keytab is available on all hosts +if (Role.KERBEROS_SERVICE_CHECK.name().equals(actionRequest.getCommandName())) { + Map> serviceComponentFilter = new HashMap>(); + Collection identityFilter = Arrays.asList("/smokeuser"); + + serviceComponentFilter.put("KERBEROS", null); + + requestStageContainer = kerberosHelper.ensureIdentities(cluster, null, serviceComponentFilter, + identityFilter, requestStageContainer); +} + ExecuteCommandJson jsons = customCommandExecutionHelper.getCommandJson( actionExecContext, cluster); -Stage stage = createNewStage(0, cluster, actionManager.getNextRequestId(), requestContext, - jsons.getClusterHostInfo(), jsons.getCommandParamsForStage(), -jsons.getHostParamsForStage()); +Stage stage = createNewStage(requestStageContainer.getLastStageId(), cluster, requestId, requestContext, +jsons.getClusterHostInfo(), jsons.getCommandParamsForStage(), jsons.getHostParamsForStage()); if (actionRequest.isCommand()) { customCommandExecutionHelper.addExecutionCommandsToStage(actionExecContext, stage, requestProperties, false); @@ -2848,11 +2867,11 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle List stages = rg.getStages(); if (stages != null && !stages.isEmpty()) { - actionManager.sendActions(stages, actionRequest); - return getRequestStatusResponse(stage.getRequestId()); -} else { - throw new AmbariException("Stage was not created"); + requestStageContainer.addStages(stages); } + +requestStageContainer.persist(); +return requestStageContainer.getRequestStatusResponse(); } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/339e8a76/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java index a425e95..6620577 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java @@ -115,6 +115,10 @@ public class KerberosHelper { */ private Handler disableKerberosH
[11/14] ambari git commit: AMBARI-9253. Kerberos wizard->Start and Test services: all service check fails with customized smokeuser principal. (jaimin)
AMBARI-9253. Kerberos wizard->Start and Test services: all service check fails with customized smokeuser principal. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/786d7802 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/786d7802 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/786d7802 Branch: refs/heads/2.0-preview Commit: 786d780293737c3b54a3655a122b5fb70fc1a3d8 Parents: 757256d Author: Jaimin Jetly Authored: Wed Jan 21 20:21:53 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 08:26:03 2015 -0800 -- .../resource_management/TestExecuteHadoopResource.py | 5 +++-- .../libraries/resources/execute_hadoop.py| 2 +- .../HBASE/0.96.0.2.0/package/scripts/params.py | 1 + .../HBASE/0.96.0.2.0/package/scripts/service_check.py| 2 +- .../HIVE/0.12.0.2.0/package/files/templetonSmoke.sh | 3 ++- .../0.12.0.2.0/package/scripts/hive_server_upgrade.py| 2 +- .../HIVE/0.12.0.2.0/package/scripts/params.py| 1 + .../HIVE/0.12.0.2.0/package/scripts/service_check.py | 2 +- .../0.12.0.2.0/package/scripts/webhcat_service_check.py | 10 -- .../KERBEROS/1.10.3-10/package/scripts/params.py | 2 +- .../KNOX/0.5.0.2.2/package/scripts/params.py | 1 + .../KNOX/0.5.0.2.2/package/scripts/service_check.py | 2 +- .../4.0.0.2.0/package/alerts/alert_check_oozie_server.py | 2 +- .../OOZIE/4.0.0.2.0/package/files/oozieSmoke2.sh | 3 ++- .../OOZIE/4.0.0.2.0/package/scripts/params.py| 1 + .../OOZIE/4.0.0.2.0/package/scripts/service_check.py | 2 +- .../PIG/0.12.0.2.0/package/scripts/params.py | 1 + .../PIG/0.12.0.2.0/package/scripts/service_check.py | 4 +++- .../SLIDER/0.60.0.2.2/package/scripts/params.py | 1 + .../SLIDER/0.60.0.2.2/package/scripts/service_check.py | 2 +- .../SQOOP/1.4.4.2.0/package/scripts/params.py| 1 + .../SQOOP/1.4.4.2.0/package/scripts/service_check.py | 2 +- .../2.1.0.2.0/package/scripts/mapred_service_check.py| 2 +- .../YARN/2.1.0.2.0/package/scripts/params.py | 1 + .../YARN/2.1.0.2.0/package/scripts/service_check.py | 2 +- .../ZOOKEEPER/3.4.5.2.0/package/files/zkSmoke.sh | 3 ++- .../ZOOKEEPER/3.4.5.2.0/package/scripts/params.py| 1 + .../ZOOKEEPER/3.4.5.2.0/package/scripts/service_check.py | 11 +-- .../3.4.5.2.0/package/scripts/zookeeper_service.py | 2 +- .../stacks/2.0.6/HBASE/test_hbase_service_check.py | 4 ++-- .../python/stacks/2.0.6/HIVE/test_hive_service_check.py | 6 +++--- .../python/stacks/2.0.6/PIG/test_pig_service_check.py| 2 ++ .../test/python/stacks/2.0.6/SQOOP/test_service_check.py | 2 +- .../stacks/2.0.6/YARN/test_mapreduce2_service_check.py | 2 +- .../python/stacks/2.0.6/YARN/test_yarn_service_check.py | 2 +- .../stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py | 2 +- .../2.0.6/ZOOKEEPER/test_zookeeper_service_check.py | 6 +++--- .../src/test/python/stacks/2.0.6/configs/secured.json| 1 + .../src/test/python/stacks/2.1/configs/secured.json | 1 + .../test/python/stacks/2.2/SLIDER/test_slider_client.py | 2 +- .../src/test/python/stacks/2.2/configs/secured.json | 1 + 41 files changed, 69 insertions(+), 36 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/786d7802/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py index ae137a5..6ca6f36 100644 --- a/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py +++ b/ambari-agent/src/test/python/resource_management/TestExecuteHadoopResource.py @@ -166,6 +166,7 @@ class TestExecuteHadoopResource(TestCase): kinit_path_local="path", conf_dir="conf_dir", user="user", +principal="principal", tries=1, keytab="keytab", security_enabled=True, @@ -175,9 +176,9 @@ class TestExecuteHadoopResource(TestCase): ) self.assertEqual(execute_mock.call_count, 2) self.assertEqual(str(execute_mock.call_args_list[0][0][0]), - "Execute['path -kt keytab user']") + "Execute['path -kt keytab principal']") self.assertEqual(execute_mock.call_args_list[0][0][0].command, - 'path -kt keytab user') + 'path -kt keytab principal') self.assertEqual(execute_mock.call_args_
[04/14] ambari git commit: AMBARI-9149. Test principal and keytab required for service check should be created as part of kerberos service check action (rlevas)
http://git-wip-us.apache.org/repos/asf/ambari/blob/339e8a76/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java index 0b58fc0..c6c9574 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java @@ -70,6 +70,8 @@ import org.junit.Test; import javax.persistence.EntityManager; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -169,13 +171,49 @@ public class KerberosHelperTest extends EasyMockSupport { final Map clusterEnvProperties = createNiceMock(Map.class); expect(clusterEnvProperties.get("security_enabled")).andReturn("true").once(); - expect(clusterEnvProperties.get("kerberos_domain")).andReturn("FOOBAR.COM").once(); final Config clusterEnvConfig = createNiceMock(Config.class); expect(clusterEnvConfig.getProperties()).andReturn(clusterEnvProperties).once(); +final Map kerberosEnvProperties = createNiceMock(Map.class); +expect(clusterEnvProperties.get("ldap_url")).andReturn("").once(); +expect(clusterEnvProperties.get("container_dn")).andReturn("").once(); + +final Config kerberosEnvConfig = createNiceMock(Config.class); + expect(kerberosEnvConfig.getProperties()).andReturn(kerberosEnvProperties).once(); + +final Cluster cluster = createNiceMock(Cluster.class); + expect(cluster.getDesiredConfigByType("cluster-env")).andReturn(clusterEnvConfig).once(); + expect(cluster.getDesiredConfigByType("kerberos-env")).andReturn(kerberosEnvConfig).once(); + +final KerberosDescriptor kerberosDescriptor = createNiceMock(KerberosDescriptor.class); + +replayAll(); +kerberosHelper.toggleKerberos(cluster, kerberosDescriptor, null); +verifyAll(); + } + + @Test(expected = AmbariException.class) + public void testMissingKerberosEnvConf() throws Exception { +KerberosHelper kerberosHelper = injector.getInstance(KerberosHelper.class); + +final Map clusterEnvProperties = createNiceMock(Map.class); + expect(clusterEnvProperties.get("security_enabled")).andReturn("true").once(); + +final Config clusterEnvConfig = createNiceMock(Config.class); + expect(clusterEnvConfig.getProperties()).andReturn(clusterEnvProperties).once(); + +final Map krb5ConfProperties = createNiceMock(Map.class); +expect(krb5ConfProperties.get("kdc_host")).andReturn("10.0.100.1").once(); + expect(krb5ConfProperties.get("kadmin_host")).andReturn("10.0.100.1").once(); +expect(krb5ConfProperties.get("realm")).andReturn("EXAMPLE.COM").once(); + +final Config krb5ConfConfig = createNiceMock(Config.class); + expect(krb5ConfConfig.getProperties()).andReturn(krb5ConfProperties).once(); + final Cluster cluster = createNiceMock(Cluster.class); expect(cluster.getDesiredConfigByType("cluster-env")).andReturn(clusterEnvConfig).once(); + expect(cluster.getDesiredConfigByType("krb5-conf")).andReturn(krb5ConfConfig).once(); final KerberosDescriptor kerberosDescriptor = createNiceMock(KerberosDescriptor.class); @@ -193,8 +231,7 @@ public class KerberosHelperTest extends EasyMockSupport { public void testEnableKerberosMissingCredentials() throws Exception { try { testEnableKerberos(null); -} -catch (IllegalArgumentException e) { +} catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().startsWith("Missing KDC administrator credentials")); throw e; } @@ -204,8 +241,32 @@ public class KerberosHelperTest extends EasyMockSupport { public void testEnableKerberosInvalidCredentials() throws Exception { try { testEnableKerberos(new KerberosCredential("invalid_principal", "password", "keytab")); +} catch (IllegalArgumentException e) { + Assert.assertTrue(e.getMessage().startsWith("Invalid KDC administrator credentials")); + throw e; +} + } + + @Test + public void testEnsureIdentities() throws Exception { +testEnsureIdentities(new KerberosCredential("principal", "password", "keytab")); + } + + @Test(expected = IllegalArgumentException.class) + public void testEnsureIdentitiesMissingCredentials() throws Exception { +try { + testEnsureIdentities(null); +} catch (IllegalArgumentException e) { + Assert.assertTrue(e.getMessage().startsWith("Missing KDC administrator credentials")); + throw e; } -catch (IllegalArgumentException e) { + } + + @Test(expected = IllegalArgumentException.class) + public void testEnsureIdentitiesInvalidCredentials() throws E
[07/14] ambari git commit: AMBARI-9247. Wrong stack version of Service installed (ncole)
AMBARI-9247. Wrong stack version of Service installed (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/84bfe433 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/84bfe433 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/84bfe433 Branch: refs/heads/2.0-preview Commit: 84bfe4334531fd049281ee869128a09cac06f6ee Parents: 049b692 Author: Nate Cole Authored: Wed Jan 21 15:05:10 2015 -0500 Committer: Yusaku Sako Committed: Wed Jan 21 14:16:22 2015 -0800 -- .../server/api/services/AmbariMetaInfo.java | 8 ++-- .../apache/ambari/server/stack/StackModule.java | 13 --- .../ambari/server/state/RepositoryInfo.java | 27 ++--- .../server/state/stack/LatestRepoCallable.java | 3 +- .../server/api/services/AmbariMetaInfoTest.java | 18 - .../server/upgrade/StackUpgradeUtilTest.java| 40 ++-- 6 files changed, 70 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/84bfe433/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java index 1b7e2fe..897cf52 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java @@ -44,17 +44,17 @@ import org.apache.ambari.server.customactions.ActionDefinition; import org.apache.ambari.server.customactions.ActionDefinitionManager; import org.apache.ambari.server.events.AlertDefinitionRegistrationEvent; import org.apache.ambari.server.events.publishers.AmbariEventPublisher; +import org.apache.ambari.server.metadata.ActionMetadata; import org.apache.ambari.server.metadata.AgentAlertDefinitions; import org.apache.ambari.server.orm.dao.AlertDefinitionDAO; -import org.apache.ambari.server.metadata.ActionMetadata; import org.apache.ambari.server.orm.dao.MetainfoDAO; import org.apache.ambari.server.orm.entities.AlertDefinitionEntity; import org.apache.ambari.server.orm.entities.MetainfoEntity; import org.apache.ambari.server.stack.StackContext; import org.apache.ambari.server.stack.StackDirectory; +import org.apache.ambari.server.stack.StackManager; import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Clusters; -import org.apache.ambari.server.stack.StackManager; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.DependencyInfo; import org.apache.ambari.server.state.OperatingSystemInfo; @@ -766,10 +766,12 @@ public class AmbariMetaInfo { entity.setMetainfoName(metaKey); entity.setMetainfoValue(newBaseUrl); - if (null != ri.getDefaultBaseUrl() && newBaseUrl.equals(ri.getDefaultBaseUrl())) { + // !!! need a way to remove + if (newBaseUrl.equals("")) { metaInfoDAO.remove(entity); } else { metaInfoDAO.merge(entity); +ri.setBaseUrlFromSaved(true); } } } http://git-wip-us.apache.org/repos/asf/ambari/blob/84bfe433/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java index 933f187..8da2ff9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java @@ -18,6 +18,12 @@ package org.apache.ambari.server.stack; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.state.RepositoryInfo; @@ -29,12 +35,6 @@ import org.apache.ambari.server.state.stack.StackMetainfoXml; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * Stack module which provides all functionality related to parsing and fully * resolving stacks from the stack definition. @@ -561,6 +561,7 @@ public class StackModule extends BaseModule { if (null != updatedUrl) { ri.setBaseUrl(updatedUrl); + ri.setBaseUrlFromSaved(true); } if (LOG.isDebugEnabled()) { http://git-wip-us.apac
[03/14] ambari git commit: AMBARI-9209. Add the ability to append a random value to values in LDAP attributes when generating principals in Active Directory (rlevas)
AMBARI-9209. Add the ability to append a random value to values in LDAP attributes when generating principals in Active Directory (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9f291484 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9f291484 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9f291484 Branch: refs/heads/2.0-preview Commit: 9f291484ae3764975e3f3f2c616288454bca41c5 Parents: ae82067 Author: Robert Levas Authored: Wed Jan 21 11:20:30 2015 -0500 Committer: Yusaku Sako Committed: Wed Jan 21 12:21:26 2015 -0800 -- .../kerberos/ADKerberosOperationHandler.java| 161 +- .../kerberos/DeconstructedPrincipal.java| 201 + .../kerberos/KerberosOperationHandler.java | 10 +- .../1.10.3-10/configuration/kerberos-env.xml| 16 +- .../ADKerberosOperationHandlerTest.java | 301 +++ .../kerberos/DeconstructedPrincipalTest.java| 113 +++ 6 files changed, 582 insertions(+), 220 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9f291484/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java index 20f7e60..b5de64f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java @@ -21,7 +21,7 @@ package org.apache.ambari.server.serveraction.kerberos; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; -import org.apache.ambari.server.utils.StageUtils; +import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.velocity.VelocityContext; @@ -42,8 +42,6 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Properties; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Implementation of KerberosOperationHandler to created principal in Active Directory @@ -52,15 +50,6 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler { private static Log LOG = LogFactory.getLog(ADKerberosOperationHandler.class); - /** - * Regular expression to parse the different principal formats: - * primary/instance@REALM - * primary@REALM - * primary/instance - * primary - */ - private static Pattern PATTERN_PRINCIPAL = Pattern.compile("^(([^ /@]+)(?:/([^ /@]+))?)(?:@(.+)?)?$"); - private static final String LDAP_CONTEXT_FACTORY_CLASS = "com.sun.jndi.ldap.LdapCtxFactory"; public final static String KERBEROS_ENV_LDAP_URL = "ldap_url"; @@ -213,27 +202,14 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler { if (principal == null) { throw new KerberosOperationException("principal is null"); } -NamingEnumeration searchResultEnum = null; + +DeconstructedPrincipal deconstructPrincipal = deconstructPrincipal(principal); + try { - searchResultEnum = ldapContext.search( - principalContainerDn, - "(userPrincipalName=" + principal + ")", - searchControls); - if (searchResultEnum.hasMore()) { -return true; - } + return (findPrincipalDN(deconstructPrincipal.getNormalizedPrincipal()) != null); } catch (NamingException ne) { throw new KerberosOperationException("can not check if principal exists: " + principal, ne); -} finally { - try { -if (searchResultEnum != null) { - searchResultEnum.close(); -} - } catch (NamingException ne) { -// ignore, we can not do anything about it - } } -return false; } /** @@ -262,31 +238,24 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler { } // TODO: (rlevas) pass components and realm in separately (AMBARI-9122) -String realm = null; -String principal_primary = null; -String principal_instance = null; - -Matcher matcher = PATTERN_PRINCIPAL.matcher(principal); -if (matcher.matches()) { - principal = matcher.group(1); - principal_primary = matcher.group(2); - principal_instance = matcher.group(3); - realm = matcher.group(4); -} +DeconstructedPrincipal deconstructedPrincipal = deconstructPrincipal(principal); -if ((realm == null) || realm.isEmpty()) { -
[02/14] ambari git commit: AMBARI-9222. Kerberos wizard: Property description tweaks on configure Kerberos page. (jaimin)
AMBARI-9222. Kerberos wizard: Property description tweaks on configure Kerberos page. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ae82067d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ae82067d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ae82067d Branch: refs/heads/2.0-preview Commit: ae82067d3515fc456a68972de99530a33861b7dd Parents: 0898c73 Author: Jaimin Jetly Authored: Tue Jan 20 13:07:37 2015 -0800 Committer: Jaimin Jetly Committed: Tue Jan 20 13:52:07 2015 -0800 -- .../1.10.3-10/configuration/kerberos-env.xml|3 +- .../1.10.3-10/configuration/krb5-conf.xml | 42 +- ambari-web/app/data/HDP2/site_properties.js | 8954 +- 3 files changed, 4514 insertions(+), 4485 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ae82067d/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 f44677f..85ae018 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 @@ -40,8 +40,7 @@ create_attributes_template - A Velocity template to use to generate a JSON-formatted document containing the set of - attribute names and values needed to create a new Kerberos identity in the relevant KDC. + Customizable JSON document representing the LDAP attributes needed to create a new Kerberos entity in the KDC (Velocity template engine). { http://git-wip-us.apache.org/repos/asf/ambari/blob/ae82067d/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml -- diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml index c10ae73..38f6ab2 100644 --- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml +++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml @@ -23,42 +23,65 @@ logging_default + + Default Kerberos library log location. + FILE:/var/log/krb5libs.log logging_kdc + + KDC log location. + FILE:/var/log/krb5kdc.log logging_admin_server + + Admin server log location. + FILE:/var/log/kadmind.log libdefaults_dns_lookup_realm + + If true, DNS TXT records will be used to determine the Kerberos realm of a host. + false libdefaults_dns_lookup_kdc + + If true, DNS SRV records will be used to locate the KDCs and other servers for the realm. + false libdefaults_ticket_lifetime + + Default lifetime of a ticket. + 24h libdefaults_renew_lifetime + + Default renewable lifetime for initial tickets. + 7d libdefaults_forwardable + + If true, initial tickets will be forwardable. + true libdefaults_default_tgs_enctypes - a space-delimited list of session key encryption types supported by the KDC or Active - Directory + The supported list of session key encryption types that should be returned by the KDC. aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 @@ -68,8 +91,7 @@ libdefaults_default_tkt_enctypes - a space-delimited list of session key encryption types supported by the KDC or Active - Directory + The supported list of session key encryption types that should be requested by the client. aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 @@ -80,14 +102,14 @@ realm - The realm to use when creating service principals + The realm to use when creating Service and Ambari principals from the realms section of your /etc/krb5.conf (e.g. EXAMPLE.COM). domains - A comma-delimited list of domain names that the realm serves (optional) + A comma-seperated list of domain names used to map server hostnames to the Realm name (e.g. .example.com,example.com). This is optional @@ -101,16 +1
[08/14] ambari git commit: AMBARI-9248. Fix post-install hook for hdp-select (dlysnichenko)
AMBARI-9248. Fix post-install hook for hdp-select (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1154fe4b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1154fe4b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1154fe4b Branch: refs/heads/2.0-preview Commit: 1154fe4be38d9e1bdf4b311b423a80de31035617 Parents: 84bfe43 Author: Lisnichenko Dmitro Authored: Wed Jan 21 23:45:39 2015 +0200 Committer: Yusaku Sako Committed: Wed Jan 21 14:16:29 2015 -0800 -- .../src/main/python/ambari_agent/HostCleanup.py | 13 - .../test/python/ambari_agent/TestHostCleanup.py | 18 +- .../scripts/shared_initialization.py | 8 ++-- 3 files changed, 35 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/1154fe4b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py -- diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py index 7aeb70a..398502e 100644 --- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py +++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py @@ -87,8 +87,10 @@ DIRNAME_PATTERNS = [ REPOSITORY_BLACK_LIST = ["ambari.repo"] PACKAGES_BLACK_LIST = ["ambari-server", "ambari-agent"] - class HostCleanup: + + SELECT_ALL_PERFORMED_MARKER = "/var/lib/ambari-agent/data/hdp-select-set-all.performed" + def resolve_ambari_config(self): try: config = AmbariConfig() @@ -134,6 +136,8 @@ class HostCleanup: if packageList and not PACKAGE_SECTION in SKIP_LIST: logger.info("Deleting packages: " + str(packageList) + "\n") self.do_erase_packages(packageList) +# Removing packages means that we have to rerun hdp-select +self.do_remove_hdp_select_marker() if userList and not USER_SECTION in SKIP_LIST: logger.info("\n" + "Deleting users: " + str(userList)) self.do_delete_users(userList) @@ -260,6 +264,13 @@ class HostCleanup: self.do_erase_files_silent(remList) + def do_remove_hdp_select_marker(self): +""" +Remove marker file for 'hdp-select set all' invocation +""" +if os.path.isfile(self.SELECT_ALL_PERFORMED_MARKER): + os.unlink(self.SELECT_ALL_PERFORMED_MARKER) + # Alternatives exist as a stack of symlinks under /var/lib/alternatives/$name # Script expects names of the alternatives as input http://git-wip-us.apache.org/repos/asf/ambari/blob/1154fe4b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py -- diff --git a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py index 84b96cc..f43784c 100644 --- a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py +++ b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py @@ -368,7 +368,7 @@ class TestHostCleanup(TestCase): @patch.object(HostCleanup.HostCleanup, 'run_os_command') @patch.object(OSCheck, "get_os_type") - def test_do_earse_packages(self, get_os_type_method, run_os_command_method): + def test_do_erase_packages(self, get_os_type_method, run_os_command_method): out = StringIO.StringIO() sys.stdout = out @@ -399,6 +399,22 @@ class TestHostCleanup(TestCase): sys.stdout = sys.__stdout__ + + @patch('os.path.isfile') + @patch('os.unlink') + def test_do_remove_hdp_select_marker(self, unlink_mock, isfile_mock): +out = StringIO.StringIO() +sys.stdout = out + +isfile_mock.return_value = True + +self.hostcleanup.do_remove_hdp_select_marker() + +self.assertTrue(unlink_mock.called) + +sys.stdout = sys.__stdout__ + + @patch.object(HostCleanup.HostCleanup, 'get_files_in_dir') @patch.object(OSCheck, "get_os_type") def test_find_repo_files_for_repos(self, get_os_type_method, http://git-wip-us.apache.org/repos/asf/ambari/blob/1154fe4b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py -- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py index f256688..3b7bc54 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py @@ -20,10 +20,14 @@ import os from resource_management import * def setup_hdp_install_direc
[14/14] ambari git commit: AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas)
AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/be939d32 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/be939d32 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/be939d32 Branch: refs/heads/2.0-preview Commit: be939d32e161efecf27f0714a09367afbd29d08d Parents: 790cf67 Author: Robert Levas Authored: Thu Jan 22 17:08:15 2015 -0500 Committer: Yusaku Sako Committed: Thu Jan 22 14:16:09 2015 -0800 -- .../AmbariManagementControllerImpl.java | 62 +--- .../AmbariManagementControllerImplTest.java | 58 ++ .../AmbariManagementControllerTest.java | 6 +- 3 files changed, 102 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/be939d32/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index dd18e8d..7e4ce69 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1196,7 +1196,51 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle cluster.setClusterName(request.getClusterName()); } -// set or create configuration mapping (and optionally create the map of properties) +// -- +// Check to see if the security state is being changed... if so, attempt to enable or disable +// Kerberos +boolean toggleKerberos = false; + +String desiredSecurityState = null; +List desiredConfig = request.getDesiredConfig(); +if (desiredConfig != null) { + for (ConfigurationRequest configurationRequest : desiredConfig) { +if ("cluster-env".equals(configurationRequest.getType())) { + Map properties = configurationRequest.getProperties(); + + if ((properties == null) || properties.isEmpty()) { +Config configClusterEnv = cluster.getConfig(configurationRequest.getType(), configurationRequest.getVersionTag()); +if (configClusterEnv != null) { + properties = configClusterEnv.getProperties(); +} + } + + desiredSecurityState = (properties == null) ? null : properties.get("security_enabled"); +} + } +} + +if(desiredSecurityState != null) { + Config configClusterEnv = cluster.getDesiredConfigByType("cluster-env"); + if (configClusterEnv == null) { +String message = "The 'cluster-env' configuration is not available"; +LOG.error(message); +throw new AmbariException(message); + } + + Map clusterEnvProperties = configClusterEnv.getProperties(); + if (clusterEnvProperties == null) { +String message = "The 'cluster-env' configuration properties are not available"; +LOG.error(message); +throw new AmbariException(message); + } + + toggleKerberos = !desiredSecurityState.equals(clusterEnvProperties.get("security_enabled")); +} +// -- + + +// set or create configuration mapping (and optionally create the map of properties) if (null != request.getDesiredConfig()) { Set configs = new HashSet(); String note = null; @@ -1326,13 +1370,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle } RequestStageContainer requestStageContainer = null; -Map services = cluster.getServices(); -if ((services != null) && services.containsKey("KERBEROS")) { - // Handle either adding or removing Kerberos from the cluster. This may generate multiple stages - // or not depending the current state of the cluster. The main configuration used to determine - // whether Kerberos is to be added or removed is cluster-config/security_enabled. - requestStageContainer = kerberosHelper.toggleKerberos(cluster, - request.getKerberosDescriptor(), null); +if(toggleKerberos) { + Map services = cluster.getServices(); + if ((services != null) && services.containsKey("KERBEROS")) { +// Handle either adding or removing Kerberos from the cluster. This may generate multiple stages +// or not depending the current state of the cluster. The main configuration used to determine +// whether Kerberos is
[06/14] ambari git commit: AMBARI-9228. Ambari Server setup to install and copy JCE policy file in-place (handle both Default / Custom JDK scenarios) (rlevas)
AMBARI-9228. Ambari Server setup to install and copy JCE policy file in-place (handle both Default / Custom JDK scenarios) (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/049b6924 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/049b6924 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/049b6924 Branch: refs/heads/2.0-preview Commit: 049b692472151a4c3488afd2157dcd2ff509f265 Parents: 339e8a7 Author: Robert Levas Authored: Wed Jan 21 15:32:27 2015 -0500 Committer: Yusaku Sako Committed: Wed Jan 21 12:36:15 2015 -0800 -- ambari-server/sbin/ambari-server| 6 +- ambari-server/src/main/python/ambari-server.py | 195 +++ .../python/ambari_server/serverConfiguration.py | 2 + .../src/test/python/TestAmbariServer.py | 138 - 4 files changed, 337 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/049b6924/ambari-server/sbin/ambari-server -- diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server index c034f5d..168790b 100755 --- a/ambari-server/sbin/ambari-server +++ b/ambari-server/sbin/ambari-server @@ -111,6 +111,10 @@ case "$1" in echo -e "Setup ambari-server" $PYTHON /usr/sbin/ambari-server.py $@ ;; + setup-jce) +echo -e "Updating jce policy" +$PYTHON /usr/sbin/ambari-server.py $@ +;; setup-ldap) echo -e "Setting up LDAP properties..." $PYTHON /usr/sbin/ambari-server.py $@ @@ -137,7 +141,7 @@ case "$1" in ;; *) echo "Usage: /usr/sbin/ambari-server - {start|stop|restart|setup|upgrade|status|upgradestack|setup-ldap|sync-ldap|setup-security|refresh-stack-hash|backup|restore} [options] + {start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|setup-security|refresh-stack-hash|backup|restore} [options] Use usr/sbin/ambari-server --help to get details on options available. Or, simply invoke ambari-server.py --help to print the options." exit 1 http://git-wip-us.apache.org/repos/asf/ambari/blob/049b6924/ambari-server/src/main/python/ambari-server.py -- diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py index 7c08083..b75611f 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -81,6 +81,7 @@ UPGRADE_ACTION = "upgrade" UPGRADE_STACK_ACTION = "upgradestack" STATUS_ACTION = "status" SETUP_HTTPS_ACTION = "setup-https" +SETUP_JCE_ACTION = "setup-jce" LDAP_SETUP_ACTION = "setup-ldap" LDAP_SYNC_ACTION = "sync-ldap" SETUP_GANGLIA_HTTPS_ACTION = "setup-ganglia-https" @@ -403,6 +404,7 @@ DEFAULT_JDK16_LOCATION = "/usr/jdk64/jdk1.6.0_31" JDK_INDEX = 0 JDK_VERSION_REs = ["(jdk.*)/jre", "Creating (jdk.*)/jre"] CUSTOM_JDK_NUMBER = "3" +IS_CUSTOM_JDK = False JDK_MIN_FILESIZE = 5000 CREATE_JDK_DIR_CMD = "/bin/mkdir -p " + configDefaults.JDK_INSTALL_DIR MAKE_FILE_EXECUTABLE_CMD = "chmod a+x {0}" @@ -1560,6 +1562,7 @@ def install_jce_manualy(args): # def download_jdk(args): global JDK_INDEX + global IS_CUSTOM_JDK properties = get_ambari_properties() if properties == -1: err = "Error getting ambari properties" @@ -1604,6 +1607,7 @@ Enter choice (""" + jdk_num + "):", ) if jdk_num == CUSTOM_JDK_NUMBER: + IS_CUSTOM_JDK = True print_warning_msg("JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.") print_warning_msg(jcePolicyWarn) args.java_home = get_validated_string_input("Path to JAVA_HOME: ", None, None, None, False, False) @@ -2025,6 +2029,174 @@ def verify_setup_allowed(): return 0 +def unpack_jce_policy(): + properties = get_ambari_properties() + jdk_path = properties.get_property(JAVA_HOME_PROPERTY) + jdk_security_path = jdk_path + os.sep + configDefaults.JDK_SECURITY_DIR + + jce_name = properties.get_property(JCE_NAME_PROPERTY) + jce_zip_path = configDefaults.SERVER_RESOURCES_DIR + os.sep + jce_name + unpack_cmd = 'unzip -o -j -q {0} -d {1}'.format(jce_zip_path, jdk_security_path) + + if os.path.exists(jdk_security_path) and os.path.exists(jce_zip_path) and validate_jdk(jdk_path): +try: + retcode, out, err = run_os_command(unpack_cmd) + if retcode != 0: +raise FatalException(retcode, err) +except Exception as e: + err = "Fail during the execution of '{0}'. {1}".format(unpack_cmd.format(jce_zip_path, jdk_security_path), e) + raise FatalException(1, err) + else: +err = "Can not execute {0}. The path {1}, {2} or
[13/14] ambari git commit: AMBARI-9279. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem (rlevas)
AMBARI-9279. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/790cf67c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/790cf67c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/790cf67c Branch: refs/heads/2.0-preview Commit: 790cf67c7693e1912c21f9323fbaea397440de43 Parents: a03fb1b Author: Robert Levas Authored: Thu Jan 22 16:29:52 2015 -0500 Committer: Yusaku Sako Committed: Thu Jan 22 14:15:43 2015 -0800 -- .../src/test/python/stacks/2.0.6/YARN/test_nodemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/790cf67c/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py index 4a3f32d..eb46524 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py @@ -752,4 +752,4 @@ class TestNodeManager(RMFTestCase): hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES ) -put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"}) \ No newline at end of file +put_structured_out_mock.assert_called_with({"securityState": "UNSECURED"})
[10/14] ambari git commit: AMBARI-9244. JAAS configuration file parser leaves trailing quote in quoted values (rlevas)
AMBARI-9244. JAAS configuration file parser leaves trailing quote in quoted values (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/757256d7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/757256d7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/757256d7 Branch: refs/heads/2.0-preview Commit: 757256d7a6990a1840b981f4343e1d80f34f11dc Parents: 03d7aca Author: Robert Levas Authored: Wed Jan 21 21:09:28 2015 -0500 Committer: Yusaku Sako Committed: Wed Jan 21 18:15:09 2015 -0800 -- .../resource_management/TestSecurityCommons.py | 49 .../libraries/functions/security_commons.py | 3 +- 2 files changed, 51 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/757256d7/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py index 196ae34..602b88b 100644 --- a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py +++ b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py @@ -21,6 +21,7 @@ from unittest import TestCase from resource_management.libraries.functions.security_commons import * from datetime import datetime, timedelta from tempfile import gettempdir +import os class TestSecurityCommons(TestCase): @patch('os.path.isfile') @@ -119,6 +120,54 @@ class TestSecurityCommons(TestCase): self.assertEquals(not result[config_file].items(), True) + def test_get_params_from_filesystem_JAAS(self): +conf_dir = gettempdir() +jaas_file = "test_jaas.conf" +jaas_file_path = conf_dir + os.sep + jaas_file + +# Create temporary test file (mocking a files for reading isn't available for the current version +# of the library +with open(jaas_file_path, "w+") as f: + f.write('Client {\n' + ' com.sun.security.auth.module.Krb5LoginModule required\n' + ' useKeyTab=true\n' + ' storeKey=true\n' + ' useTicketCache=false\n' + ' keyTab="/etc/security/keytabs/hbase.service.keytab"\n' + ' principal="hbase/vp-ambari-ranger-med-0120-2.cs1cloud.inter...@example.com";\n' + '};\n') + +config_file = { + jaas_file : FILE_TYPE_JAAS_CONF +} + +result = get_params_from_filesystem(conf_dir, config_file) + +self.assertIn('test_jaas', result) +self.assertIn('Client', result['test_jaas']) + +self.assertIn('com.sun.security.auth.module.Krb5LoginModule', result['test_jaas']['Client']) +self.assertEquals('required', result['test_jaas']['Client']['com.sun.security.auth.module.Krb5LoginModule']) + +self.assertIn('useKeyTab', result['test_jaas']['Client']) +self.assertEquals('true', result['test_jaas']['Client']['useKeyTab']) + +self.assertIn('storeKey', result['test_jaas']['Client']) +self.assertEquals('true', result['test_jaas']['Client']['storeKey']) + +self.assertIn('useTicketCache', result['test_jaas']['Client']) +self.assertEquals('false', result['test_jaas']['Client']['useTicketCache']) + +self.assertIn('keyTab', result['test_jaas']['Client']) +self.assertEquals('/etc/security/keytabs/hbase.service.keytab', result['test_jaas']['Client']['keyTab']) + +self.assertIn('principal', result['test_jaas']['Client']) + self.assertEquals('hbase/vp-ambari-ranger-med-0120-2.cs1cloud.inter...@example.com', result['test_jaas']['Client']['principal']) + +os.unlink(jaas_file_path) + +print result + @patch('xml.etree.ElementTree.parse') def test_get_params_from_filesystem(self, et_parser_mock): http://git-wip-us.apache.org/repos/asf/ambari/blob/757256d7/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py b/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py index 7f6ed00..1e92f9d 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/security_commons.py @@ -146,13 +146,14 @@ def get_params_from_filesystem(conf_dir, config_files): elif file_type == FILE_TYPE_JAAS_CONF: section_header = re.compile('^(\w+)\s+\{\s*$') - section_data = re.compile('^\s*([^ \s\=\}\{]+)\s*=?\s*"?([^ ";].+)"?;?\s*$') + section_data = re.compile('^\s*([^ \s\=\}\{]+)\s*=?\s*"?([^ ";]+)"?;?\s
[01/14] ambari git commit: AMBARI-9222. Kerberos wizard: Property description tweaks on configure Kerberos page. (jaimin)
Repository: ambari Updated Branches: refs/heads/2.0-preview [created] be939d32e http://git-wip-us.apache.org/repos/asf/ambari/blob/ae82067d/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 74912c3..992b278 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -20,4494 +20,4504 @@ var App = require('app'); var hdp2properties = [ //* HDP stack ** - /**HDFS***/ -{ - "id": "site property", - "name": "dfs.namenode.checkpoint.dir", - "displayName": "SecondaryNameNode Checkpoint directories", - "defaultDirectory": "/hadoop/hdfs/namesecondary", - "displayType": "directories", - "isOverridable": false, - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "category": "SECONDARY_NAMENODE", - "index": 1 -}, -{ - "id": "site property", - "name": "dfs.namenode.checkpoint.period", - "displayName": "HDFS Maximum Checkpoint Delay", - "displayType": "int", - "unit": "seconds", - "category": "General", - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "index": 3 -}, -{ - "id": "site property", - "name": "dfs.namenode.name.dir", - "displayName": "NameNode directories", - "defaultDirectory": "/hadoop/hdfs/namenode", - "displayType": "directories", - "isOverridable": false, - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "category": "NAMENODE", - "index": 1 -}, -{ - "id": "site property", - "name": "dfs.webhdfs.enabled", - "displayName": "WebHDFS enabled", - "displayType": "checkbox", - "isOverridable": false, - "category": "General", - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "index": 0 -}, -{ - "id": "site property", - "name": "dfs.datanode.failed.volumes.tolerated", - "displayName": "DataNode volumes failure toleration", - "displayType": "int", - "category": "DATANODE", - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "index": 3 -}, -{ - "id": "site property", - "name": "dfs.datanode.data.dir.mount.file", - "displayName": "File that stores mount point for each data dir", - "description": "File path that contains the last known mount point for each data dir. This file is used to avoid creating a DFS data dir on the root drive (and filling it up) if a path was previously mounted on a drive.", - "defaultValue": "/etc/hadoop/conf/dfs_data_dir_mount.hist", - "displayType": "directory", - "isVisible": true, - "category": "DATANODE", - "serviceName": "HDFS", - "filename": "hadoop-env.xml", - "index": 4 -}, -{ - "id": "site property", - "name": "dfs.datanode.data.dir", - "displayName": "DataNode directories", - "defaultDirectory": "/hadoop/hdfs/data", - "displayType": "directories", - "category": "DATANODE", - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "index": 1 -}, -{ - "id": "site property", - "name": "dfs.datanode.data.dir.perm", - "displayName": "DataNode directories permission", - "displayType": "int", - "category": "DATANODE", - "serviceName": "HDFS", - "filename": "hdfs-site.xml" -}, -{ - "id": "site property", - "name": "dfs.replication", - "displayName": "Block replication", - "displayType": "int", - "category": "General", - "serviceName": "HDFS", - "filename": "hdfs-site.xml" -}, -{ - "id": "site property", - "name": "dfs.datanode.du.reserved", - "displayName": "Reserved space for HDFS", - "displayType": "int", - "unit": "bytes", - "category": "General", - "serviceName": "HDFS", - "filename": "hdfs-site.xml", - "index": 2 -}, -{ - "id": "site property", - "name": "dfs.client.read.shortcircuit", - "displayName": "HDFS Short-circuit read", - "displayType": "checkbox", - "category": "Advanced hdfs-site", - "serviceName": "HDFS", - "filename": "hdfs-site.xml" -}, -{ - "id": "site property", - "name": "apache_artifacts_download_url", - "displayName": "apache_artifacts_download_url", - "description": "", - "isRequired": false, - "isRequiredByAgent": false, - "isVisible": false, - "category": "Advanced hdfs-site", - "serviceName": "HDFS" -}, +/**HDFS***/ + { +"id": "site property",
[09/14] ambari git commit: Revert "AMBARI-9228. Ambari Server setup to install and copy JCE policy file in-place (handle both Default / Custom JDK scenarios) (rlevas)"
Revert "AMBARI-9228. Ambari Server setup to install and copy JCE policy file in-place (handle both Default / Custom JDK scenarios) (rlevas)" This reverts commit 049b692472151a4c3488afd2157dcd2ff509f265. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/03d7acae Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/03d7acae Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/03d7acae Branch: refs/heads/2.0-preview Commit: 03d7acae7493212f71c37efdd00b261da7856c50 Parents: 1154fe4 Author: Yusaku Sako Authored: Wed Jan 21 17:28:35 2015 -0800 Committer: Yusaku Sako Committed: Wed Jan 21 17:28:35 2015 -0800 -- ambari-server/sbin/ambari-server| 6 +- ambari-server/src/main/python/ambari-server.py | 195 --- .../python/ambari_server/serverConfiguration.py | 2 - .../src/test/python/TestAmbariServer.py | 138 + 4 files changed, 4 insertions(+), 337 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/03d7acae/ambari-server/sbin/ambari-server -- diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server index 168790b..c034f5d 100755 --- a/ambari-server/sbin/ambari-server +++ b/ambari-server/sbin/ambari-server @@ -111,10 +111,6 @@ case "$1" in echo -e "Setup ambari-server" $PYTHON /usr/sbin/ambari-server.py $@ ;; - setup-jce) -echo -e "Updating jce policy" -$PYTHON /usr/sbin/ambari-server.py $@ -;; setup-ldap) echo -e "Setting up LDAP properties..." $PYTHON /usr/sbin/ambari-server.py $@ @@ -141,7 +137,7 @@ case "$1" in ;; *) echo "Usage: /usr/sbin/ambari-server - {start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|setup-security|refresh-stack-hash|backup|restore} [options] + {start|stop|restart|setup|upgrade|status|upgradestack|setup-ldap|sync-ldap|setup-security|refresh-stack-hash|backup|restore} [options] Use usr/sbin/ambari-server --help to get details on options available. Or, simply invoke ambari-server.py --help to print the options." exit 1 http://git-wip-us.apache.org/repos/asf/ambari/blob/03d7acae/ambari-server/src/main/python/ambari-server.py -- diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py index b75611f..7c08083 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -81,7 +81,6 @@ UPGRADE_ACTION = "upgrade" UPGRADE_STACK_ACTION = "upgradestack" STATUS_ACTION = "status" SETUP_HTTPS_ACTION = "setup-https" -SETUP_JCE_ACTION = "setup-jce" LDAP_SETUP_ACTION = "setup-ldap" LDAP_SYNC_ACTION = "sync-ldap" SETUP_GANGLIA_HTTPS_ACTION = "setup-ganglia-https" @@ -404,7 +403,6 @@ DEFAULT_JDK16_LOCATION = "/usr/jdk64/jdk1.6.0_31" JDK_INDEX = 0 JDK_VERSION_REs = ["(jdk.*)/jre", "Creating (jdk.*)/jre"] CUSTOM_JDK_NUMBER = "3" -IS_CUSTOM_JDK = False JDK_MIN_FILESIZE = 5000 CREATE_JDK_DIR_CMD = "/bin/mkdir -p " + configDefaults.JDK_INSTALL_DIR MAKE_FILE_EXECUTABLE_CMD = "chmod a+x {0}" @@ -1562,7 +1560,6 @@ def install_jce_manualy(args): # def download_jdk(args): global JDK_INDEX - global IS_CUSTOM_JDK properties = get_ambari_properties() if properties == -1: err = "Error getting ambari properties" @@ -1607,7 +1604,6 @@ Enter choice (""" + jdk_num + "):", ) if jdk_num == CUSTOM_JDK_NUMBER: - IS_CUSTOM_JDK = True print_warning_msg("JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.") print_warning_msg(jcePolicyWarn) args.java_home = get_validated_string_input("Path to JAVA_HOME: ", None, None, None, False, False) @@ -2029,174 +2025,6 @@ def verify_setup_allowed(): return 0 -def unpack_jce_policy(): - properties = get_ambari_properties() - jdk_path = properties.get_property(JAVA_HOME_PROPERTY) - jdk_security_path = jdk_path + os.sep + configDefaults.JDK_SECURITY_DIR - - jce_name = properties.get_property(JCE_NAME_PROPERTY) - jce_zip_path = configDefaults.SERVER_RESOURCES_DIR + os.sep + jce_name - unpack_cmd = 'unzip -o -j -q {0} -d {1}'.format(jce_zip_path, jdk_security_path) - - if os.path.exists(jdk_security_path) and os.path.exists(jce_zip_path) and validate_jdk(jdk_path): -try: - retcode, out, err = run_os_command(unpack_cmd) - if retcode != 0: -raise FatalException(retcode, err) -except Exception as e: - err = "Fail during the execution of '{0}'. {1}".format(unpack_cmd.format(jce_zip_path, jdk_security_path), e) - raise FatalException(
[12/14] ambari git commit: BUG-30575. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem.
BUG-30575. MapReduce2 Service Check fails after enabling Kerberos with permission issue in local filesystem. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a03fb1be Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a03fb1be Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a03fb1be Branch: refs/heads/2.0-preview Commit: a03fb1be1ff3780213b56e551337796beb356c51 Parents: 786d780 Author: Yusaku Sako Authored: Thu Jan 22 11:50:00 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 11:50:00 2015 -0800 -- .../common-services/YARN/2.1.0.2.0/package/scripts/yarn.py | 5 + .../src/test/python/stacks/2.0.6/YARN/test_nodemanager.py | 1 + 2 files changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a03fb1be/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py -- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py index cf0d211..50d4f11 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py @@ -70,6 +70,11 @@ def yarn(name = None): mode=0775 ) +if params.security_enabled: + smokeuser_directories = [os.path.join(dir, 'usercache' ,params.smokeuser) + for dir in params.nm_local_dirs.split(',')] + for directory in smokeuser_directories: +Execute(format("chown -R {params.smokeuser} {directory}")) Directory([params.yarn_pid_dir_prefix, params.yarn_pid_dir, params.yarn_log_dir], owner=params.yarn_user, group=params.user_group, http://git-wip-us.apache.org/repos/asf/ambari/blob/a03fb1be/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py index 2854399..4a3f32d 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py +++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py @@ -438,6 +438,7 @@ class TestNodeManager(RMFTestCase): mode = 0775, recursive_permission=True ) +self.assertResourceCalled('Execute', 'chown -R ambari-qa /hadoop/yarn/local/usercache/ambari-qa') self.assertResourceCalled('Directory', '/var/run/hadoop-yarn', owner = 'yarn', group = 'hadoop',
Git Push Summary
Repository: ambari Updated Branches: refs/heads/2.0-preview [deleted] be939d32e
ambari git commit: AMBARI-9276. Memory leaks in Firefox after some time on Alerts page. (akovalenko)
Repository: ambari Updated Branches: refs/heads/trunk 859279a37 -> 943a16ba8 AMBARI-9276. Memory leaks in Firefox after some time on Alerts page. (akovalenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/943a16ba Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/943a16ba Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/943a16ba Branch: refs/heads/trunk Commit: 943a16ba868b33a4e8aa0b8d31e822be93e2f9f5 Parents: 859279a Author: Aleksandr Kovalenko Authored: Thu Jan 22 20:23:31 2015 +0200 Committer: Aleksandr Kovalenko Committed: Fri Jan 23 00:31:33 2015 +0200 -- ambari-web/app/assets/test/tests.js | 1 - .../main/alert_definitions_controller.js| 6 +-- .../alerts/manage_alert_groups_controller.js| 2 +- .../main/host/host_alerts_controller.js | 2 +- .../mappers/alert_definition_summary_mapper.js | 2 +- .../app/mappers/alert_definitions_mapper.js | 40 +- ambari-web/app/models/alert_definition.js | 56 +-- ambari-web/app/models/alert_group.js| 35 +--- .../app/views/main/alert_definitions_view.js| 4 +- .../app/views/main/service/info/summary.js | 2 +- .../alert_definition_summary_mapper_test.js | 46 +++- .../mappers/alert_definitions_mapper_test.js| 50 + ambari-web/test/models/alert_group_test.js | 57 .../views/main/service/info/summary_test.js | 4 +- 14 files changed, 68 insertions(+), 239 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/943a16ba/ambari-web/app/assets/test/tests.js -- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index ccfffe3..674f676 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -235,7 +235,6 @@ var files = ['test/init_model_test', 'test/models/alert_test', 'test/models/alert_config_test', 'test/models/alert_definition_test', - 'test/models/alert_group_test', 'test/models/alert_instance_test', 'test/models/authentication_test', 'test/models/cluster_states_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/943a16ba/ambari-web/app/controllers/main/alert_definitions_controller.js -- diff --git a/ambari-web/app/controllers/main/alert_definitions_controller.js b/ambari-web/app/controllers/main/alert_definitions_controller.js index 4b76d2d..1c670a4 100644 --- a/ambari-web/app/controllers/main/alert_definitions_controller.js +++ b/ambari-web/app/controllers/main/alert_definitions_controller.js @@ -47,11 +47,7 @@ App.MainAlertDefinitionsController = Em.ArrayController.extend({ * * @type {App.AlertDefinition[]} */ - content: function () { -var definitions = App.AlertDefinition.getAllDefinitions(); -definitions.sort(App.AlertDefinition.getSortDefinitionsByStatus(true)); -return definitions; - }.property('mapperTimestamp'), + content: App.AlertDefinition.find(), /** * Enable/disable alertDefinition confirmation popup http://git-wip-us.apache.org/repos/asf/ambari/blob/943a16ba/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js -- diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js index 373569c..fddd6bb 100644 --- a/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js +++ b/ambari-web/app/controllers/main/alerts/manage_alert_groups_controller.js @@ -301,7 +301,7 @@ App.ManageAlertGroupsController = Em.Controller.extend({ if (selectedAlertGroup.get('default')) return []; var usedDefinitionsMap = {}; var availableDefinitions = []; -var sharedDefinitions = App.AlertDefinition.getAllDefinitions(); +var sharedDefinitions = App.AlertDefinition.find(); selectedAlertGroup.get('definitions').forEach(function (def) { usedDefinitionsMap[def.name] = true; http://git-wip-us.apache.org/repos/asf/ambari/blob/943a16ba/ambari-web/app/controllers/main/host/host_alerts_controller.js -- diff --git a/ambari-web/app/controllers/main/host/host_alerts_controller.js b/ambari-web/app/controllers/main/host/host_alerts_controller.js index e753c05..2a47914 100644 --- a/ambari-web/app/controllers/main/host/host_alerts_controller.js +++ b/ambari-web/app/controllers/main/host/host_alerts_controller.js @@ -39,7 +39,7 @@ App.MainHostAlertsController = Em.ArrayController.extend({ * @method r
ambari git commit: Revert "AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas)" Reverting since this causes cluster deployment failure
Repository: ambari Updated Branches: refs/heads/trunk 943a16ba8 -> 4a3e05a9d Revert "AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas)" Reverting since this causes cluster deployment failure when trying to create configs. This reverts commit 859279a37d098bd4da89ec2e7c08c837f8698f15. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4a3e05a9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4a3e05a9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4a3e05a9 Branch: refs/heads/trunk Commit: 4a3e05a9d4bb9f1a8c714e5b707772d540caabe8 Parents: 943a16b Author: Yusaku Sako Authored: Thu Jan 22 14:55:53 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 14:56:09 2015 -0800 -- .../AmbariManagementControllerImpl.java | 62 +++- .../AmbariManagementControllerImplTest.java | 58 -- .../AmbariManagementControllerTest.java | 6 +- 3 files changed, 24 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4a3e05a9/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index 7e4ce69..dd18e8d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1196,51 +1196,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle cluster.setClusterName(request.getClusterName()); } -// -- -// Check to see if the security state is being changed... if so, attempt to enable or disable -// Kerberos -boolean toggleKerberos = false; - -String desiredSecurityState = null; -List desiredConfig = request.getDesiredConfig(); -if (desiredConfig != null) { - for (ConfigurationRequest configurationRequest : desiredConfig) { -if ("cluster-env".equals(configurationRequest.getType())) { - Map properties = configurationRequest.getProperties(); - - if ((properties == null) || properties.isEmpty()) { -Config configClusterEnv = cluster.getConfig(configurationRequest.getType(), configurationRequest.getVersionTag()); -if (configClusterEnv != null) { - properties = configClusterEnv.getProperties(); -} - } - - desiredSecurityState = (properties == null) ? null : properties.get("security_enabled"); -} - } -} - -if(desiredSecurityState != null) { - Config configClusterEnv = cluster.getDesiredConfigByType("cluster-env"); - if (configClusterEnv == null) { -String message = "The 'cluster-env' configuration is not available"; -LOG.error(message); -throw new AmbariException(message); - } - - Map clusterEnvProperties = configClusterEnv.getProperties(); - if (clusterEnvProperties == null) { -String message = "The 'cluster-env' configuration properties are not available"; -LOG.error(message); -throw new AmbariException(message); - } - - toggleKerberos = !desiredSecurityState.equals(clusterEnvProperties.get("security_enabled")); -} -// -- - - -// set or create configuration mapping (and optionally create the map of properties) +// set or create configuration mapping (and optionally create the map of properties) if (null != request.getDesiredConfig()) { Set configs = new HashSet(); String note = null; @@ -1370,15 +1326,13 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle } RequestStageContainer requestStageContainer = null; -if(toggleKerberos) { - Map services = cluster.getServices(); - if ((services != null) && services.containsKey("KERBEROS")) { -// Handle either adding or removing Kerberos from the cluster. This may generate multiple stages -// or not depending the current state of the cluster. The main configuration used to determine -// whether Kerberos is to be added or removed is cluster-config/security_enabled. -requestStageContainer = kerberosHelper.toggleKerberos(cluster, -request.getKerberosDescriptor(), null); - } +Map services = cluster.getServices(); +if ((services != null) && services.containsKey("KERBEROS
ambari git commit: AMBARI-9287. Add jquery-mockjax as MIT license to Ambari's LICENSE.txt (srimanth)
Repository: ambari Updated Branches: refs/heads/trunk 4a3e05a9d -> 49b43d1d1 AMBARI-9287. Add jquery-mockjax as MIT license to Ambari's LICENSE.txt (srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/49b43d1d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/49b43d1d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/49b43d1d Branch: refs/heads/trunk Commit: 49b43d1d1da75370dba4aaf7c2195b90ae9be5af Parents: 4a3e05a Author: Srimanth Gunturi Authored: Thu Jan 22 15:23:44 2015 -0800 Committer: Srimanth Gunturi Committed: Thu Jan 22 15:23:44 2015 -0800 -- LICENSE.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/49b43d1d/LICENSE.txt -- diff --git a/LICENSE.txt b/LICENSE.txt index 242f37f..fca7128 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -614,7 +614,9 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For MockJax 1.6.0 (contrib/views/slider/src/main/resources/ui/app/assets/javascripts/jquery.mockjax.js): +For MockJax 1.6.0 (contrib/views/slider/src/main/resources/ui/app/assets/javascripts/jquery.mockjax.js, +/contrib/views/files/src/main/resources/ui/app/assets/javascripts/jquery.mockjax.js, +/contrib/views/pig/src/main/resources/ui/pig-web/app/assets/static/javascripts/jquery.mockjax.js): MockJax - jQuery Plugin to Mock Ajax requests
ambari git commit: AMBARI-9288. Customizing smoke test user headless principal name causes HDFS service check failure and HiveServer2 start failure. (yusaku)
Repository: ambari Updated Branches: refs/heads/trunk 49b43d1d1 -> 9260d4ee5 AMBARI-9288. Customizing smoke test user headless principal name causes HDFS service check failure and HiveServer2 start failure. (yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9260d4ee Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9260d4ee Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9260d4ee Branch: refs/heads/trunk Commit: 9260d4ee530e660f6ffeae1f9632042873ed66bf Parents: 49b43d1 Author: Yusaku Sako Authored: Thu Jan 22 16:29:48 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 16:52:53 2015 -0800 -- .../common-services/HDFS/2.1.0.2.0/package/scripts/params.py | 3 ++- .../HDFS/2.1.0.2.0/package/scripts/service_check.py | 2 +- .../HIVE/0.12.0.2.0/package/scripts/hive_service.py | 2 +- .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9260d4ee/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py -- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py index eb315cc..4d120b1 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py @@ -149,6 +149,7 @@ webhcat_user = config['configurations']['hive-env']['hcat_user'] hcat_user = config['configurations']['hive-env']['hcat_user'] hive_user = config['configurations']['hive-env']['hive_user'] smoke_user = config['configurations']['cluster-env']['smokeuser'] +smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name'] mapred_user = config['configurations']['mapred-env']['mapred_user'] hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] @@ -307,4 +308,4 @@ if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0: if user_input.lower() == 'yes': enable_ranger_hdfs = True elif user_input.lower() == 'no': - enable_ranger_hdfs = False \ No newline at end of file + enable_ranger_hdfs = False http://git-wip-us.apache.org/repos/asf/ambari/blob/9260d4ee/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py -- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py index 3dc3a1b..fc04c60 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/service_check.py @@ -41,7 +41,7 @@ class HdfsServiceCheck(Script): "{cleanup_cmd}; hadoop --config {hadoop_conf_dir} fs -put /etc/passwd {tmp_file}") test_cmd = format("fs -test -e {tmp_file}") if params.security_enabled: - Execute(format("{kinit_path_local} -kt {smoke_user_keytab} {smoke_user}"), + Execute(format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}"), user=params.smoke_user ) ExecuteHadoop(safemode_command, http://git-wip-us.apache.org/repos/asf/ambari/blob/9260d4ee/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py -- diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py index 56e968a..1ee9fc4 100644 --- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py +++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py @@ -76,7 +76,7 @@ def hive_service(name, action='start', rolling_restart=False): is_service_socket_valid = False print "Waiting for the Hive server to start..." if params.security_enabled: -kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser}; ") +kinitcmd=format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ") else: kinitcmd=None while time.time() < end_time: http://git-wip-us.apach
ambari git commit: AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas)
Repository: ambari Updated Branches: refs/heads/trunk 9260d4ee5 -> 3985154fe AMBARI-9261. Ensure enable/disable Kerberos logic should invoke only when state of security flag is changed (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3985154f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3985154f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3985154f Branch: refs/heads/trunk Commit: 3985154fe7dab84276976b6761fa9442ee991fc1 Parents: 9260d4e Author: Robert Levas Authored: Thu Jan 22 19:53:54 2015 -0500 Committer: Robert Levas Committed: Thu Jan 22 19:54:08 2015 -0500 -- .../AmbariManagementControllerImpl.java | 50 +--- .../AmbariManagementControllerImplTest.java | 44 - .../AmbariManagementControllerTest.java | 6 +-- 3 files changed, 89 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3985154f/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index dd18e8d..106c1dd 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -1196,6 +1196,40 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle cluster.setClusterName(request.getClusterName()); } +// -- +// Check to see if the security state is being changed... if so, attempt to enable or disable +// Kerberos +boolean toggleKerberos = false; + +String desiredSecurityState = null; +List desiredConfig = request.getDesiredConfig(); +if (desiredConfig != null) { + for (ConfigurationRequest configurationRequest : desiredConfig) { +if ("cluster-env".equals(configurationRequest.getType())) { + Map properties = configurationRequest.getProperties(); + + if ((properties == null) || properties.isEmpty()) { +Config configClusterEnv = cluster.getConfig(configurationRequest.getType(), configurationRequest.getVersionTag()); +if (configClusterEnv != null) { + properties = configClusterEnv.getProperties(); +} + } + + desiredSecurityState = (properties == null) ? null : properties.get("security_enabled"); +} + } +} + +if(desiredSecurityState != null) { + Config configClusterEnv = cluster.getDesiredConfigByType("cluster-env"); + Map clusterEnvProperties = (configClusterEnv == null) ? null : configClusterEnv.getProperties(); + if (clusterEnvProperties != null) { +toggleKerberos = !desiredSecurityState.equals(clusterEnvProperties.get("security_enabled")); + } +} +// -- + + // set or create configuration mapping (and optionally create the map of properties) if (null != request.getDesiredConfig()) { Set configs = new HashSet(); @@ -1326,13 +1360,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle } RequestStageContainer requestStageContainer = null; -Map services = cluster.getServices(); -if ((services != null) && services.containsKey("KERBEROS")) { - // Handle either adding or removing Kerberos from the cluster. This may generate multiple stages - // or not depending the current state of the cluster. The main configuration used to determine - // whether Kerberos is to be added or removed is cluster-config/security_enabled. - requestStageContainer = kerberosHelper.toggleKerberos(cluster, - request.getKerberosDescriptor(), null); +if(toggleKerberos) { + Map services = cluster.getServices(); + if ((services != null) && services.containsKey("KERBEROS")) { +// Handle either adding or removing Kerberos from the cluster. This may generate multiple stages +// or not depending the current state of the cluster. The main configuration used to determine +// whether Kerberos is to be added or removed is cluster-config/security_enabled. +requestStageContainer = kerberosHelper.toggleKerberos(cluster, +request.getKerberosDescriptor(), null); + } } if (requestStageContainer != null) { http://git-wip-us.apache.org/repos/asf/ambari/blob/3985154f/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariMa
ambari git commit: Revert "AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle)"
Repository: ambari Updated Branches: refs/heads/trunk 3985154fe -> c579d2747 Revert "AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle)" Metrics Monitor cannot start. This reverts commit af5372656b9679b10e2792da8dd0ca4510ba1962. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c579d274 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c579d274 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c579d274 Branch: refs/heads/trunk Commit: c579d2747e01543bb5dd9bf6ed4e16a87fc7c4c7 Parents: 3985154 Author: Yusaku Sako Authored: Thu Jan 22 17:52:29 2015 -0800 Committer: Yusaku Sako Committed: Thu Jan 22 17:52:42 2015 -0800 -- .../src/main/python/core/config_reader.py | 16 ++-- .../src/main/python/core/host_info.py | 1 + 2 files changed, 3 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c579d274/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py index 62a5f16..f43f512 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py @@ -61,6 +61,7 @@ class ConfigDefaultsLinux(ConfigDefaults): configDefaults = ConfigDefaults() + config = ConfigParser.RawConfigParser() CONFIG_FILE_PATH = configDefaults.get_config_file_path() @@ -83,8 +84,6 @@ STOP_ACTION = "stop" RESTART_ACTION = "restart" STATUS_ACTION = "status" -AMBARI_AGENT_CONF = '/etc/ambari-agent/conf/ambari-agent.ini' - config_content = """ [default] debug_level = INFO @@ -140,7 +139,6 @@ metric_group_info = """ } """ - class Configuration: def __init__(self): @@ -162,13 +160,6 @@ class Configuration: } pass -self.hostname_script = None -ambari_agent_config = ConfigParser.RawConfigParser() -if os.path.exists(AMBARI_AGENT_CONF): - ambari_agent_config.read(AMBARI_AGENT_CONF) - self.hostname_script = ambari_agent_config.get('agent', 'hostname_script') -pass - def getConfig(self): return self.config @@ -192,10 +183,7 @@ class Configuration: return self.get("default", "metrics_server") def get_hostname_script(self): -if self.hostname_script: - return self.hostname_script -else: - return self.get("default", "hostname_script") +return self.get("default", "hostname_script") def get_log_level(self): return self.get("default", "debug_level", "INFO") http://git-wip-us.apache.org/repos/asf/ambari/blob/c579d274/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py index caa972c..37c55cb 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py @@ -23,6 +23,7 @@ import psutil import os from collections import namedtuple import platform +import socket import time import threading import socket
ambari git commit: AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle)
Repository: ambari Updated Branches: refs/heads/trunk c579d2747 -> c99ebb5cf AMBARI-9278. Allow hostname customization for metric monitor. Use agent conf. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c99ebb5c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c99ebb5c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c99ebb5c Branch: refs/heads/trunk Commit: c99ebb5cf0bed3f1bc1a44efa86628f4ec423b3f Parents: c579d27 Author: Siddharth Wagle Authored: Thu Jan 22 18:35:54 2015 -0800 Committer: Siddharth Wagle Committed: Thu Jan 22 18:35:54 2015 -0800 -- .../src/main/python/core/config_reader.py | 20 ++-- .../src/main/python/core/host_info.py | 1 - 2 files changed, 18 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c99ebb5c/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py index f43f512..a3780ff 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py @@ -61,7 +61,6 @@ class ConfigDefaultsLinux(ConfigDefaults): configDefaults = ConfigDefaults() - config = ConfigParser.RawConfigParser() CONFIG_FILE_PATH = configDefaults.get_config_file_path() @@ -84,6 +83,8 @@ STOP_ACTION = "stop" RESTART_ACTION = "restart" STATUS_ACTION = "status" +AMBARI_AGENT_CONF = '/etc/ambari-agent/conf/ambari-agent.ini' + config_content = """ [default] debug_level = INFO @@ -139,6 +140,7 @@ metric_group_info = """ } """ + class Configuration: def __init__(self): @@ -160,6 +162,17 @@ class Configuration: } pass +self.hostname_script = None +ambari_agent_config = ConfigParser.RawConfigParser() +if os.path.exists(AMBARI_AGENT_CONF): + try: +ambari_agent_config.read(AMBARI_AGENT_CONF) +self.hostname_script = ambari_agent_config.get('agent', 'hostname_script') + except: +# No hostname script identified in the ambari agent conf +pass +pass + def getConfig(self): return self.config @@ -183,7 +196,10 @@ class Configuration: return self.get("default", "metrics_server") def get_hostname_script(self): -return self.get("default", "hostname_script") +if self.hostname_script: + return self.hostname_script +else: + return self.get("default", "hostname_script") def get_log_level(self): return self.get("default", "debug_level", "INFO") http://git-wip-us.apache.org/repos/asf/ambari/blob/c99ebb5c/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py -- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py index 37c55cb..caa972c 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py @@ -23,7 +23,6 @@ import psutil import os from collections import namedtuple import platform -import socket import time import threading import socket
ambari git commit: AMBARI-9274. Slider View: View dependency on Slider should be through external repository (srimanth)
Repository: ambari Updated Branches: refs/heads/trunk c99ebb5cf -> ae49f7c96 AMBARI-9274. Slider View: View dependency on Slider should be through external repository (srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ae49f7c9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ae49f7c9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ae49f7c9 Branch: refs/heads/trunk Commit: ae49f7c9664178560428af227e769bcf63421d38 Parents: c99ebb5 Author: Srimanth Gunturi Authored: Thu Jan 22 19:33:51 2015 -0800 Committer: Srimanth Gunturi Committed: Thu Jan 22 19:33:51 2015 -0800 -- .../slider-agent/0.60.0/slider-agent-0.60.0.pom | 25 -- .../0.60.0/slider-agent-0.60.0.tar.gz | Bin 471063 -> 0 bytes .../slider-agent/maven-metadata-local.xml | 28 -- .../slider-core/0.60.0/slider-core-0.60.0.jar | Bin 1203741 -> 0 bytes .../slider-core/0.60.0/slider-core-0.60.0.pom | 25 -- .../slider/slider-core/maven-metadata-local.xml | 28 -- contrib/views/slider/pom.xml| 330 +-- .../slider/SliderAppsViewControllerImpl.java| 17 +- 8 files changed, 19 insertions(+), 434 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ae49f7c9/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom deleted file mode 100644 index 0b1b9f5..000 --- a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom +++ /dev/null @@ -1,25 +0,0 @@ - - -http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"; xmlns="http://maven.apache.org/POM/4.0.0"; -xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> - 4.0.0 - org.apache.slider - slider-agent - 0.60.0 - POM was created from install:install-file - http://git-wip-us.apache.org/repos/asf/ambari/blob/ae49f7c9/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz deleted file mode 100644 index 0ddef92..000 Binary files a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/ae49f7c9/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml b/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml deleted file mode 100644 index 34bf9d6..000 --- a/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - org.apache.slider - slider-agent - -0.60.0 - - 0.60.0 - -2014220614 - - http://git-wip-us.apache.org/repos/asf/ambari/blob/ae49f7c9/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar deleted file mode 100644 index 08a770b..000 Binary files a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/ae49f7c9/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom deleted file mode 100644 index b1dc8e5..000 --- a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom +++ /dev/null @@ -1,25 +0,0 @@ - - -http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"; xmlns="http://maven.apache.org/POM/4.0.0"; -xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> - 4.0.0 - org.apache.slider - slider-core - 0.60.0 - POM was created from install:install-file - http://git-wip-us.apac
ambari git commit: AMBARI-9282. Update Slider View to consume metrics from AMS (Ambari Metrics Service) (Gour Saha via srimanth)
Repository: ambari Updated Branches: refs/heads/trunk ae49f7c96 -> a964003c7 AMBARI-9282. Update Slider View to consume metrics from AMS (Ambari Metrics Service) (Gour Saha via srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a964003c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a964003c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a964003c Branch: refs/heads/trunk Commit: a964003c7f8c83b254d6279271fb3d1296091765 Parents: ae49f7c Author: Srimanth Gunturi Authored: Thu Jan 22 19:38:00 2015 -0800 Committer: Srimanth Gunturi Committed: Thu Jan 22 19:38:00 2015 -0800 -- .../ambari/view/slider/GangliaMetric.java | 257 --- .../ambari/view/slider/MetricsHolder.java | 10 +- .../slider/SliderAppsViewControllerImpl.java| 26 +- .../rest/client/SliderAppGangliaHelper.java | 196 -- .../rest/client/SliderAppMasterClient.java | 38 +-- .../rest/client/SliderAppMetricsHelper.java | 151 +++ .../view/slider/rest/client/TimelineMetric.java | 172 + .../slider/rest/client/TimelineMetrics.java | 101 8 files changed, 463 insertions(+), 488 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a964003c/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/GangliaMetric.java -- diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/GangliaMetric.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/GangliaMetric.java deleted file mode 100644 index cb51768..000 --- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/GangliaMetric.java +++ /dev/null @@ -1,257 +0,0 @@ -/** - * 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. - */ - -package org.apache.ambari.view.slider; - -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -@JsonIgnoreProperties(ignoreUnknown = true) - - -/** - * Data structure for temporal data returned from Ganglia Web. - */ -public class GangliaMetric { - - // Note that the member names correspond to the names in the JSON returned from Ganglia Web. - - /** - * The name. - */ - private String ds_name; - - /** - * The ganglia cluster name. - */ - private String cluster_name; - - /** - * The graph type. - */ - private String graph_type; - - /** - * The host name. - */ - private String host_name; - - /** - * The metric name. - */ - private String metric_name; - - /** - * The temporal data points. - */ - private Number[][] datapoints; - - - private static final Set PERCENTAGE_METRIC; - - //BUG-3386 Cluster CPU Chart is off the charts - // Here can be added other percentage metrics - static { -Set temp = new HashSet(); -temp.add("cpu_wio"); -temp.add("cpu_idle"); -temp.add("cpu_nice"); -temp.add("cpu_aidle"); -temp.add("cpu_system"); -temp.add("cpu_user"); -PERCENTAGE_METRIC = Collections.unmodifiableSet(temp); - } - - - // - GangliaMetric - - - public String getDs_name() { -return ds_name; - } - - public void setDs_name(String ds_name) { -this.ds_name = ds_name; - } - - public String getCluster_name() { -return cluster_name; - } - - public void setCluster_name(String cluster_name) { -this.cluster_name = cluster_name; - } - - public String getGraph_type() { -return graph_type; - } - - public void setGraph_type(String graph_type) { -this.graph_type = graph_type; - } - - public String getHost_name() { -return host_name; - } - - public void setHost_name(String host_name) { -this.host_name = host_name; - } - - public String getMetric_name() { -return metric_name; - } - - public void setMetric_name(String metric_name) { -this.metric_name = metric_name; - } - - public Numb
ambari git commit: Revert "AMBARI-9274. Slider View: View dependency on Slider should be through external repository (srimanth)"
Repository: ambari Updated Branches: refs/heads/trunk a964003c7 -> 5ad79b964 Revert "AMBARI-9274. Slider View: View dependency on Slider should be through external repository (srimanth)" This reverts commit ae49f7c9664178560428af227e769bcf63421d38. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5ad79b96 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5ad79b96 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5ad79b96 Branch: refs/heads/trunk Commit: 5ad79b9644f90c38efafd0b9084a9c1bc82e Parents: a964003 Author: Srimanth Gunturi Authored: Thu Jan 22 20:05:40 2015 -0800 Committer: Srimanth Gunturi Committed: Thu Jan 22 20:05:40 2015 -0800 -- .../slider-agent/0.60.0/slider-agent-0.60.0.pom | 25 ++ .../0.60.0/slider-agent-0.60.0.tar.gz | Bin 0 -> 471063 bytes .../slider-agent/maven-metadata-local.xml | 28 ++ .../slider-core/0.60.0/slider-core-0.60.0.jar | Bin 0 -> 1203741 bytes .../slider-core/0.60.0/slider-core-0.60.0.pom | 25 ++ .../slider/slider-core/maven-metadata-local.xml | 28 ++ contrib/views/slider/pom.xml| 330 ++- .../slider/SliderAppsViewControllerImpl.java| 17 +- 8 files changed, 434 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad79b96/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom new file mode 100644 index 000..0b1b9f5 --- /dev/null +++ b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.pom @@ -0,0 +1,25 @@ + + +http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"; xmlns="http://maven.apache.org/POM/4.0.0"; +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> + 4.0.0 + org.apache.slider + slider-agent + 0.60.0 + POM was created from install:install-file + http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad79b96/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz new file mode 100644 index 000..0ddef92 Binary files /dev/null and b/contrib/views/slider/lib/org/apache/slider/slider-agent/0.60.0/slider-agent-0.60.0.tar.gz differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad79b96/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml b/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml new file mode 100644 index 000..34bf9d6 --- /dev/null +++ b/contrib/views/slider/lib/org/apache/slider/slider-agent/maven-metadata-local.xml @@ -0,0 +1,28 @@ + + + + org.apache.slider + slider-agent + +0.60.0 + + 0.60.0 + +2014220614 + + http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad79b96/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar new file mode 100644 index 000..08a770b Binary files /dev/null and b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.jar differ http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad79b96/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom -- diff --git a/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom new file mode 100644 index 000..b1dc8e5 --- /dev/null +++ b/contrib/views/slider/lib/org/apache/slider/slider-core/0.60.0/slider-core-0.60.0.pom @@ -0,0 +1,25 @@ + + +http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"; xmlns="http://maven.apache.org/POM/4.0.0"; +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> + 4.0.0 + org.apache.slider + slider-core + 0.60.0 + POM was created
ambari git commit: AMBARI-9278. Allow hostname customization for metric monitor. Sink configs. (swagle)
Repository: ambari Updated Branches: refs/heads/trunk 5ad79b964 -> 9906552a2 AMBARI-9278. Allow hostname customization for metric monitor. Sink configs. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9906552a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9906552a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9906552a Branch: refs/heads/trunk Commit: 9906552a2a622b06fb188ba3f138085c81a14c16 Parents: 5ad79b9 Author: Siddharth Wagle Authored: Thu Jan 22 20:58:14 2015 -0800 Committer: Siddharth Wagle Committed: Thu Jan 22 20:58:20 2015 -0800 -- .../AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 | 1 + .../templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2| 1 + .../templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2| 1 + .../hooks/before-START/templates/hadoop-metrics2.properties.j2 | 1 + 4 files changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9906552a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 -- diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 index 91fe843..4472abc 100644 --- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 +++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/hadoop-metrics2-hbase.properties.j2 @@ -51,6 +51,7 @@ rpc.period=10 rpc.collector={{ams_collector_host_single}}:{{metric_collector_port}} *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar +*.sink.timeline.slave.host.name={{hostname}} hbase.sink.timeline.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink hbase.sink.timeline.period=10 hbase.sink.timeline.collector={{ams_collector_host_single}}:{{metric_collector_port}} http://git-wip-us.apache.org/repos/asf/ambari/blob/9906552a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 -- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 index f8a82d9..50234f9 100644 --- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 @@ -50,6 +50,7 @@ hbase.extendedperiod = 3600 {% if has_metric_collector %} *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar +*.sink.timeline.slave.host.name={{hostname}} hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink hbase.period=10 hbase.collector={{metric_collector_host}}:{{metric_collector_port}} http://git-wip-us.apache.org/repos/asf/ambari/blob/9906552a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 -- diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 index 9586e1a..462bef4 100644 --- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 +++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 @@ -49,6 +49,7 @@ hbase.extendedperiod = 3600 {% if has_metric_collector %} *.timeline.plugin.urls=file:///usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar +*.sink.timeline.slave.host.name={{hostname}} hbase.class=org.apache.hadoop.metrics2.sink.timeline.HadoopTimelineMetricsSink hbase.period=10 hbase.collector={{metric_collector_host}}:{{metric_collector_port}} http://git-wip-us.apache.org/repos/asf/ambari/blob/9906552a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/templates/h