ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject ambari git commit: AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in HA mode (bhuvnesh2703 via jaoki)
Date Wed, 03 Feb 2016 23:29:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 a539802bc -> 8b620a3c3


AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in HA mode (bhuvnesh2703 via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 8b620a3c3bc1beeec76d23c4bfbf36c7ca1f88ea
Parents: a539802
Author: Jun Aoki <jaoki@apache.org>
Authored: Wed Feb 3 15:29:02 2016 -0800
Committer: Jun Aoki <jaoki@apache.org>
Committed: Wed Feb 3 15:29:02 2016 -0800

----------------------------------------------------------------------
 .../common-services/HAWQ/2.0.0/metainfo.xml     |  10 +
 .../2.0.0/package/scripts/hawq_constants.py     |   1 +
 .../HAWQ/2.0.0/package/scripts/hawqstandby.py   |   3 +-
 ambari-web/app/assets/test/tests.js             |   1 +
 ambari-web/app/controllers.js                   |   4 +
 .../hawq/activateStandby/step1_controller.js    |  23 +++
 .../hawq/activateStandby/step2_controller.js    | 130 +++++++++++++
 .../hawq/activateStandby/step3_controller.js    | 126 ++++++++++++
 .../hawq/activateStandby/wizard_controller.js   | 128 +++++++++++++
 .../main/admin/highAvailability_controller.js   |   9 +
 ambari-web/app/controllers/main/service/item.js |   5 +
 .../HDP2.3/hawq_activate_standby_properties.js  |  43 +++++
 ambari-web/app/data/controller_route.js         |   4 +
 ambari-web/app/messages.js                      |  37 +++-
 .../wizard/wizardProgressPageController.js      |  28 +++
 ambari-web/app/models/host_component.js         |   7 +
 .../app/routes/activate_hawq_standby_routes.js  | 190 +++++++++++++++++++
 ambari-web/app/routes/main.js                   |   2 +
 .../hawq/activateStandby/step1.hbs              |  28 +++
 .../hawq/activateStandby/step2.hbs              |  53 ++++++
 .../hawq/activateStandby/step3.hbs              |  18 ++
 .../hawq/activateStandby/wizard.hbs             |  44 +++++
 ambari-web/app/utils/db.js                      |   1 +
 ambari-web/app/views.js                         |   4 +
 .../hawq/activateStandby/step1_view.js          |  26 +++
 .../hawq/activateStandby/step2_view.js          |  29 +++
 .../hawq/activateStandby/step3_view.js          |  36 ++++
 .../hawq/activateStandby/wizard_view.js         |  74 ++++++++
 ambari-web/app/views/main/service/item.js       |   2 +
 .../activateStandby/step2_controller_test.js    | 172 +++++++++++++++++
 30 files changed, 1236 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
index 21ab445..ce625eb 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
@@ -76,6 +76,16 @@
               <scriptType>PYTHON</scriptType>
               <timeout>600</timeout>
           </commandScript>
+          <customCommands>
+            <customCommand>
+              <name>ACTIVATE_STANDBY</name>
+              <commandScript>
+                <script>scripts/hawqstandby.py</script>
+                <scriptType>PYTHON</scriptType>
+                <timeout>1200</timeout>
+              </commandScript>
+            </customCommand>
+          </customCommands>
           <dependencies>
             <dependency>
                 <name>HDFS/HDFS_CLIENT</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
index 01de99a..6a2d9ba 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
@@ -27,6 +27,7 @@ YARN = "yarn"
 CLUSTER = "cluster"
 IMMEDIATE = "immediate"
 FAST = "fast"
+ACTIVATE = "activate"
 
 # Users
 root_user = "root"

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
index 7f5bab4..3395810 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
@@ -52,7 +52,8 @@ class HawqStandby(Script):
     check_process_status(get_pid_file())
 
   def activatestandby(self, env):
-    pass
+    import utils
+    utils.exec_hawq_operation(hawq_constants.ACTIVATE, "{0} -a -M {1} -v".format(hawq_constants.STANDBY, hawq_constants.FAST))
 
 if __name__ == "__main__":
     HawqStandby().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 90115bf..e710de2 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -68,6 +68,7 @@ var files = ['test/init_model_test',
   'test/controllers/main/admin/highAvailability/nameNode/step4_controller_test',
   'test/controllers/main/admin/highAvailability/resourceManager/step3_controller_test',
   'test/controllers/main/admin/highAvailability/hawq/addStandby/step3_controller_test',
+  'test/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller_test',
   'test/controllers/main/admin/security_test',
   'test/controllers/main/admin/security/disable_test',
   'test/controllers/main/admin/security/security_progress_controller_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 82b0509..2f17a7e 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -58,6 +58,10 @@ require('controllers/main/admin/highAvailability/hawq/addStandby/step1_controlle
 require('controllers/main/admin/highAvailability/hawq/addStandby/step2_controller');
 require('controllers/main/admin/highAvailability/hawq/addStandby/step3_controller');
 require('controllers/main/admin/highAvailability/hawq/addStandby/step4_controller');
+require('controllers/main/admin/highAvailability/hawq/activateStandby/wizard_controller');
+require('controllers/main/admin/highAvailability/hawq/activateStandby/step1_controller');
+require('controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller');
+require('controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller');
 require('controllers/main/admin/highAvailability/rangerAdmin/wizard_controller');
 require('controllers/main/admin/highAvailability/rangerAdmin/step1_controller');
 require('controllers/main/admin/highAvailability/rangerAdmin/step2_controller');

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step1_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step1_controller.js
new file mode 100644
index 0000000..5652a2f
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step1_controller.js
@@ -0,0 +1,23 @@
+/**
+ * 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.ActivateHawqStandbyWizardStep1Controller = Em.Controller.extend({
+  name: "activateHawqStandbyWizardStep1Controller"
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller.js
new file mode 100644
index 0000000..768dc49
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller.js
@@ -0,0 +1,130 @@
+/**
+ * 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.
+ */
+
+/**
+ * @typedef {object} hawqActivateStandbyConfigDependencies
+ */
+
+var App = require('app');
+
+App.ActivateHawqStandbyWizardStep2Controller = Em.Controller.extend({
+  name: "activateHawqStandbyWizardStep2Controller",
+
+  selectedService: null,
+
+  versionLoaded: true,
+
+  hideDependenciesInfoBar: true,
+
+  isLoaded: false,
+
+  isSubmitDisabled: Em.computed.not('isLoaded'),
+
+  loadStep: function () {
+    this.renderConfigs();
+  },
+
+  /**
+   * Render configs to show them in <code>App.ServiceConfigView</code>
+   */
+  renderConfigs: function () {
+    newHawqMaster = App.HostComponent.find().findProperty('componentName','HAWQSTANDBY').get('hostName');
+
+    var configs = require('data/HDP2.3/hawq_activate_standby_properties').haConfig;
+
+    var serviceConfig = App.ServiceConfig.create({
+      serviceName: configs.serviceName,
+      displayName: configs.displayName,
+      configCategories: [],
+      showConfig: true,
+      configs: []
+    });
+
+    configs.configCategories.forEach(function (configCategory) {
+      if (App.Service.find().someProperty('serviceName', configCategory.name)) {
+        serviceConfig.configCategories.pushObject(configCategory);
+      }
+    }, this);
+
+    this.renderConfigProperties(configs, serviceConfig);
+
+    App.ajax.send({
+      name: 'config.tags',
+      sender: this,
+      success: 'loadConfigTagsSuccessCallback',
+      error: 'onTaskError',
+      data: {
+      serviceConfig: serviceConfig
+      }
+    });
+
+  },
+
+  loadConfigTagsSuccessCallback: function (data, opt, params) {
+    var urlParams = '(type=hawq-site&tag=' + data.Clusters.desired_configs['hawq-site'].tag + ')';
+    App.ajax.send({
+      name: 'reassign.load_configs',
+      sender: this,
+      data: {
+        urlParams: urlParams,
+        serviceConfig: params.serviceConfig
+      },
+      success: 'loadConfigsSuccessCallback',
+      error: 'onTaskError'
+    });
+  },
+
+  loadConfigsSuccessCallback: function (data, opt, params) {
+    params = params.serviceConfig ? params.serviceConfig : {};
+    this.setDynamicConfigValues(params);
+    this.setProperties({
+      selectedService: params,
+      isLoaded: true
+    });
+  },
+
+  setDynamicConfigValues: function (configs) {
+    var hawqStandbyHost = this.get('content.hawqHosts.hawqStandby')
+    var configProperties = configs.configs;
+    configProperties.findProperty('name', 'hawq_master_address_host').set('value', hawqStandbyHost).set('recommendedValue', hawqStandbyHost);
+    return configs;
+  },
+
+  /**
+   * Load child components to service config object
+   * @param _componentConfig
+   * @param componentConfig
+   */
+  renderConfigProperties: function (_componentConfig, componentConfig) {
+    _componentConfig.configs.forEach(function (_serviceConfigProperty) {
+      var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
+      componentConfig.configs.pushObject(serviceConfigProperty);
+      serviceConfigProperty.set('isEditable', serviceConfigProperty.get('isReconfigurable'));
+      serviceConfigProperty.validate();
+    }, this);
+  },
+
+  submit: function () {
+    if (!this.get('isSubmitDisabled')) {
+      App.get('router.mainAdminKerberosController').getKDCSessionState(function() {
+        App.router.send("next");
+      });
+    }
+  }
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js
new file mode 100644
index 0000000..55da44e
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/step3_controller.js
@@ -0,0 +1,126 @@
+/**
+ * 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');
+require('controllers/main/admin/serviceAccounts_controller');
+
+App.ActivateHawqStandbyWizardStep3Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
+
+  name: "activateHawqStandbyWizardStep3Controller",
+
+  clusterDeployState: 'ACTIVATE_HAWQ_STANDBY',
+
+  hawqActivateStandbyCustomCommand: "ACTIVATE_STANDBY",
+
+  hawqServiceName: "HAWQ",
+
+  hawqStandbyComponentName: "HAWQSTANDBY",
+
+  hawqMasterComponentName: "HAWQMASTER",
+
+  commands: ['activateStandby', 'stopRequiredServices', 'reconfigureHAWQ', 'installHawqMaster', 'deleteOldHawqMaster',
+              'deleteHawqStandby', 'startRequiredServices'],
+
+  tasksMessagesPrefix: 'admin.activateHawqStandby.wizard.step',
+
+  activateStandby: function () {
+    App.ajax.send({
+      name : 'service.item.executeCustomCommand',
+      sender: this,
+      data : {
+        command : this.hawqActivateStandbyCustomCommand,
+        context : Em.I18n.t('admin.activateHawqStandby.wizard.step3.activateHawqStandbyCommand.context'),
+        hosts : this.get('content.hawqHosts.hawqStandby'),
+        serviceName : this.hawqServiceName,
+        componentName : this.hawqStandbyComponentName
+      },
+      success: 'startPolling',
+      error: 'onTaskError'
+    });
+  },
+
+  stopRequiredServices: function () {
+    this.stopServices([this.hawqServiceName], true);
+  },
+
+  reconfigureHAWQ: function () {
+    App.ajax.send({
+      name: 'config.tags',
+      sender: this,
+      success: 'onLoadHawqConfigsTags',
+      error: 'onTaskError'
+    });
+  },
+
+  onLoadHawqConfigsTags: function (data) {
+    App.ajax.send({
+      name: 'reassign.load_configs',
+      sender: this,
+      data: {
+        urlParams: '(type=hawq-site&tag=' + data.Clusters.desired_configs['hawq-site'].tag + ')',
+        type: 'hawq-site'
+      },
+      success: 'onLoadConfigs',
+      error: 'onTaskError'
+    });
+  },
+
+  onLoadConfigs: function (data, opt, params) {
+    delete data.items[0].properties['hawq_standby_address_host'];
+
+    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([params.type], data, Em.I18n.t('admin.addHawqStandby.step4.save.configuration.note').format(App.format.role('HAWQSTANDBY')));
+
+    App.ajax.send({
+      name: 'common.service.configurations',
+      sender: this,
+      data: {
+        desired_config: configData
+      },
+      success: 'onSaveConfigs',
+      error: 'onTaskError'
+    });
+  },
+  onSaveConfigs: function () {
+    this.onTaskCompleted();
+  },
+
+  installHawqMaster: function () {
+    var hostName = this.get('content.hawqHosts.hawqStandby');
+    this.createComponent(this.hawqMasterComponentName, hostName, this.hawqServiceName);
+  },
+
+  deleteOldHawqMaster: function () {
+    var hostName = this.get('content.hawqHosts.hawqMaster');
+    this.deleteComponent(this.hawqMasterComponentName, hostName);
+  },
+
+  deleteHawqStandby: function () {
+    var hostName = this.get('content.hawqHosts.hawqStandby');
+    this.deleteComponent(this.hawqStandbyComponentName, hostName);
+  },
+
+  startRequiredServices: function () {
+    this.startServices(true, [this.hawqServiceName], true);
+  }
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/wizard_controller.js
new file mode 100644
index 0000000..f5efca2
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/highAvailability/hawq/activateStandby/wizard_controller.js
@@ -0,0 +1,128 @@
+/**
+ * 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.ActivateHawqStandbyWizardController = App.WizardController.extend({
+
+  name: 'activateHawqStandbyWizardController',
+
+  totalSteps: 3,
+
+  /**
+   * @type {string}
+   */
+  displayName: Em.I18n.t('admin.activateHawqStandby.wizard.header'),
+
+  isFinished: false,
+
+  content: Em.Object.create({
+    controllerName: 'activateHawqStandbyWizardController'
+  }),
+
+  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: 'activateHawqStandbyWizardController',
+      localdb: App.db.data
+    });
+  },
+
+  /**
+   * Save hosts for Hawq Master and Hawq Standby to local db<code>controller.content</code>
+   * @param hawqHosts
+   */
+  saveHawqHosts: function (hawqHosts) {
+    this.set('content.hawqHosts', hawqHosts);
+    this.setDBProperty('hawqHosts', hawqHosts);
+  },
+
+  /**
+   * Load hosts for Hawq Master and Hawq Standby from local db to <code>controller.content</code>
+   */
+  loadHawqHosts: function() {
+    var hawqHosts = this.getDBProperty('hawqHosts');
+    this.set('content.hawqHosts', hawqHosts);
+  },
+
+  /**
+   * Save configs to load and apply them on Configure Components step
+   * @param configs
+   */
+  saveConfigs: function (configs) {
+    this.set('content.configs', configs);
+    this.setDBProperty('configs', configs);
+  },
+
+  /**
+   * Load configs to apply them on Configure Components step
+   */
+  loadConfigs: function() {
+    var configs = this.getDBProperty('configs');
+    this.set('content.configs', configs);
+  },
+
+  /**
+   * Load data for all steps until <code>current step</code>
+   */
+  loadAllPriorSteps: function () {
+    var step = this.get('currentStep');
+    switch (step) {
+      case '3':
+        this.loadTasksStatuses();
+        this.loadTasksRequestIds();
+        this.loadRequestIds();
+        this.loadConfigs();
+      case '2':
+        this.loadHawqHosts();
+        this.loadServicesFromServer();
+        this.loadMasterComponentHosts();
+      case '1':
+        this.load('cluster');
+    }
+  },
+
+  /**
+   * Remove all loaded data.
+   */
+  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);
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/admin/highAvailability_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 29ce167..710e4d0 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -87,6 +87,15 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({
   },
 
   /**
+   * activate Hawq Standby
+   * @return {Boolean}
+   */
+  activateHawqStandby: function () {
+    App.router.transitionTo('main.services.activateHawqStandby');
+    return true;
+   },
+
+  /**
    * enable Ranger Admin High Availability
    * @return {Boolean}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 18e7c5f..6ed7b73 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -908,6 +908,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     highAvailabilityController.addHawqStandby();
   },
 
+  activateHawqStandby: function() {
+    var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+    highAvailabilityController.activateHawqStandby();
+  },
+
   enableRAHighAvailability: function() {
     var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
     highAvailabilityController.enableRAHighAvailability();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/data/HDP2.3/hawq_activate_standby_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2.3/hawq_activate_standby_properties.js b/ambari-web/app/data/HDP2.3/hawq_activate_standby_properties.js
new file mode 100644
index 0000000..a06009f
--- /dev/null
+++ b/ambari-web/app/data/HDP2.3/hawq_activate_standby_properties.js
@@ -0,0 +1,43 @@
+/**
+ * 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 =
+{
+  "haConfig": {
+    serviceName: 'MISC',
+    displayName: 'MISC',
+    configCategories: [
+      App.ServiceConfigCategory.create({name: 'HAWQ', displayName: 'HAWQ'}),
+    ],
+    sites: ['hawq-site'],
+    configs: [
+    /**********************************************HAWQ***************************************/
+      {
+        "name": "hawq_master_address_host",
+        "displayName": "HAWQ Master Host",
+        "isReconfigurable": false,
+        "recommendedValue": "",
+        "isOverridable": false,
+        "value": "",
+        "category": "HAWQ",
+        "filename": "hawq-site",
+        serviceName: 'MISC'
+      }
+    ]
+  }
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/data/controller_route.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/controller_route.js b/ambari-web/app/data/controller_route.js
index 8fcf8a2..c840ce8 100644
--- a/ambari-web/app/data/controller_route.js
+++ b/ambari-web/app/data/controller_route.js
@@ -62,6 +62,10 @@ module.exports = [
     route: 'main.services.addHawqStandby'
   },
   {
+    wizardControllerName: App.router.get('activateHawqStandbyWizardController.name'),
+    route: 'main.services.activateHawqStandby'
+  },
+  {
     wizardControllerName: App.router.get('rAHighAvailabilityWizardController.name'),
     route: 'main.services.enableRAHighAvailability'
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index ecd97bd..4a132e2 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2886,5 +2886,40 @@ Em.I18n.translations = {
   'admin.addHawqStandby.wizard.step4.task2.title': 'Reconfigure HAWQ',
   'admin.addHawqStandby.wizard.step4.task3.title': 'Start HAWQ Service',
   'admin.addHawqStandby.wizard.step4.notice.inProgress':'Please wait while HAWQ Standby Master is being deployed.',
-  'admin.addHawqStandby.wizard.step4.notice.completed':'HAWQ Standby Master has been enabled successfully.'
+  'admin.addHawqStandby.wizard.step4.notice.completed':'HAWQ Standby Master has been enabled successfully.',
+    'admin.activateHawqStandby.button.enable': 'Activate HAWQ Standby',
+  'admin.activateHawqStandby.wizard.header': 'Activate HAWQ Standby Wizard',
+  'admin.activateHawqStandby.wizard.step1.header': 'Get Started',
+  'admin.activateHawqStandby.wizard.step1.body':'This wizard will walk you through activating HAWQ Standby.' +
+      '<br/>Once activated, the HAWQ Standby will become the HAWQ Master and the old HAWQ master will be removed. ' +
+      'Users will be able to connect to HAWQ database using the new HAWQ Master.' +
+      '<br/><br/><b>You should plan a cluster maintenance window and prepare for cluster downtime when ' +
+      'activating HAWQ Standby. During this operation, HAWQ service will be stopped and started.</b>' +
+      '<br/><br/>Note: In order to add standby for HAWQ service, you can use the "Add HAWQ Standby"</b> wizard.',
+  'admin.activateHawqStandby.wizard.step2.header': 'Review',
+  'admin.highAvailability.wizard.step2.toBeDeleted': 'TO BE DELETED',
+  'admin.activateHawqStandby.wizard.step2.toBeActivated': 'STANDBY TO BE ACTIVATED',
+  'admin.activateHawqStandby.wizard.step2.hawqMaster': '<b>Current HAWQ Master:</b>',
+  'admin.activateHawqStandby.wizard.step2.hawqStandby': '<b>New HAWQ Master:</b>',
+  'admin.activateHawqStandby.wizard.step2.confirm.config.body':'<div class="alert alert-info">' +
+      '<b>Review Configuration Changes.</b></br>The following lists the configuration changes that will be ' +
+      'made by the Wizard to activate HAWQ Standby Master. This information is for <b> review only </b> and is not' +
+      ' editable.<br/><br/><b>Note:</b> hawq_standby_address_host property will be removed from hawq-site.xml as ' +
+      'HAWQ Standby will be activated to HAWQ Master.</div>',
+  'admin.activateHawqStandby.wizard.step2.confirm.host.body':'<b>Review HAWQ Master & Standby role changes.</b>',
+  'admin.activateHawqStandby.wizard.step2.confirmPopup.body': 'Do you wish to continue with activating HAWQ Standy? Please confirm, before proceeding as you will not be able to rollback from Ambari.',
+  'admin.activateHawqStandby.wizard.step3.header': 'Configure Components',
+  'admin.activateHawqStandby.wizard.step3.task0.title': 'Activate HAWQ Standby',
+  'admin.activateHawqStandby.wizard.step3.task1.title': 'Stop HAWQ Service',
+  'admin.activateHawqStandby.wizard.step3.task2.title': 'Reconfigure HAWQ',
+  'admin.activateHawqStandby.wizard.step3.task3.title': 'Install Role: New HAWQ Master',
+  'admin.activateHawqStandby.wizard.step3.task4.title': 'Delete Role: Old HAWQ Master',
+  'admin.activateHawqStandby.wizard.step3.task5.title': 'Delete Role: Old HAWQ Standby',
+  'admin.activateHawqStandby.wizard.step3.task6.title': 'Start HAWQ Service',
+  'admin.activateHawqStandby.closePopup':'Activate HAWQ Standby Wizard is in progress. You must allow the wizard to' +
+      ' complete for Ambari to be in usable state. If you choose to quit, you must follow manual instructions to' +
+      ' get back to a stable state. Are you sure you want to exit the wizard?',
+  'admin.activateHawqStandby.wizard.step3.notice.inProgress':'Please wait while HAWQ Standby is being activated',
+  'admin.activateHawqStandby.wizard.step3.notice.completed':'HAWQ Standby has been activated successfully.',
+  'admin.activateHawqStandby.wizard.step3.activateHawqStandbyCommand.context': "Execute HAWQ standby activate command"
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index 9431494..bd3f42c 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -579,6 +579,34 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, {
     }
   },
 
+ /**
+  * Delete component on single host.
+  *
+  * @method deleteComponent
+  * @param {string} componentName - name of the component
+  * @param {string} hostName - host from where components should be deleted
+  */
+  deleteComponent: function (componentName, hostName) {
+    App.ajax.send({
+      name: 'common.delete.host_component',
+      sender: this,
+      data: {
+        componentName: componentName,
+        hostName: hostName
+      },
+      success: 'onTaskCompleted',
+      error: 'onDeleteHostComponentsError'
+    });
+  },
+
+  onDeleteHostComponentsError: function (error) {
+    if (error.responseText.indexOf('org.apache.ambari.server.controller.spi.NoSuchResourceException') !== -1) {
+      this.onTaskCompleted();
+    } else {
+      this.onTaskError();
+    }
+  },
+
   /**
    * Update component status on selected hosts.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index bc481b5..36369c5 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -393,6 +393,13 @@ App.HostComponentActionMap = {
         cssClass: 'icon-plus',
         isHidden: App.get('isSingleNode') || HS,
         disabled: false
+      },
+      TOGGLE_ACTIVATE_HAWQ_STANDBY: {
+        action: 'activateHawqStandby',
+        label: Em.I18n.t('admin.activateHawqStandby.button.enable'),
+        cssClass: 'icon-arrow-up',
+        isHidden: App.get('isSingleNode') || !HS,
+	disabled: false
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/routes/activate_hawq_standby_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/activate_hawq_standby_routes.js b/ambari-web/app/routes/activate_hawq_standby_routes.js
new file mode 100644
index 0000000..3f130fb
--- /dev/null
+++ b/ambari-web/app/routes/activate_hawq_standby_routes.js
@@ -0,0 +1,190 @@
+/**
+ * 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');
+
+module.exports = App.WizardRoute.extend({
+  route: '/highAvailability/Hawq/activate',
+
+  enter: function (router, transition) {
+    var activateHawqStandbyWizardController = router.get('activateHawqStandbyWizardController');
+    activateHawqStandbyWizardController.dataLoading().done(function () {
+      App.router.set('mainServiceItemController.content', App.Service.find().findProperty('serviceName', 'HAWQ'));
+    });
+    Em.run.next(function() {
+      App.router.get('updateController').set('isWorking', false);
+      var popup = App.ModalPopup.show({
+        classNames: ['full-width-modal'],
+        header: Em.I18n.t('admin.activateHawqStandby.wizard.header'),
+        bodyClass: App.ActivateHawqStandbyWizardView.extend({
+          controller: activateHawqStandbyWizardController
+        }),
+        primary: Em.I18n.t('form.cancel'),
+        showFooter: false,
+        secondary: null,
+
+        onClose: function () {
+          var activateHawqStandbyWizardController = router.get('activateHawqStandbyWizardController'),
+              currStep = activateHawqStandbyWizardController.get('currentStep')
+          if (parseInt(currStep) === 3) {
+            App.showConfirmationPopup(function () {
+              var controller = router.get('activateHawqStandbyWizardController');
+              router.get('updateController').set('isWorking', true);
+              activateHawqStandbyWizardController.finish();
+              App.clusterStatus.setClusterStatus({
+                clusterName: App.router.getClusterName(),
+                clusterState: 'DEFAULT',
+                localdb: App.db.data
+              }, {
+                alwaysCallback: function () {
+                  controller.get('popup').hide();
+                  router.transitionTo('main.services.index');
+                  Em.run.next(function() {
+                    location.reload();
+                  });
+                }
+              });
+            }, Em.I18n.t('admin.activateHawqStandby.closePopup'));
+          } else {
+            var controller = router.get('activateHawqStandbyWizardController');
+            router.get('updateController').set('isWorking', true);
+            activateHawqStandbyWizardController.finish();
+            App.clusterStatus.setClusterStatus({
+              clusterName: App.router.getClusterName(),
+              clusterState: 'DEFAULT',
+              localdb: App.db.data
+            }, {
+              alwaysCallback: function () {
+                controller.get('popup').hide();
+                router.transitionTo('main.services.index');
+                Em.run.next(function() {
+                  location.reload();
+                });
+              }
+            });
+          }
+        },
+        didInsertElement: function () {
+          this.fitHeight();
+        }
+      });
+      activateHawqStandbyWizardController.set('popup', popup);
+      var currentClusterStatus = App.clusterStatus.get('value');
+      if (currentClusterStatus) {
+        switch (currentClusterStatus.clusterState) {
+          case 'ACTIVATE_HAWQ_STANDBY' :
+            activateHawqStandbyWizardController.setCurrentStep(currentClusterStatus.localdb.ActivateHawqStandbyWizard.currentStep);
+            break;
+          default:
+            var currStep = App.router.get('activateHawqStandbyWizardController.currentStep');
+            activateHawqStandbyWizardController.setCurrentStep(currStep);
+            break;
+        }
+      }
+      router.transitionTo('step' + activateHawqStandbyWizardController.get('currentStep'));
+    });
+  },
+
+  step1: Em.Route.extend({
+    route: '/step1',
+    connectOutlets: function (router) {
+      var controller = router.get('activateHawqStandbyWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('1');
+        controller.connectOutlet('activateHawqStandbyWizardStep1', controller.get('content'));
+      })
+    },
+    unroutePath: function () {
+      return false;
+    },
+    next: function (router) {
+      var controller = router.get('activateHawqStandbyWizardController');
+      var hawqMaster = App.HostComponent.find().findProperty('componentName','HAWQMASTER').get('hostName');
+      var hawqStandby = App.HostComponent.find().findProperty('componentName','HAWQSTANDBY').get('hostName');
+      var hawqHosts = {
+        hawqMaster: hawqMaster,
+        hawqStandby: hawqStandby
+      };
+      controller.saveHawqHosts(hawqHosts);
+      router.transitionTo('step2');
+    }
+  }),
+
+  step2: Em.Route.extend({
+    route: '/step2',
+    connectOutlets: function (router) {
+      var controller = router.get('activateHawqStandbyWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('2');
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('activateHawqStandbyWizardStep2', controller.get('content'));
+      })
+    },
+    unroutePath: function () {
+      return false;
+    },
+    next: function (router) {
+      App.showConfirmationPopup(function() {
+        var wizardController = router.get('activateHawqStandbyWizardController');
+        var stepController = router.get('activateHawqStandbyWizardStep2Controller');
+        var configs = stepController.get('selectedService.configs');
+        wizardController.saveConfigs(configs);
+        router.transitionTo('step3');
+      }, Em.I18n.t('admin.activateHawqStandby.wizard.step2.confirmPopup.body'));
+    },
+    back: Em.Router.transitionTo('step1')
+  }),
+  step3: Em.Route.extend({
+    route: '/step3',
+    connectOutlets: function (router) {
+      var controller = router.get('activateHawqStandbyWizardController');
+      controller.dataLoading().done(function () {
+        controller.setCurrentStep('3');
+        controller.setLowerStepsDisable(3);
+        controller.loadAllPriorSteps();
+        controller.connectOutlet('activateHawqStandbyWizardStep3', controller.get('content'));
+      })
+    },
+    unroutePath: function (router, path) {
+      // allow user to leave route if wizard has finished
+      if (router.get('activateHawqStandbyWizardController').get('isFinished')) {
+        this._super(router, path);
+      } else {
+        return false;
+      }
+    },
+    next: function (router) {
+      var controller = router.get('activateHawqStandbyWizardController');
+      controller.finish();
+      App.clusterStatus.setClusterStatus({
+        clusterName: controller.get('content.cluster.name'),
+        clusterState: 'DEFAULT',
+        localdb: App.db.data
+      }, {
+        alwaysCallback: function () {
+          controller.get('popup').hide();
+          router.transitionTo('main.services.index');
+          Em.run.next(function () {
+            location.reload();
+          });
+        }
+      });
+    }
+  })
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index da1725c..f42415e7 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -751,6 +751,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
 
     addHawqStandby: require('routes/add_hawq_standby_routes'),
 
+    activateHawqStandby: require('routes/activate_hawq_standby_routes'),
+
     rollbackHighAvailability: require('routes/rollbackHA_routes')
   }),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step1.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step1.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step1.hbs
new file mode 100644
index 0000000..47f9dc2
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step1.hbs
@@ -0,0 +1,28 @@
+{{!
+* 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.activateHawqStandby.wizard.step1.header}}</h2>
+
+  <div class="alert alert-info">
+    {{t admin.activateHawqStandby.wizard.step1.body}}
+  </div>
+
+  <div class="btn-area">
+    <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} &rarr;</a>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step2.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step2.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step2.hbs
new file mode 100644
index 0000000..1e293aa
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step2.hbs
@@ -0,0 +1,53 @@
+{{!
+* 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.
+}}
+<h2>{{t admin.activateHawqStandby.wizard.step2.header}}</h2>
+
+<div class="alert alert-info">
+  {{t admin.activateHawqStandby.wizard.step2.confirm.host.body}}
+</div>
+
+<div id="activate-standby-step2-content" class="well pre-scrollable">
+    <div id="activate-standby-step2-info">
+        <table id="ha-step3-review-table">
+            <tr>
+                <td>{{t admin.activateHawqStandby.wizard.step2.hawqMaster}}</td>
+                <td>{{controller.content.hawqHosts.hawqMaster}}</td>
+		        <td><span class="to-be-disabled-red"><i class="icon-minus"></i>&nbsp;{{t admin.highAvailability.wizard.step3.toBeDeleted}}</span></td>
+            </tr>
+            <tr>
+                <td>{{t admin.activateHawqStandby.wizard.step2.hawqStandby}}</td>
+                <td>{{controller.content.hawqHosts.hawqStandby}}</td>
+                        <td><span class="to-be-installed-green"><i class="icon-arrow-up"></i>&nbsp;{{t admin.activateHawqStandby.wizard.step2.toBeActivated}}</span></td>
+            </tr>
+        </table>
+    </div>
+</div>
+
+{{#if controller.isLoaded}}
+  <div id="serviceConfig">
+    {{{t admin.activateHawqStandby.wizard.step2.confirm.config.body}}}
+    {{view App.ServiceConfigView}}
+  </div>
+{{else}}
+  {{view App.SpinnerView}}
+{{/if}}
+
+<div class="btn-area">
+    <a class="btn" {{action back}}>&larr; {{t common.back}}</a>
+    <a class="btn btn-success pull-right" {{action submit target="controller"}} {{bindAttr disabled="controller.isSubmitDisabled"}}>{{t common.next}} &rarr;</a>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step3.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step3.hbs
new file mode 100644
index 0000000..6b4923a
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/step3.hbs
@@ -0,0 +1,18 @@
+{{!
+* 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.
+}}
+{{{template "templates/common/progress"}}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/wizard.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/wizard.hbs
new file mode 100644
index 0000000..3518122
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/highAvailability/hawq/activateStandby/wizard.hbs
@@ -0,0 +1,44 @@
+{{!
+* 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 id="hawq-ha-wizard" class="wizard">
+  <div class="container">
+    <div class="container-fluid">
+      <div class="row-fluid">
+        <div class="span3">
+          <!--Sidebar content-->
+          <div class="well">
+            <ul class="nav nav-pills nav-stacked">
+              <li class="nav-header">{{t admin.activateHawqStandby.wizard.header}}</li>
+              <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}>{{t admin.activateHawqStandby.wizard.step1.header}}</a></li>
+              <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep2 target="controller"}}>{{t admin.activateHawqStandby.wizard.step2.header}}</a></li>
+              <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);"  {{action gotoStep3 target="controller"}}>{{t admin.activateHawqStandby.wizard.step3.header}}</a></li>
+            </ul>
+          </div>
+        </div>
+          <div class="wizard-content well span9">
+            {{#if view.isLoaded}}
+              {{outlet}}
+            {{else}}
+                {{view App.SpinnerView}}
+            {{/if}}
+          </div>
+      </div>
+    </div>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index 40e0678..53b66e5 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -44,6 +44,7 @@ var InitialData =  {
   'HighAvailabilityWizard': {},
   'RMHighAvailabilityWizard': {},
   'AddHawqStandbyWizard': {},
+  'ActivateHawqStandbyWizard': {},
   'RAHighAvailabilityWizard': {},
   'RollbackHighAvailabilityWizard': {},
   'MainAdminStackAndUpgrade': {},

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index f206b3b..2737425 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -156,6 +156,10 @@ require('views/main/admin/highAvailability/hawq/addStandby/step1_view');
 require('views/main/admin/highAvailability/hawq/addStandby/step2_view');
 require('views/main/admin/highAvailability/hawq/addStandby/step3_view');
 require('views/main/admin/highAvailability/hawq/addStandby/step4_view');
+require('views/main/admin/highAvailability/hawq/activateStandby/wizard_view');
+require('views/main/admin/highAvailability/hawq/activateStandby/step1_view');
+require('views/main/admin/highAvailability/hawq/activateStandby/step2_view');
+require('views/main/admin/highAvailability/hawq/activateStandby/step3_view');
 require('views/main/admin/highAvailability/rangerAdmin/wizard_view');
 require('views/main/admin/highAvailability/rangerAdmin/step1_view');
 require('views/main/admin/highAvailability/rangerAdmin/step2_view');

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step1_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step1_view.js
new file mode 100644
index 0000000..5f76565
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step1_view.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.ActivateHawqStandbyWizardStep1View = Em.View.extend({
+
+  templateName: require('templates/main/admin/highAvailability/hawq/activateStandby/step1')
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step2_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step2_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step2_view.js
new file mode 100644
index 0000000..93b11b6
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step2_view.js
@@ -0,0 +1,29 @@
+/**
+ * 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.ActivateHawqStandbyWizardStep2View = Em.View.extend({
+
+  templateName: require('templates/main/admin/highAvailability/hawq/activateStandby/step2'),
+
+  didInsertElement: function () {
+    this.get('controller').loadStep();
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step3_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step3_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step3_view.js
new file mode 100644
index 0000000..184e4b9
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/step3_view.js
@@ -0,0 +1,36 @@
+/**
+ * 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.ActivateHawqStandbyWizardStep3View = App.HighAvailabilityProgressPageView.extend({
+
+  templateName: require('templates/main/admin/highAvailability/hawq/activateStandby/step3'),
+
+  headerTitle: Em.I18n.t('admin.activateHawqStandby.wizard.step3.header'),
+
+  noticeInProgress: Em.I18n.t('admin.activateHawqStandby.wizard.step3.notice.inProgress'),
+
+  noticeCompleted: Em.I18n.t('admin.activateHawqStandby.wizard.step3.notice.completed'),
+
+  submitButtonText: Em.I18n.t('common.complete'),
+
+  labelWidth: 'span5'
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/wizard_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/wizard_view.js b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/wizard_view.js
new file mode 100644
index 0000000..068e78a
--- /dev/null
+++ b/ambari-web/app/views/main/admin/highAvailability/hawq/activateStandby/wizard_view.js
@@ -0,0 +1,74 @@
+/**
+ * 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.ActivateHawqStandbyWizardView = Em.View.extend(App.WizardMenuMixin, {
+
+  didInsertElement: function() {
+    var currentStep = this.get('controller.currentStep');
+    if (currentStep > 3) {
+      this.get('controller').setLowerStepsDisable(currentStep);
+    }
+  },
+
+  templateName: require('templates/main/admin/highAvailability/hawq/activateStandby/wizard'),
+
+  isLoaded: false,
+
+  willInsertElement: function() {
+    this.set('isLoaded', false);
+    this.loadHosts();
+  },
+
+  /**
+   * load hosts from server
+   */
+  loadHosts: function () {
+    App.ajax.send({
+      name: 'hosts.high_availability.wizard',
+      data: {},
+      sender: this,
+      success: 'loadHostsSuccessCallback',
+      error: 'loadHostsErrorCallback'
+    });
+  },
+
+  loadHostsSuccessCallback: function (data, opt, params) {
+    var hosts = {};
+
+    data.items.forEach(function (item) {
+      hosts[item.Hosts.host_name] = {
+        name: item.Hosts.host_name,
+        cpu: item.Hosts.cpu_count,
+        memory: item.Hosts.total_mem,
+        disk_info: item.Hosts.disk_info,
+        bootStatus: "REGISTERED",
+        isInstalled: true
+      };
+    });
+    App.db.setHosts(hosts);
+    this.set('controller.content.hosts', hosts);
+    this.set('isLoaded', true);
+  },
+
+  loadHostsErrorCallback: function(){
+    this.set('isLoaded', true);
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/app/views/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index 4209c32..5a09427 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -43,6 +43,7 @@ App.MainServiceItemView = Em.View.extend({
     'HBASE_MASTER': ['DECOMMISSION'],
     'KNOX_GATEWAY': ['STARTDEMOLDAP','STOPDEMOLDAP'],
     'HAWQMASTER': ['IMMEDIATE_STOP_CLUSTER'],
+    'HAWQSTANDBY': ['ACTIVATE_STANDBY'],
     'HAWQSEGMENT': ['IMMEDIATE_STOP']
   },
 
@@ -172,6 +173,7 @@ App.MainServiceItemView = Em.View.extend({
             break;
           case 'HAWQ':
             options.push(actionMap.TOGGLE_ADD_HAWQ_STANDBY);
+            options.push(actionMap.TOGGLE_ACTIVATE_HAWQ_STANDBY);
             break;
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b620a3c/ambari-web/test/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller_test.js b/ambari-web/test/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller_test.js
new file mode 100644
index 0000000..25f25cd
--- /dev/null
+++ b/ambari-web/test/controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller_test.js
@@ -0,0 +1,172 @@
+/**
+ * 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');
+require('controllers/main/admin/highAvailability/hawq/activateStandby/step2_controller');
+
+describe('App.ActivateHawqStandbyWizardStep2Controller', function () {
+
+  describe('#isSubmitDisabled', function () {
+
+    var controller = App.ActivateHawqStandbyWizardStep2Controller.create({
+        content: Em.Object.create({})
+      }),
+      cases = [
+        {
+          isLoaded: false,
+          isSubmitDisabled: true,
+          title: 'wizard step content not loaded'
+        },
+        {
+          isLoaded: true,
+          isSubmitDisabled: false,
+          title: 'wizard step content loaded'
+        }
+      ];
+
+    cases.forEach(function (item) {
+      it(item.title, function () {
+        controller.set('isLoaded', item.isLoaded);
+        expect(controller.get('isSubmitDisabled')).to.equal(item.isSubmitDisabled);
+      });
+    });
+
+  });
+
+  describe('#loadConfigTagsSuccessCallback', function () {
+
+    var controller = App.ActivateHawqStandbyWizardStep2Controller.create();
+    beforeEach(function () {
+      sinon.stub(App.ajax, 'send', Em.K);
+    });
+
+    afterEach(function () {
+      App.ajax.send.restore();
+    });
+
+    it('should send proper ajax request', function () {
+      controller.loadConfigTagsSuccessCallback({
+        'Clusters': {
+          'desired_configs': {
+            'hawq-site': {
+              'tag': 1
+            }
+          }
+        }
+      }, {}, {
+        'serviceConfig': {}
+      });
+      var data = App.ajax.send.args[0][0].data;
+      expect(data.urlParams).to.equal('(type=hawq-site&tag=1)');
+      expect(data.serviceConfig).to.eql({});
+    });
+
+  });
+
+  describe('#loadConfigsSuccessCallback', function () {
+
+    var controller = App.ActivateHawqStandbyWizardStep2Controller.create({
+        content: Em.Object.create({})
+      }),
+      cases = [
+        {
+          'items': [
+            {
+              'type': 'hawq-site',
+              'properties': {
+                'hawq_master_address_host' : 'h0',
+                'hawq_master_address_host' : 'h1'
+              }
+            }
+          ],
+          'params': {
+            'serviceConfig': {}
+          }
+        }
+      ];
+
+    beforeEach(function () {
+      sinon.stub(controller, 'setDynamicConfigValues', Em.K);
+    });
+
+    afterEach(function () {
+      controller.setDynamicConfigValues.restore();
+    });
+
+    cases.forEach(function (item) {
+      it(item.title, function () {
+        controller.loadConfigsSuccessCallback({
+          items: item.items
+        }, {}, item.params);
+        expect(controller.get('selectedService')).to.eql({});
+        expect(controller.get('isLoaded')).to.be.true;
+      });
+    });
+
+  });
+
+  describe('#loadConfigsSuccessCallback=loadConfigsErrorCallback(we have one callback for both cases)', function () {
+
+    var controller = App.ActivateHawqStandbyWizardStep2Controller.create({
+      content: Em.Object.create({})
+    });
+
+    beforeEach(function () {
+      sinon.stub(controller, 'setDynamicConfigValues', Em.K);
+    });
+
+    afterEach(function () {
+      controller.setDynamicConfigValues.restore();
+    });
+
+    it('should proceed with default value', function () {
+      controller.loadConfigsSuccessCallback({}, {}, {});
+      expect(controller.get('selectedService')).to.eql({});
+      expect(controller.get('isLoaded')).to.be.true;
+    });
+
+  });
+
+
+  describe('#setDynamicConfigValues', function () {
+
+    var controller = App.ActivateHawqStandbyWizardStep2Controller.create({
+        content: {
+          hawqHosts: {
+            hawqMaster: 'h0',
+            hawqStandby: 'h1'
+          }
+        }
+      }),
+      configs = {
+        configs: [
+          Em.Object.create({
+            name: 'hawq_master_address_host'
+          })
+        ]
+      };
+
+
+    it('hawq_master_address_host value', function () {
+      controller.setDynamicConfigValues(configs);
+      expect(configs.configs.findProperty('name', 'hawq_master_address_host').get('value')).to.equal('h1');
+      expect(configs.configs.findProperty('name', 'hawq_master_address_host').get('recommendedValue')).to.equal('h1');
+    });
+  });
+
+});


Mime
View raw message