ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-14518 hadoop.proxyuser.yarn.hosts does not include both RM's in HA deployment. (ababiichuk)
Date Tue, 29 Dec 2015 15:48:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 305e67be7 -> cd8f7227a


AMBARI-14518 hadoop.proxyuser.yarn.hosts does not include both RM's in HA deployment. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cd8f7227
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cd8f7227
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cd8f7227

Branch: refs/heads/branch-2.2
Commit: cd8f7227afbaf6dc9f5a00727bdeac7c533b6c84
Parents: 305e67b
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Tue Dec 29 17:01:12 2015 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Tue Dec 29 17:01:12 2015 +0200

----------------------------------------------------------------------
 .../resourceManager/step3_controller.js         | 19 +++++++--
 .../resourceManager/step4_controller.js         | 24 +++++++----
 ambari-web/app/data/HDP2/rm_ha_properties.js    | 18 +++++++-
 ambari-web/app/messages.js                      |  3 +-
 .../resourceManager/step3_controller_test.js    | 43 ++++++++++++++++++--
 5 files changed, 89 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cd8f7227/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
index 6296f02..3db9c07 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step3_controller.js
@@ -73,7 +73,8 @@ App.RMHighAvailabilityWizardStep3Controller = Em.Controller.extend({
 
   loadConfigTagsSuccessCallback: function (data, opt, params) {
     var urlParams = '(type=zoo.cfg&tag=' + data.Clusters.desired_configs['zoo.cfg'].tag
+ ')|' +
-      '(type=yarn-site&tag=' + data.Clusters.desired_configs['yarn-site'].tag + ')';
+      '(type=yarn-site&tag=' + data.Clusters.desired_configs['yarn-site'].tag + ')|'
+
+      '(type=yarn-env&tag=' + data.Clusters.desired_configs['yarn-env'].tag + ')';
     App.ajax.send({
       name: 'reassign.load_configs',
       sender: this,
@@ -90,17 +91,19 @@ App.RMHighAvailabilityWizardStep3Controller = Em.Controller.extend({
     var
       zooCfg = data && data.items ? data.items.findProperty('type', 'zoo.cfg') :
null,
       yarnSite = data && data.items ? data.items.findProperty('type', 'yarn-site')
: null,
+      yarnEnv = data && data.items ? data.items.findProperty('type', 'yarn-env')
: null,
       portValue = zooCfg && Em.get(zooCfg, 'properties.clientPort'),
       zkPort = portValue ? portValue : '2181',
       webAddressPort = yarnSite && yarnSite.properties ? yarnSite.properties['yarn.resourcemanager.webapp.address']
: null,
-      httpsWebAddressPort = yarnSite && yarnSite.properties ? yarnSite. properties['yarn.resourcemanager.webapp.https.address']
: null;
+      httpsWebAddressPort = yarnSite && yarnSite.properties ? yarnSite.properties['yarn.resourcemanager.webapp.https.address']
: null,
+      yarnUser = yarnEnv && yarnEnv.properties ? yarnEnv.properties['yarn_user']
: null,
 
     webAddressPort = webAddressPort && webAddressPort.match(/:[0-9]*/g) ? webAddressPort.match(/:[0-9]*/g)[0]
: ":8088";
     httpsWebAddressPort = httpsWebAddressPort && httpsWebAddressPort.match(/:[0-9]*/g)
? httpsWebAddressPort.match(/:[0-9]*/g)[0] : ":8090";
 
     params = params.serviceConfig ? params.serviceConfig : arguments[4].serviceConfig;
 
-    this.setDynamicConfigValues(params, zkPort, webAddressPort, httpsWebAddressPort);
+    this.setDynamicConfigValues(params, zkPort, webAddressPort, httpsWebAddressPort, yarnUser);
     this.setProperties({
       selectedService: params,
       isLoaded: true
@@ -113,12 +116,14 @@ App.RMHighAvailabilityWizardStep3Controller = Em.Controller.extend({
    * @param zkPort
    * @param webAddressPort
    * @param httpsWebAddressPort
+   * @param yarnUser
    */
-  setDynamicConfigValues: function (configs, zkPort, webAddressPort, httpsWebAddressPort)
{
+  setDynamicConfigValues: function (configs, zkPort, webAddressPort, httpsWebAddressPort,
yarnUser) {
     var
       configProperties = configs.configs,
       currentRMHost = this.get('content.rmHosts.currentRM'),
       additionalRMHost = this.get('content.rmHosts.additionalRM'),
+      rmHosts = currentRMHost + ',' + additionalRMHost,
       zooKeeperHostsWithPort = App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').map(function
(item) {
         return item.get('hostName') + ':' + zkPort;
       }).join(',');
@@ -142,6 +147,12 @@ App.RMHighAvailabilityWizardStep3Controller = Em.Controller.extend({
     configProperties.findProperty('name', 'yarn.resourcemanager.webapp.https.address.rm2')
       .set('value', additionalRMHost + httpsWebAddressPort)
       .set('recommendedValue', additionalRMHost + httpsWebAddressPort);
+
+    var proxyUserConfig = App.ServiceConfigProperty.create(App.config.createDefaultConfig('hadoop.proxyuser.'
+ yarnUser + '.hosts',
+      'MISC', 'core-site', false,  {category : "HDFS", isUserProperty: false, isEditable:
false, isOverridable: false}));
+    configProperties.pushObject(proxyUserConfig);
+
+    proxyUserConfig.setProperties({'value': rmHosts, 'recommendedValue': rmHosts});
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd8f7227/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
index 697ed1a..221e06b 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
@@ -26,7 +26,7 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
 
   clusterDeployState: 'RM_HIGH_AVAILABILITY_DEPLOY',
 
-  commands: ['stopRequiredServices', 'installResourceManager', 'reconfigureYARN', 'startAllServices'],
+  commands: ['stopRequiredServices', 'installResourceManager', 'reconfigureYARN', 'reconfigureHDFS',
'startAllServices'],
 
   tasksMessagesPrefix: 'admin.rm_highAvailability.wizard.step',
 
@@ -40,37 +40,45 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo
   },
 
   reconfigureYARN: function () {
-    this.loadConfigsTags();
+    this.loadConfigsTags('yarn-site');
   },
 
-  loadConfigsTags: function () {
+  reconfigureHDFS: function () {
+    this.loadConfigsTags('core-site');
+  },
+
+  loadConfigsTags: function (type) {
     App.ajax.send({
       name: 'config.tags',
       sender: this,
+      data: {
+        type: type
+      },
       success: 'onLoadConfigsTags',
       error: 'onTaskError'
     });
   },
 
-  onLoadConfigsTags: function (data) {
+  onLoadConfigsTags: function (data, opt, params) {
     App.ajax.send({
       name: 'reassign.load_configs',
       sender: this,
       data: {
-        urlParams: '(type=yarn-site&tag=' + data.Clusters.desired_configs['yarn-site'].tag
+ ')'
+        urlParams: '(type=' + params.type +'&tag=' + data.Clusters.desired_configs[params.type].tag
+ ')',
+        type: params.type
       },
       success: 'onLoadConfigs',
       error: 'onTaskError'
     });
   },
 
-  onLoadConfigs: function (data) {
-    var propertiesToAdd = this.get('content.configs');
+  onLoadConfigs: function (data, opt, params) {
+    var propertiesToAdd = this.get('content.configs').filterProperty('filename', params.type);
     propertiesToAdd.forEach(function (property) {
       data.items[0].properties[property.name] = property.value;
     });
 
-    var configData = this.reconfigureSites(['yarn-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RESOURCEMANAGER')));
+    var configData = this.reconfigureSites([params.type], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('RESOURCEMANAGER')));
 
     App.ajax.send({
       name: 'common.service.configurations',

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd8f7227/ambari-web/app/data/HDP2/rm_ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/rm_ha_properties.js b/ambari-web/app/data/HDP2/rm_ha_properties.js
index 59bb24b..cb8dd8c 100644
--- a/ambari-web/app/data/HDP2/rm_ha_properties.js
+++ b/ambari-web/app/data/HDP2/rm_ha_properties.js
@@ -22,9 +22,10 @@ module.exports =
     serviceName: 'MISC',
     displayName: 'MISC',
     configCategories: [
-      App.ServiceConfigCategory.create({ name: 'YARN', displayName: 'YARN'})
+      App.ServiceConfigCategory.create({ name: 'YARN', displayName: 'YARN'}),
+      App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'})
     ],
-    sites: ['yarn-site'],
+    sites: ['yarn-site', 'core-site'],
     configs: [
     /**********************************************HDFS***************************************/
       {
@@ -32,6 +33,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.ha.enabled",
         "isReconfigurable": false,
         "recommendedValue": true,
+        "isOverridable": false,
         "value": true,
         "displayType": "checkbox",
         "category": "YARN",
@@ -43,6 +45,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.ha.rm-ids",
         "isReconfigurable": false,
         "recommendedValue": "rm1,rm2",
+        "isOverridable": false,
         "value": "rm1,rm2",
         "category": "YARN",
         "filename": "yarn-site",
@@ -53,6 +56,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.hostname.rm1",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -64,6 +68,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.webapp.address.rm1",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -74,6 +79,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.webapp.address.rm2",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -84,6 +90,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.webapp.https.address.rm1",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -94,6 +101,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.webapp.https.address.rm2",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -105,6 +113,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.hostname.rm2",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -115,6 +124,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.recovery.enabled",
         "isReconfigurable": false,
         "recommendedValue": true,
+        "isOverridable": false,
         "value": true,
         "displayType": "checkbox",
         "category": "YARN",
@@ -126,6 +136,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.store.class",
         "isReconfigurable": false,
         "recommendedValue": "org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore",
+        "isOverridable": false,
         "value": "org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore",
         "category": "YARN",
         "filename": "yarn-site",
@@ -136,6 +147,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.zk-address",
         "isReconfigurable": false,
         "recommendedValue": "",
+        "isOverridable": false,
         "value": "",
         "category": "YARN",
         "filename": "yarn-site",
@@ -146,6 +158,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.cluster-id",
         "isReconfigurable": false,
         "recommendedValue": "yarn-cluster",
+        "isOverridable": false,
         "value": "yarn-cluster",
         "category": "YARN",
         "filename": "yarn-site",
@@ -156,6 +169,7 @@ module.exports =
         "displayName": "yarn.resourcemanager.ha.automatic-failover.zk-base-path",
         "isReconfigurable": false,
         "recommendedValue": "/yarn-leader-election",
+        "isOverridable": false,
         "value": "/yarn-leader-election",
         "category": "YARN",
         "filename": "yarn-site",

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd8f7227/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7b409c6..f52b325 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1311,7 +1311,8 @@ Em.I18n.translations = {
   'admin.rm_highAvailability.wizard.step4.task0.title': 'Stop Required Services',
   'admin.rm_highAvailability.wizard.step4.task1.title': 'Install Additional ResourceManager',
   'admin.rm_highAvailability.wizard.step4.task2.title': 'Reconfigure YARN',
-  'admin.rm_highAvailability.wizard.step4.task3.title': 'Start All Services',
+  'admin.rm_highAvailability.wizard.step4.task3.title': 'Reconfigure HDFS',
+  'admin.rm_highAvailability.wizard.step4.task4.title': 'Start All Services',
   'admin.rm_highAvailability.wizard.step4.notice.inProgress':'Please wait while ResourceManager
HA is being deployed.',
   'admin.rm_highAvailability.wizard.step4.notice.completed':'ResourceManager HA has been
enabled successfully.',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd8f7227/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
b/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
index d9ed1df..f702f64 100644
--- a/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test.js
@@ -67,6 +67,9 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
             },
             'yarn-site': {
               'tag': 1
+            },
+            'yarn-env': {
+              'tag': 1
             }
           }
         }
@@ -74,7 +77,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
         'serviceConfig': {}
       });
       var data = App.ajax.send.args[0][0].data;
-      expect(data.urlParams).to.equal('(type=zoo.cfg&tag=1)|(type=yarn-site&tag=1)');
+      expect(data.urlParams).to.equal('(type=zoo.cfg&tag=1)|(type=yarn-site&tag=1)|(type=yarn-env&tag=1)');
       expect(data.serviceConfig).to.eql({});
     });
 
@@ -92,6 +95,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
           'port': '2181',
           'webAddressPort' : ':8088',
           'httpsWebAddressPort' : ':8090',
+          'yarnUser': null,
           'title': 'empty response'
         },
         {
@@ -109,6 +113,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
           'port': '2181',
           'webAddressPort' : ':8088',
           'httpsWebAddressPort' : ':8090',
+          'yarnUser': null,
           'title': 'no zoo.cfg properties received'
         },
         {
@@ -132,6 +137,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
           'port': '2181',
           'webAddressPort' : ':8088',
           'httpsWebAddressPort' : ':8090',
+          'yarnUser': null,
           'title': 'no clientPort property received'
         },
         {
@@ -139,6 +145,36 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
             {
               'type': 'zoo.cfg',
               'properties': {
+                'n': 'v'
+              }
+            },
+            {
+              'type': 'yarn-site',
+              'properties': {
+                'n': 'v'
+              }
+            },
+            {
+              'type': 'yarn-env',
+              'properties': {
+                'yarn_user': 'yarn'
+              }
+            }
+          ],
+          'params': {
+            'serviceConfig': {}
+          },
+          'port': '2181',
+          'webAddressPort' : ':8088',
+          'httpsWebAddressPort' : ':8090',
+          'yarnUser': 'yarn',
+          'title': 'set yarn user'
+        },
+        {
+          'items': [
+            {
+              'type': 'zoo.cfg',
+              'properties': {
                 'clientPort': '2182'
               }
             },
@@ -156,6 +192,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
           'port': '2182',
           'webAddressPort' : ':7777',
           'httpsWebAddressPort' : ':8888',
+          'yarnUser': null,
           'title': 'clientPort property received'
         }
       ];
@@ -173,7 +210,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
         controller.loadConfigsSuccessCallback({
           items: item.items
         }, {}, item.params);
-        expect(controller.setDynamicConfigValues.args[0]).to.eql([{}, item.port, item.webAddressPort,
item.httpsWebAddressPort]);
+        expect(controller.setDynamicConfigValues.args[0]).to.eql([{}, item.port, item.webAddressPort,
item.httpsWebAddressPort, item.yarnUser]);
         expect(controller.get('selectedService')).to.eql({});
         expect(controller.get('isLoaded')).to.be.true;
       });
@@ -198,7 +235,7 @@ describe('App.RMHighAvailabilityWizardStep3Controller', function () {
         serviceConfig: {}
       });
       console.error("test_alex!!!!!",controller.setDynamicConfigValues.args[0]);
-      expect(controller.setDynamicConfigValues.args[0]).to.eql([{}, '2181', ':8088', ':8090']);
+      expect(controller.setDynamicConfigValues.args[0]).to.eql([{}, '2181', ':8088', ':8090',
null]);
       expect(controller.get('selectedService')).to.eql({});
       expect(controller.get('isLoaded')).to.be.true;
     });


Mime
View raw message