소스 검색

AMBARI-3429. Reassign Master Wizard: move non-HA NameNode in 2.x stack (non-secure). (akovalenko)

Aleksandr Kovalenko 11 년 전
부모
커밋
2e6e7d1505
3개의 변경된 파일24개의 추가작업 그리고 15개의 파일을 삭제
  1. 10 3
      ambari-web/app/controllers/wizard/step13_controller.js
  2. 13 1
      ambari-web/app/routes/reassign_master_routes.js
  3. 1 11
      ambari-web/app/views/main/service/item.js

+ 10 - 3
ambari-web/app/controllers/wizard/step13_controller.js

@@ -191,6 +191,7 @@ App.WizardStep13Controller = App.HighAvailabilityProgressPageController.extend({
   configsSitesNumber: null,
 
   onLoadConfigs: function (data) {
+    var isHadoop2Stack = App.get('isHadoop2Stack');
     var componentName = this.get('content.reassign.component_name');
     var targetHostName = this.get('content.masterComponentHosts').findProperty('component', this.get('content.reassign.component_name')).hostName;
     var configs = {};
@@ -202,10 +203,16 @@ App.WizardStep13Controller = App.HighAvailabilityProgressPageController.extend({
     }, this);
     switch (componentName) {
       case 'NAMENODE':
-        componentDir = configs['hdfs-site']['dfs.name.dir'];
+        if (isHadoop2Stack) {
+          componentDir = configs['hdfs-site']['dfs.namenode.name.dir'];
+          configs['hdfs-site']['dfs.namenode.http-address'] = targetHostName + ':50070';
+          configs['hdfs-site']['dfs.namenode.https-address'] = targetHostName + ':50470';
+        } else {
+          componentDir = configs['hdfs-site']['dfs.name.dir'];
+          configs['hdfs-site']['dfs.http.address'] = targetHostName + ':50070';
+          configs['hdfs-site']['dfs.https.address'] = targetHostName + ':50470';
+        }
         configs['core-site']['fs.default.name'] = 'hdfs://' + targetHostName + ':8020';
-        configs['hdfs-site']['dfs.http.address'] = targetHostName + ':50070';
-        configs['hdfs-site']['dfs.https.address'] = targetHostName + ':50470';
         configs['hdfs-site']['dfs.safemode.threshold.pct'] = '1.1f';
         if (App.Service.find().someProperty('serviceName', 'HBASE')) {
           configs['hbase-site']['hbase.rootdir'] = configs['hbase-site']['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + targetHostName);

+ 13 - 1
ambari-web/app/routes/reassign_master_routes.js

@@ -162,6 +162,10 @@ module.exports = Em.Route.extend({
         });
         router.transitionTo('main.index');
       }
+    },
+
+    unroutePath: function () {
+      return false;
     }
   }),
 
@@ -177,7 +181,11 @@ module.exports = Em.Route.extend({
         controller.connectOutlet('wizardStep14', controller.get('content'));
       })
     },
-    next: Em.Router.transitionTo('step6')
+    next: Em.Router.transitionTo('step6'),
+
+    unroutePath: function () {
+      return false;
+    }
   }),
 
   step6: Em.Route.extend({
@@ -207,6 +215,10 @@ module.exports = Em.Route.extend({
         });
         router.transitionTo('main.index');
       }
+    },
+
+    unroutePath: function () {
+      return false;
     }
   }),
 

+ 1 - 11
ambari-web/app/views/main/service/item.js

@@ -24,20 +24,10 @@ App.MainServiceItemView = Em.View.extend({
     var options = [];
     var service = this.get('controller.content');
     switch(service.get('serviceName')) {
-      case 'HDFS':
-        if (App.supports.reassignMaster) {
-          this.get('controller.content.hostComponents').filterProperty('isMaster').forEach (function (hostComponent){
-            options.push({action: 'reassignMaster', context: hostComponent, 'label': Em.I18n.t('services.service.actions.reassign.master').format(hostComponent.get('displayName'))});
-          })
-        }
-//        options.push({action: 'runRebalancer', 'label': Em.I18n.t('services.service.actions.run.rebalancer')});
-        break;
-//      case 'HBASE':
-//        options.push({action: 'runCompaction', 'label': Em.I18n.t('services.service.actions.run.compaction')});
-//        break;
       case 'GANGLIA':
       case 'NAGIOS':
         break;
+      case 'HDFS':
       case 'MAPREDUCE':
         if (App.supports.reassignMaster) {
           this.get('controller.content.hostComponents').filterProperty('isMaster').forEach (function (hostComponent){