You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/08/09 03:11:09 UTC

git commit: AMBARI-2846. NameNode HA Wizard: "Initialize Metadata" page. (Antonenko Alexander via yusaku)

Updated Branches:
  refs/heads/trunk 758df470e -> 73ba823ae


AMBARI-2846. NameNode HA Wizard: "Initialize Metadata" page. (Antonenko Alexander via yusaku)


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

Branch: refs/heads/trunk
Commit: 73ba823aeb9876de21b59330ac2cb1dd32d5a5c5
Parents: 758df47
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Aug 8 18:10:56 2013 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Aug 8 18:10:56 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers.js                   |  1 +
 .../admin/highAvailability/step6_controller.js  |  4 +--
 .../admin/highAvailability/step8_controller.js  | 26 +++++++++++++++
 .../admin/highAvailability/wizard_controller.js |  3 +-
 ambari-web/app/messages.js                      | 35 +++++++++++++-------
 .../app/routes/high_availability_routes.js      | 25 +++++++++++++-
 .../main/admin/highAvailability/step8.hbs       | 27 +++++++++++++++
 .../main/admin/highAvailability/wizard.hbs      |  1 +
 ambari-web/app/utils/ajax.js                    |  4 +--
 ambari-web/app/views.js                         |  1 +
 .../main/admin/highAvailability/step8_view.js   | 32 ++++++++++++++++++
 .../main/admin/highAvailability/wizard_view.js  |  3 ++
 12 files changed, 143 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 67e212a..dc2a030 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -36,6 +36,7 @@ require('controllers/main/admin/highAvailability/step4_controller');
 require('controllers/main/admin/highAvailability/step5_controller');
 require('controllers/main/admin/highAvailability/step6_controller');
 require('controllers/main/admin/highAvailability/step7_controller');
+require('controllers/main/admin/highAvailability/step8_controller');
 require('controllers/main/admin/cluster');
 require('controllers/main/admin/stack_upgrade_controller');
 require('controllers/main/admin/user');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js
index 84e3b44..8a36a3f 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/step6_controller.js
@@ -18,9 +18,7 @@
 
 var App = require('app');
 
