current step
+ */
+ loadMap: {
+ '1': [
+ {
+ type: 'sync',
+ callback: function () {
+ this.load('cluster');
+ }
+ }
+ ],
+ '2': [
+ {
+ type: 'async',
+ callback: function () {
+ var self = this,
+ dfd = $.Deferred();
+ this.loadServicesFromServer();
+ this.loadMasterComponentHosts().done(function () {
+ self.loadConfirmedHosts();
+ dfd.resolve();
+ });
+ return dfd.promise();
+ }
+ }
+ ],
+ '3': [
+ {
+ type: 'sync',
+ callback: function () {
+ this.load('cluster');
+ }
+ }
+ ],
+ '4': [
+ {
+ type: 'sync',
+ callback: function () {
+ this.loadServiceConfigProperties();
+ this.loadTasksStatuses();
+ this.loadTasksRequestIds();
+ this.loadRequestIds();
+ }
+ }
+ ]
+ },
+
+ init: function () {
+ this._super();
+ this.clearStep();
+ },
+
+ clearStep: function () {
+ this.set('isFinished', false);
+ },
+
+ setCurrentStep: function (currentStep, completed) {
+ this._super(currentStep, completed);
+ App.clusterStatus.setClusterStatus({
+ clusterName: this.get('content.cluster.name'),
+ wizardControllerName: 'routerFederationWizardController',
+ localdb: App.db.data
+ });
+ },
+
+ saveNNHosts: function (nnHosts) {
+ this.set('content.nnHosts', nnHosts);
+ this.setDBProperty('nnHosts', nnHosts);
+ },
+
+ /**
+ * Load hosts for additional and current ResourceManagers from local db to controller.content
+ */
+ loadNNHosts: function() {
+ var nnHosts = this.getDBProperty('nnHosts');
+ this.set('content.nnHosts', nnHosts);
+ },
+
+ saveServiceConfigProperties: function (stepController) {
+ var serviceConfigProperties = [];
+ var data = stepController.get('serverConfigData');
+
+ var _content = stepController.get('stepConfigs')[0];
+ _content.get('configs').forEach(function (_configProperties) {
+ var siteObj = data.items.findProperty('type', _configProperties.get('filename'));
+ if (siteObj) {
+ siteObj.properties[_configProperties.get('name')] = _configProperties.get('value');
+ }
+ }, this);
+ this.setDBProperty('serviceConfigProperties', data);
+ this.set('content.serviceConfigProperties', data);
+ },
+
+ /**
+ * Load serviceConfigProperties to model
+ */
+ loadServiceConfigProperties: function () {
+ this.set('content.serviceConfigProperties', this.getDBProperty('serviceConfigProperties'));
+ },
+
+ /**
+ * Remove all loaded data.
+ * Created as copy for App.router.clearAllSteps
+ */
+ clearAllSteps: function () {
+ this.clearInstallOptions();
+ // clear temporary information stored during the install
+ this.set('content.cluster', this.getCluster());
+ },
+
+ /**
+ * Clear all temporary data
+ */
+ finish: function () {
+ this.resetDbNamespace();
+ App.router.get('updateController').updateAll();
+ this.set('isFinished', true);
+ }
+});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 3ac72149799..f73f895ec7b 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -142,6 +142,28 @@ App.MainAdminHighAvailabilityController = App.WizardController.extend({
return true;
},
+ /**
+ * enable router Based Federation
+ * @return {Boolean}
+ */
+ enableRouterFederation: function () {
+ //Prerequisite Checks
+ var message = [];
+ if (!App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').everyProperty('workStatus', 'STARTED')) {
+ message.push(Em.I18n.t('admin.nameNodeFederation.wizard.required.zookeepers'));
+ }
+
+ if (!App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').everyProperty('workStatus', 'STARTED')) {
+ message.push(Em.I18n.t('admin.nameNodeFederation.wizard.required.journalnodes'));
+ }
+ if (message.length > 0) {
+ this.showErrorPopup(message);
+ return false;
+ }
+ App.router.transitionTo('main.services.enableRouterFederation');
+ return true;
+ },
+
/**
* open Manage JournalNode Wizard if there are two started NameNodes with defined active/standby state
* @returns {boolean}
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index d749c313f70..380c94aaabf 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1518,6 +1518,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
highAvailabilityController.enableNameNodeFederation();
},
+ openRouterFederationWizard: function () {
+ var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+ highAvailabilityController.enableRouterFederation();
+ },
+
/**
* This method is called when user event to download configs for "All Clients"
* is made from service action menu
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 5952ed7219f..c17514768c5 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -250,7 +250,9 @@ App.WizardStep6Controller = Em.Controller.extend(App.HostComponentValidationMixi
this.get('hosts').forEach(function (host) {
host.checkboxes.filterProperty('isInstalled', false).forEach(function (checkbox) {
if (checkbox.component === component) {
- Em.set(checkbox, 'checked', checked);
+ if (!checkbox.isDisabled) {
+ Em.set(checkbox, 'checked', checked);
+ }
}
});
});
diff --git a/ambari-web/app/data/configs/wizards/router_federation_properties.js b/ambari-web/app/data/configs/wizards/router_federation_properties.js
new file mode 100644
index 00000000000..c87f2eb4d4c
--- /dev/null
+++ b/ambari-web/app/data/configs/wizards/router_federation_properties.js
@@ -0,0 +1,80 @@
+/**
+ * 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.
+ */
+
+module.exports =
+ {
+ "routerFederationConfig": {
+ serviceName: 'MISC',
+ displayName: 'MISC',
+ configCategories: [
+ App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'})
+ ],
+ sites: ['core-site', 'hdfs-rbf-site'],
+ configs: [
+ {
+ "name": "dfs.federation.router.monitor.namenode",
+ "displayName": "dfs.federation.router.monitor.namenode",
+ "description": "RPC address for HDFS Services communication.",
+ "isReconfigurable": false,
+ "recommendedValue": "{{nameservice1}}.nn1, {{nameservice1}}.nn2, {{newNameservice}}.{{newNameNode1Index}},{{newNameservice}}.{{newNameNode2Index}}",
+ "value": "{{modifiedNameServices}}",
+ "category": "HDFS",
+ "filename": "hdfs-rbf-site",
+ "serviceName": 'MISC',
+ "isRouterConfigs" : true
+ },
+ {
+ "name": "dfs.federation.router.default.nameserviceId",
+ "displayName": "dfs.federation.router.default.nameserviceId",
+ "description": "Nameservice identifier of the default subcluster to monitor.",
+ "isReconfigurable": false,
+ "recommendedValue": "{{nameservice1}}",
+ "value": "{{nameservice1}}",
+ "category": "HDFS",
+ "filename": "hdfs-rbf-site",
+ "serviceName": 'MISC',
+ "isRouterConfigs" : true
+ },
+ {
+ "name": "zk-dt-secret-manager.zkAuthType",
+ "displayName": "zk-dt-secret-manager.zkAuthType",
+ "description": "Secret Manager Zookeeper Authentication Type",
+ "isReconfigurable": false,
+ "recommendedValue": "none",
+ "value": "none",
+ "category": "HDFS",
+ "filename": "hdfs-rbf-site",
+ "serviceName": 'MISC',
+ "isRouterConfigs" : true
+ },
+ {
+ "name": "zk-dt-secret-manager.zkConnectionString",
+ "displayName": "zk-dt-secret-manager.zkConnectionString",
+ "description": "Secret Manager Zookeeper Connection String",
+ "isReconfigurable": false,
+ "recommendedValue": "zk1.example.com:2181,zk2.example.com:2181,zk3.example.com:2181",
+ "value": "{{zkAddress}}",
+ "category": "HDFS",
+ "filename": "hdfs-rbf-site",
+ "serviceName": 'MISC',
+ "isRouterConfigs" : true
+ }
+ ]
+ }
+
+ };
\ No newline at end of file
diff --git a/ambari-web/app/data/controller_route.js b/ambari-web/app/data/controller_route.js
index 8f6f385bff3..914ee88f152 100644
--- a/ambari-web/app/data/controller_route.js
+++ b/ambari-web/app/data/controller_route.js
@@ -85,6 +85,10 @@ module.exports = [
wizardControllerName: App.router.get('nameNodeFederationWizardController.name'),
route: 'main.services.enableNameNodeFederation'
},
+ {
+ wizardControllerName: App.router.get('routerFederationWizardController.name'),
+ route: 'main.services.enableRouterFederation'
+ },
{
wizardControllerName: App.router.get('manageJournalNodeWizardController.name'),
route: 'main.services.manageJournalNode'
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 78626c1989d..350883769db 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1727,6 +1727,28 @@ Em.I18n.translations = {
'admin.nameNodeFederation.wizard.step4.task16.title': 'Start NameNode',
'admin.nameNodeFederation.wizard.step4.task17.title': 'Restart Required Services',
+ 'admin.routerFederation.button.enable':'Add DFSRouter',
+ 'admin.routerFederation.wizard.header': 'Add HDFS Router',
+ 'admin.routerFederation.closePopup': 'Are you sure you want to quit?',
+ 'admin.routerFederation.closePopup2': 'Add HDFS Router Wizard is in progress. Are you sure you want to exit the wizard?',
+ 'admin.routerFederation.wizard.step1.header': 'Get Started',
+ 'admin.routerFederation.wizard.step1.body':'This wizard will walk you through the process of enabling DFSRouter to manage federated cluster.',
+ 'admin.routerFederation.wizard.step2.header': 'Select Hosts',
+ 'admin.routerFederation.wizard.step2.body': 'Select hosts running the Routers for {0}',
+ 'admin.routerFederation.wizard.step3.header': 'Review',
+ 'admin.routerFederation.wizard.step3.addRouter': 'Add Router: ',
+ 'admin.routerFederation.wizard.step3.toBeInstalled': 'Router TO BE INSTALLED',
+ 'admin.routerFederation.wizard.step3.confirm.config.body': 'Review Configuration Changes.
' + + 'The following lists the configuration changes that will be made by the Wizard to enable Router. This information is for review only and is not editable' + + '{{t admin.routerFederation.wizard.step1.body}}
+{{t admin.highAvailability.wizard.step3.confirm.host.body}}
+{{t admin.routerFederation.wizard.step3.addRouter}} | +{{host}} | +{{t admin.routerFederation.wizard.step3.toBeInstalled}} | +