Repository: ambari Updated Branches: refs/heads/branch-2.2 8c08db66c -> cee80132a
AMBARI-15784: HAWQ Resync on Standby Fails after NN HA (Lav Jain via mithmatt) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cee80132 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cee80132 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cee80132 Branch: refs/heads/branch-2.2 Commit: cee80132a6ae3ce0ec3f880e7d06bd4d45d21634 Parents: 8c08db6 Author: Matt <[email protected]> Authored: Mon Apr 11 16:54:53 2016 -0700 Committer: Matt <[email protected]> Committed: Mon Apr 11 16:54:53 2016 -0700 ---------------------------------------------------------------------- .../common-services/HAWQ/2.0.0/metainfo.xml | 16 ++++++++-------- .../HAWQ/2.0.0/package/scripts/hawqmaster.py | 4 ++++ .../HAWQ/2.0.0/package/scripts/hawqstandby.py | 13 ++++--------- ambari-web/app/models/host_component.js | 3 ++- ambari-web/app/views/main/service/item.js | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/cee80132/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 e35b7d8..e9faab1 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 @@ -71,6 +71,14 @@ <timeout>1200</timeout> </commandScript> </customCommand> + <customCommand> + <name>RESYNC_HAWQ_STANDBY</name> + <commandScript> + <script>scripts/hawqmaster.py</script> + <scriptType>PYTHON</scriptType> + <timeout>1200</timeout> + </commandScript> + </customCommand> </customCommands> <dependencies> <dependency> @@ -110,14 +118,6 @@ <timeout>1200</timeout> </commandScript> </customCommand> - <customCommand> - <name>RESYNC_HAWQ_STANDBY</name> - <commandScript> - <script>scripts/hawqstandby.py</script> - <scriptType>PYTHON</scriptType> - <timeout>1200</timeout> - </commandScript> - </customCommand> </customCommands> <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/ambari/blob/cee80132/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py index c00b101..2432df6 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqmaster.py @@ -86,6 +86,10 @@ class HawqMaster(Script): user=hawq_constants.hawq_user, timeout=hawq_constants.default_exec_timeout) + def resync_hawq_standby(self,env): + Logger.info("HAWQ Standby Master Re-Sync started in fast mode...") + utils.exec_hawq_operation(hawq_constants.INIT, "{0} -n -a -v -M {1}".format(hawq_constants.STANDBY, hawq_constants.FAST)) + def remove_hawq_standby(self, env): Logger.info("Removing HAWQ Standby Master ...") utils.exec_hawq_operation(hawq_constants.INIT, "{0} -a -v -r".format(hawq_constants.STANDBY)) http://git-wip-us.apache.org/repos/asf/ambari/blob/cee80132/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 6402230..c38e0de 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 @@ -16,13 +16,14 @@ 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. """ + from resource_management import Script -from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.core.logger import Logger +from resource_management.libraries.functions.check_process_status import check_process_status -import master_helper import common import hawq_constants +import master_helper class HawqStandby(Script): """ @@ -56,14 +57,8 @@ class HawqStandby(Script): def activate_hawq_standby(self, env): import utils + Logger.info("Activating HAWQ standby...") utils.exec_hawq_operation(hawq_constants.ACTIVATE, "{0} -a -M {1} -v --ignore-bad-hosts".format(hawq_constants.STANDBY, hawq_constants.FAST)) - def resync_hawq_standby(self,env): - import params - import utils - Logger.info("HAWQ Standby Master Re-Sync started in fast mode ...") - utils.exec_hawq_operation(hawq_constants.INIT, "{0} -n -a -v -M {1}".format(hawq_constants.STANDBY, hawq_constants.FAST)) - Logger.info("HAWQ Standby host {0} Re-Sync successful".format(params.hostname)) - if __name__ == "__main__": HawqStandby().execute() http://git-wip-us.apache.org/repos/asf/ambari/blob/cee80132/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 5e070ec..9da327e 100644 --- a/ambari-web/app/models/host_component.js +++ b/ambari-web/app/models/host_component.js @@ -259,6 +259,7 @@ App.HostComponentActionMap = { var HM = ctx.get('controller.content.hostComponents').findProperty('componentName', 'HAWQMASTER'); var HS = ctx.get('controller.content.hostComponents').findProperty('componentName', 'HAWQSTANDBY'); var HMComponent = App.MasterComponent.find('HAWQMASTER'); + var HSComponent = App.MasterComponent.find('HAWQSTANDBY'); return { RESTART_ALL: { action: 'restartAllHostComponents', @@ -382,7 +383,7 @@ App.HostComponentActionMap = { label: Em.I18n.t('services.service.actions.run.resyncHawqStandby.label'), cssClass: 'icon-refresh', isHidden : App.get('isSingleNode') || !HS , - disabled: !((!!HMComponent && HMComponent.get('startedCount') === 1) && (!!HS && HS.get('workStatus') === App.HostComponentStatus.started)) + disabled: !((!!HMComponent && HMComponent.get('startedCount') === 1) && (!!HSComponent && HSComponent.get('startedCount') === 1)) }, TOGGLE_ADD_HAWQ_STANDBY: { action: 'addHawqStandby', http://git-wip-us.apache.org/repos/asf/ambari/blob/cee80132/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 5d82fb9..ff1e03c 100644 --- a/ambari-web/app/views/main/service/item.js +++ b/ambari-web/app/views/main/service/item.js @@ -42,9 +42,9 @@ App.MainServiceItemView = Em.View.extend({ 'RESOURCEMANAGER': ['DECOMMISSION', 'REFRESHQUEUES'], 'HBASE_MASTER': ['DECOMMISSION'], 'KNOX_GATEWAY': ['STARTDEMOLDAP','STOPDEMOLDAP'], - 'HAWQMASTER': ['IMMEDIATE_STOP_HAWQ_SERVICE', 'RUN_HAWQ_CHECK', 'HAWQ_CLEAR_CACHE', 'REMOVE_HAWQ_STANDBY'], + 'HAWQMASTER': ['IMMEDIATE_STOP_HAWQ_SERVICE', 'RUN_HAWQ_CHECK', 'HAWQ_CLEAR_CACHE', 'REMOVE_HAWQ_STANDBY', 'RESYNC_HAWQ_STANDBY'], 'HAWQSEGMENT': ['IMMEDIATE_STOP_HAWQ_SEGMENT'], - 'HAWQSTANDBY' : ['RESYNC_HAWQ_STANDBY','ACTIVATE_HAWQ_STANDBY'] + 'HAWQSTANDBY' : ['ACTIVATE_HAWQ_STANDBY'] }, addActionMap: function() {