-require('controllers/main/admin/misc_controller');
-
-App.HighAvailabilityWizardStep6Controller = App.MainAdminMiscController.extend({
+App.HighAvailabilityWizardStep6Controller = Em.Controller.extend({
 
   name:"highAvailabilityWizardStep6Controller"
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js
new file mode 100644
index 0000000..cf49652
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/step8_controller.js
@@ -0,0 +1,26 @@
+/**
+ * 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');
+
+App.HighAvailabilityWizardStep8Controller = Em.Controller.extend({
+
+  name:"highAvailabilityWizardStep8Controller"
+
+})
+

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
index c2a9c2d..39c4f1e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
@@ -23,7 +23,7 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
 
   name: 'highAvailabilityWizardController',
 
-  totalSteps: 7,
+  totalSteps: 8,
 
   /**
    * Used for hiding back button in wizard
@@ -165,6 +165,7 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
   loadAllPriorSteps: function () {
     var step = this.get('currentStep');
     switch (step) {
+      case '8':
       case '7':
       case '6':
       case '5':

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 2836337..602c20b 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -647,9 +647,12 @@ Em.I18n.translations = {
   'admin.highAvailability.wizard.step2.header':'Select Hosts',
   'admin.highAvailability.wizard.step3.header':'Review',
   'admin.highAvailability.wizard.step4.header':'Create Checkpoint',
+  'admin.highAvailability.wizard.step6.header':'Initialize JournalNodes',
+  'admin.highAvailability.wizard.step8.header':'Initialize Metadata',
   'admin.highAvailability.wizard.step4.bodyHeader':'Manual Steps Required: Create Checkpoint on NameNode',
   'admin.highAvailability.wizard.step6.bodyHeader':'Manual Steps Required: Initialize JournalNodes',
-  'admin.highAvailability.wizard.step6.header':'Initialize JournalNodes',
+  'admin.highAvailability.wizard.step8.bodyHeader':'Manual Steps Required: Initialize NameNode HA Metadata',
+
 
   'admin.highAvailability.wizard.step5.task0.title':'Stop all services',
   'admin.highAvailability.wizard.step5.task1.title':'Install Additional NameNode',
@@ -667,17 +670,25 @@ Em.I18n.translations = {
   'admin.highAvailability.wizard.step3.jn':'JournalNode will be installed on following hosts:',
   'admin.highAvailability.wizard.step4.ckNotCreated':'Checkpoint not created yet',
   'admin.highAvailability.wizard.step6.jsNoInit':'JournalNodes not initialized yet',
-
-
-  'admin.highAvailability.wizard.step6.body':'Note: The following commands must be run as the user {0} on {1} <br/>' +
-    '1. Initialize the JournalNodes by running: <br/>' +
-    '$ hdfs namenode -initializeSharedEdits<br/>' +
-    '2. You will be able to proceed to the next step once we detect that the JournalNodes have been initialized successfuly.<br/>',
-  'admin.highAvailability.wizard.step4.body':'Note: The following commands must be run as the user {0} on {1} <br/>' +
-    '1. Put the NameNode in safe mode (read-only-mode) by running: <br/>' +
-    '$ hdfs dfsadmin -safemode enter <br/>' +
-    '2. Once NameNode is in Safe Mode, create a checkpoint by running: <br/>' +
-    '$ TDB COMMAND <br/>' +
+  'admin.highAvailability.wizard.step8.metaNoInit':'Metadata not initialized yet',
+
+
+  'admin.highAvailability.wizard.step8.body':'Note: The following command must be run as the user {0} on {2}, not {1} <br/><br/>' +
+    '1. Initialize the metadata for additional NameNode by running: <br/><br/>' +
+    '$ hdfs namenode -bootstrapStandby<br/><br/>' +
+    'Note: The following command must be run as the user {0} on {1}, not {2} <br/><br/>' +
+    '2. Initialize the metadata for NameNode automatic failover by running:<br/>' +
+    '$ hdfs -zkfc formatZK<br/><br/>' +
+    '3. You will be able to proceed to the next step once we detect that the steps were completed successfully.',
+  'admin.highAvailability.wizard.step6.body':'Note: The following commands must be run as the user {0} on {1} <br/><br/>' +
+    '1. Initialize the JournalNodes by running: <br/><br/>' +
+    '$ hdfs namenode -initializeSharedEdits<br/><br/>' +
+    '2. You will be able to proceed to the next step once we detect that the JournalNodes have been initialized successfully.',
+  'admin.highAvailability.wizard.step4.body':'Note: The following commands must be run as the user {0} on {1} <br/><br/>' +
+    '1. Put the NameNode in safe mode (read-only-mode) by running: <br/><br/>' +
+    '$ hdfs dfsadmin -safemode enter <br/><br/>' +
+    '2. Once NameNode is in Safe Mode, create a checkpoint by running: <br/><br/>' +
+    '$ TDB COMMAND <br/><br/>' +
     '3. You will be able to proceed to the next step once we detect that the NameNode is in Safe Mode and that the checkpoint has been created successfully.',
   'admin.highAvailability.wizard.step3.body':'Confirm your host selection and click Deploy to activate NameNode HA.',
   'admin.highAvailability.wizard.step2.body':'Select a host that will be running an additional NameNode.<br/> In addition,' +

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/routes/high_availability_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/high_availability_routes.js b/ambari-web/app/routes/high_availability_routes.js
index 30e6e13..da06316 100644
--- a/ambari-web/app/routes/high_availability_routes.js
+++ b/ambari-web/app/routes/high_availability_routes.js
@@ -170,6 +170,27 @@ module.exports = Em.Route.extend({
       router.transitionTo('step6');
     },
     next: function (router) {
+      router.transitionTo('step8');
+    }
+  }),
+
+  step8: Em.Route.extend({
+    route: '/step8',
+    connectOutlets: function (router) {
+      $('a.close').hide();
+      var controller = router.get('highAvailabilityWizardController');
+      controller.setCurrentStep('8');
+      controller.setLowerStepsDisable(8);
+      controller.dataLoading().done(function () {
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('highAvailabilityWizardStep8',  controller.get('content'));
+      })
+    },
+    back: function (router) {
+      router.transitionTo('step7');
+    },
+    next: function (router) {
+      router.transitionTo('step9');
     }
   }),
 
@@ -185,5 +206,7 @@ module.exports = Em.Route.extend({
 
   gotoStep6: Em.Router.transitionTo('step6'),
 
-  gotoStep7: Em.Router.transitionTo('step7')
+  gotoStep7: Em.Router.transitionTo('step7'),
+
+  gotoStep8: Em.Router.transitionTo('step8')
 });

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/templates/main/admin/highAvailability/step8.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/step8.hbs b/ambari-web/app/templates/main/admin/highAvailability/step8.hbs
new file mode 100644
index 0000000..5863699
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/step8.hbs
@@ -0,0 +1,27 @@
+{{!
+* 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.
+}}
+<div>
+  <h2>{{t admin.highAvailability.wizard.step8.bodyHeader}}</h2>
+  <p class="alert alert-info">
+    {{{view.step8BodyText}}}
+  </p>
+  <div class="btn-area">
+    <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} &rarr;</a>
+    <span class="pull-right btn-extra-info">{{t admin.highAvailability.wizard.step8.metaNoInit}}</span>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs
index b4612e0..4ad0154 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs
@@ -32,6 +32,7 @@
               <li {{bindAttr class="isStep5:active view.isStep5Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep5 target="controller"}}>{{t admin.highAvailability.wizard.progressPage.header}}</a></li>
               <li {{bindAttr class="isStep6:active view.isStep6Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep6 target="controller"}}>{{t admin.highAvailability.wizard.step6.header}}</a></li>
               <li {{bindAttr class="isStep7:active view.isStep7Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep7 target="controller"}}>{{t admin.highAvailability.wizard.progressPage.header}}</a></li>
+              <li {{bindAttr class="isStep8:active view.isStep8Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep8 target="controller"}}>{{t admin.highAvailability.wizard.step8.header}}</a></li>
             </ul>
           </div>
         </div>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 8c7bd80..6c45490 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -646,11 +646,11 @@ var urls = {
     'type': 'PUT',
     'format': function () {
       return {
-        data: {
+        data: JSON.stringify({
           "HostRoles": {
             "state": "MAINTENANCE"
           }
-        }
+        })
       }
     }
   },

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 4f7bd1a..02b84a2 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -63,6 +63,7 @@ require('views/main/admin/highAvailability/step4_view');
 require('views/main/admin/highAvailability/step5_view');
 require('views/main/admin/highAvailability/step6_view');
 require('views/main/admin/highAvailability/step7_view');
+require('views/main/admin/highAvailability/step8_view');
 require('views/main/admin/cluster');
 require('views/main/admin/misc_view');
 require('views/main/admin/stack_upgrade');

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/views/main/admin/highAvailability/step8_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/step8_view.js b/ambari-web/app/views/main/admin/highAvailability/step8_view.js
new file mode 100644
index 0000000..bf4b369
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/step8_view.js
@@ -0,0 +1,32 @@
+/**
+ * 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');
+
+App.HighAvailabilityWizardStep8View = Em.View.extend({
+
+  templateName: require('templates/main/admin/highAvailability/step8'),
+
+  step8BodyText: function () {
+    var nN = this.get('controller.content.masterComponentHosts').findProperty('isCurNameNode', true);
+    var addNN = this.get('controller.content.masterComponentHosts').findProperty('isAddNameNode', true);
+    return Em.I18n.t('admin.highAvailability.wizard.step8.body').format(this.get('controller.content.hdfsUser'), nN.hostName, addNN.hostName);
+  }.property('controller.content.masterComponentHosts')
+
+});

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/73ba823a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js
index cc9f6a8..84a776f 100644
--- a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js
@@ -51,6 +51,9 @@ App.HighAvailabilityWizardView = Em.View.extend({
     return this.isStepDisabled(7);
   }.property('controller.isStepDisabled.@each.value').cacheable(),
 
+  isStep8Disabled: function () {
+    return this.isStepDisabled(8);
+  }.property('controller.isStepDisabled.@each.value').cacheable(),
 
   isStepDisabled: function (index) {
     return this.get('controller.isStepDisabled').findProperty('step', index).get('value');