/** * Ensure that we are allowed to manually manage the HA state of the target * service. If automatic failover is configured, then the automatic * failover controllers should be doing state management, and it is generally * an error to use the HAAdmin command line to do so. * * @param target the target to check * @return true if manual state management is allowed */ private boolean checkManualStateManagementOK(HAServiceTarget target) { if (target.isAutoFailoverEnabled()) { if (requestSource != RequestSource.REQUEST_BY_USER_FORCED) { errOut.println( "Automatic failover is enabled for " + target + "\n" + "Refusing to manually manage HA state, since it may cause\n" + "a split-brain scenario or other incorrect state.\n" + "If you are very sure you know what you are doing, please \n" + "specify the --" + FORCEMANUAL + " flag."); return false; } else { LOG.warn("Proceeding with manual HA state management even though\n" + "automatic failover is enabled for " + target); return true; } } return true; }
public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.error("Automatic failover is not enabled for " + localTarget + "." + " Please ensure that automatic failover is enabled in the " + "configuration before running the ZK failover controller."); return ERR_CODE_AUTO_FAILOVER_NOT_ENABLED; } loginAsFCUser(); try { return SecurityUtil.doAsLoginUserOrFatal(new PrivilegedAction<Integer>() { @Override public Integer run() { try { return doRun(args); } catch (Exception t) { throw new RuntimeException(t); } finally { if (elector != null) { elector.terminateConnection(); } } } }); } catch (RuntimeException rte) { throw (Exception)rte.getCause(); } }
fromNode.isAutoFailoverEnabled() == toNode.isAutoFailoverEnabled(), "Inconsistent auto-failover configs between %s and %s!", fromNode, toNode); if (fromNode.isAutoFailoverEnabled()) { if (forceFence || forceActive) {
/** * Ensure that we are allowed to manually manage the HA state of the target * service. If automatic failover is configured, then the automatic * failover controllers should be doing state management, and it is generally * an error to use the HAAdmin command line to do so. * * @param target the target to check * @return true if manual state management is allowed */ private boolean checkManualStateManagementOK(HAServiceTarget target) { if (target.isAutoFailoverEnabled()) { if (requestSource != RequestSource.REQUEST_BY_USER_FORCED) { errOut.println( "Automatic failover is enabled for " + target + "\n" + "Refusing to manually manage HA state, since it may cause\n" + "a split-brain scenario or other incorrect state.\n" + "If you are very sure you know what you are doing, please \n" + "specify the --" + FORCEMANUAL + " flag."); return false; } else { LOG.warn("Proceeding with manual HA state management even though\n" + "automatic failover is enabled for " + target); return true; } } return true; }
/** * Ensure that we are allowed to manually manage the HA state of the target * service. If automatic failover is configured, then the automatic * failover controllers should be doing state management, and it is generally * an error to use the HAAdmin command line to do so. * * @param target the target to check * @return true if manual state management is allowed */ private boolean checkManualStateManagementOK(HAServiceTarget target) { if (target.isAutoFailoverEnabled()) { if (requestSource != RequestSource.REQUEST_BY_USER_FORCED) { errOut.println( "Automatic failover is enabled for " + target + "\n" + "Refusing to manually manage HA state, since it may cause\n" + "a split-brain scenario or other incorrect state.\n" + "If you are very sure you know what you are doing, please \n" + "specify the --" + FORCEMANUAL + " flag."); return false; } else { LOG.warn("Proceeding with manual HA state management even though\n" + "automatic failover is enabled for " + target); return true; } } return true; }
/** * Ensure that we are allowed to manually manage the HA state of the target * service. If automatic failover is configured, then the automatic * failover controllers should be doing state management, and it is generally * an error to use the HAAdmin command line to do so. * * @param target the target to check * @return true if manual state management is allowed */ private boolean checkManualStateManagementOK(HAServiceTarget target) { if (target.isAutoFailoverEnabled()) { if (requestSource != RequestSource.REQUEST_BY_USER_FORCED) { errOut.println( "Automatic failover is enabled for " + target + "\n" + "Refusing to manually manage HA state, since it may cause\n" + "a split-brain scenario or other incorrect state.\n" + "If you are very sure you know what you are doing, please \n" + "specify the --" + FORCEMANUAL + " flag."); return false; } else { LOG.warn("Proceeding with manual HA state management even though\n" + "automatic failover is enabled for " + target); return true; } } return true; }
/** * Ensure that we are allowed to manually manage the HA state of the target * service. If automatic failover is configured, then the automatic * failover controllers should be doing state management, and it is generally * an error to use the HAAdmin command line to do so. * * @param target the target to check * @return true if manual state management is allowed */ private boolean checkManualStateManagementOK(HAServiceTarget target) { if (target.isAutoFailoverEnabled()) { if (requestSource != RequestSource.REQUEST_BY_USER_FORCED) { errOut.println( "Automatic failover is enabled for " + target + "\n" + "Refusing to manually manage HA state, since it may cause\n" + "a split-brain scenario or other incorrect state.\n" + "If you are very sure you know what you are doing, please \n" + "specify the --" + FORCEMANUAL + " flag."); return false; } else { LOG.warn("Proceeding with manual HA state management even though\n" + "automatic failover is enabled for " + target); return true; } } return true; }
public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.fatal("Automatic failover is not enabled for " + localTarget + "." + " Please ensure that automatic failover is enabled in the " + "configuration before running the ZK failover controller."); return ERR_CODE_AUTO_FAILOVER_NOT_ENABLED; } loginAsFCUser(); try { return SecurityUtil.doAsLoginUserOrFatal(new PrivilegedAction<Integer>() { @Override public Integer run() { try { return doRun(args); } catch (Exception t) { throw new RuntimeException(t); } finally { if (elector != null) { elector.terminateConnection(); } } } }); } catch (RuntimeException rte) { LOG.fatal("The failover controller encounters runtime error: " + rte); throw (Exception)rte.getCause(); } }
public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.fatal("Automatic failover is not enabled for " + localTarget + "." + " Please ensure that automatic failover is enabled in the " + "configuration before running the ZK failover controller."); return ERR_CODE_AUTO_FAILOVER_NOT_ENABLED; } loginAsFCUser(); try { return SecurityUtil.doAsLoginUserOrFatal(new PrivilegedAction<Integer>() { @Override public Integer run() { try { return doRun(args); } catch (Exception t) { throw new RuntimeException(t); } finally { if (elector != null) { elector.terminateConnection(); } } } }); } catch (RuntimeException rte) { throw (Exception)rte.getCause(); } }
public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.fatal("Automatic failover is not enabled for " + localTarget + "." + " Please ensure that automatic failover is enabled in the " + "configuration before running the ZK failover controller."); return ERR_CODE_AUTO_FAILOVER_NOT_ENABLED; } loginAsFCUser(); try { return SecurityUtil.doAsLoginUserOrFatal(new PrivilegedAction<Integer>() { @Override public Integer run() { try { return doRun(args); } catch (Exception t) { throw new RuntimeException(t); } finally { if (elector != null) { elector.terminateConnection(); } } } }); } catch (RuntimeException rte) { throw (Exception)rte.getCause(); } }
public int run(final String[] args) throws Exception { if (!localTarget.isAutoFailoverEnabled()) { LOG.fatal("Automatic failover is not enabled for " + localTarget + "." + " Please ensure that automatic failover is enabled in the " + "configuration before running the ZK failover controller."); return ERR_CODE_AUTO_FAILOVER_NOT_ENABLED; } loginAsFCUser(); try { return SecurityUtil.doAsLoginUserOrFatal(new PrivilegedAction<Integer>() { @Override public Integer run() { try { return doRun(args); } catch (Exception t) { throw new RuntimeException(t); } finally { if (elector != null) { elector.terminateConnection(); } } } }); } catch (RuntimeException rte) { throw (Exception)rte.getCause(); } }
fromNode.isAutoFailoverEnabled() == toNode.isAutoFailoverEnabled(), "Inconsistent auto-failover configs between %s and %s!", fromNode, toNode); if (fromNode.isAutoFailoverEnabled()) { if (forceFence || forceActive) {
fromNode.isAutoFailoverEnabled() == toNode.isAutoFailoverEnabled(), "Inconsistent auto-failover configs between %s and %s!", fromNode, toNode); if (fromNode.isAutoFailoverEnabled()) { if (forceFence || forceActive) {
fromNode.isAutoFailoverEnabled() == toNode.isAutoFailoverEnabled(), "Inconsistent auto-failover configs between %s and %s!", fromNode, toNode); if (fromNode.isAutoFailoverEnabled()) { if (forceFence || forceActive) {
fromNode.isAutoFailoverEnabled() == toNode.isAutoFailoverEnabled(), "Inconsistent auto-failover configs between %s and %s!", fromNode, toNode); if (fromNode.isAutoFailoverEnabled()) { if (forceFence || forceActive) {