Kaynağa Gözat

AMBARI-15784: HAWQ Resync on Standby Fails after NN HA (Lav Jain via mithmatt)

Matt 9 yıl önce
ebeveyn
işleme
7603656472

+ 8 - 8
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>

+ 4 - 0
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))

+ 4 - 9
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("Re-synchronizing HAWQ Standby..")
-    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()

+ 2 - 1
ambari-web/app/models/host_component.js

@@ -276,6 +276,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',
@@ -413,7 +414,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',

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

@@ -37,9 +37,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'],
     'HIVE_SERVER_INTERACTIVE' : ["RESTART_LLAP"]
   },