Jelajahi Sumber

AMBARI-6468. NameNode HA wizard: create JournalNode and ZKFC components before installing them. (alexantonenko)

Alex Antonenko 11 tahun lalu
induk
melakukan
e8c7e6ba0f

+ 9 - 0
ambari-web/app/controllers/main/admin/highAvailability/step5_controller.js

@@ -50,6 +50,15 @@ App.HighAvailabilityWizardStep5Controller = App.HighAvailabilityProgressPageCont
   },
   },
 
 
   installJournalNodes: function () {
   installJournalNodes: function () {
+    App.ajax.send({
+      name: 'admin.high_availability.create_journalnode',
+      sender: this,
+      success: 'onJournalNodeCreate',
+      error: 'onJournalNodeCreate'
+    });
+  },
+
+  onJournalNodeCreate: function () {
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
     var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
     this.createComponent('JOURNALNODE', hostNames, "HDFS");
     this.createComponent('JOURNALNODE', hostNames, "HDFS");
   },
   },

+ 9 - 0
ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js

@@ -41,6 +41,15 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
   },
   },
 
 
   installZKFC: function () {
   installZKFC: function () {
+    App.ajax.send({
+      name: 'admin.high_availability.create_zkfc',
+      sender: this,
+      success: 'onZKFCCreate',
+      error: 'onZKFCCreate'
+    });
+  },
+
+  onZKFCCreate: function () {
     var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
     var hostName = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
     this.createComponent('ZKFC', hostName, "HDFS");
     this.createComponent('ZKFC', hostName, "HDFS");
   },
   },

+ 36 - 0
ambari-web/app/utils/ajax/ajax.js

@@ -804,6 +804,42 @@ var urls = {
       }
       }
     }
     }
   },
   },
+  'admin.high_availability.create_journalnode': {
+    'real': '/clusters/{clusterName}/services?ServiceInfo/service_name=HDFS',
+    'mock': '',
+    'type': 'POST',
+    'format': function() {
+      return {
+        data: JSON.stringify({
+          "components": [
+            {
+              "ServiceComponentInfo": {
+                "component_name": "JOURNALNODE"
+              }
+            }
+          ]
+        })
+      }
+    }
+  },
+  'admin.high_availability.create_zkfc': {
+    'real': '/clusters/{clusterName}/services?ServiceInfo/service_name=HDFS',
+    'mock': '',
+    'type': 'POST',
+    'format': function() {
+      return {
+        data: JSON.stringify({
+          "components": [
+            {
+              "ServiceComponentInfo": {
+                "component_name": "ZKFC"
+              }
+            }
+          ]
+        })
+      }
+    }
+  },
   'admin.high_availability.load_configs': {
   'admin.high_availability.load_configs': {
     'real': '/clusters/{clusterName}/configurations?(type=core-site&tag={coreSiteTag})|(type=hdfs-site&tag={hdfsSiteTag})',
     'real': '/clusters/{clusterName}/configurations?(type=core-site&tag={coreSiteTag})|(type=hdfs-site&tag={hdfsSiteTag})',
     'mock': ''
     'mock': ''