@Override public GracefulFailoverResponseProto gracefulFailover( RpcController controller, GracefulFailoverRequestProto request) throws ServiceException { try { server.gracefulFailover(); return GracefulFailoverResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
/** * Ask the remote zkfc to cede its active status and wait for the specified * timeout before attempting to claim leader status. * @param remote node to ask * @param timeout amount of time to cede * @return the {@link ZKFCProtocol} used to talk to the ndoe * @throws IOException */ private ZKFCProtocol cedeRemoteActive(HAServiceTarget remote, int timeout) throws IOException { LOG.info("Asking " + remote + " to cede its active state for " + timeout + "ms"); ZKFCProtocol oldZkfc = remote.getZKFCProxy(conf, timeout); oldZkfc.cedeActive(timeout); return oldZkfc; }
/** * Initiate a graceful failover by talking to the target node's ZKFC. * This sends an RPC to the ZKFC, which coordinates the failover. * * @param toNode the node to fail to * @return status code (0 for success) * @throws IOException if failover does not succeed */ private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode) throws IOException { int timeout = FailoverController.getRpcTimeoutToNewActive(getConf()); ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout); try { proxy.gracefulFailover(); out.println("Failover to " + toNode + " successful"); } catch (ServiceFailedException sfe) { errOut.println("Failover failed: " + sfe.getLocalizedMessage()); return -1; } return 0; }
@Override public CedeActiveResponseProto cedeActive(RpcController controller, CedeActiveRequestProto request) throws ServiceException { try { server.cedeActive(request.getMillisToCede()); return CedeActiveResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GracefulFailoverResponseProto gracefulFailover( RpcController controller, GracefulFailoverRequestProto request) throws ServiceException { try { server.gracefulFailover(); return GracefulFailoverResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GracefulFailoverResponseProto gracefulFailover( RpcController controller, GracefulFailoverRequestProto request) throws ServiceException { try { server.gracefulFailover(); return GracefulFailoverResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public CedeActiveResponseProto cedeActive(RpcController controller, CedeActiveRequestProto request) throws ServiceException { try { server.cedeActive(request.getMillisToCede()); return CedeActiveResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GracefulFailoverResponseProto gracefulFailover( RpcController controller, GracefulFailoverRequestProto request) throws ServiceException { try { server.gracefulFailover(); return GracefulFailoverResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public CedeActiveResponseProto cedeActive(RpcController controller, CedeActiveRequestProto request) throws ServiceException { try { server.cedeActive(request.getMillisToCede()); return CedeActiveResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GracefulFailoverResponseProto gracefulFailover( RpcController controller, GracefulFailoverRequestProto request) throws ServiceException { try { server.gracefulFailover(); return GracefulFailoverResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public CedeActiveResponseProto cedeActive(RpcController controller, CedeActiveRequestProto request) throws ServiceException { try { server.cedeActive(request.getMillisToCede()); return CedeActiveResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
/** * Initiate a graceful failover by talking to the target node's ZKFC. * This sends an RPC to the ZKFC, which coordinates the failover. * * @param toNode the node to fail to * @return status code (0 for success) * @throws IOException if failover does not succeed */ private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode) throws IOException { int timeout = FailoverController.getRpcTimeoutToNewActive(getConf()); ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout); try { proxy.gracefulFailover(); out.println("Failover to " + toNode + " successful"); } catch (ServiceFailedException sfe) { errOut.println("Failover failed: " + sfe.getLocalizedMessage()); return -1; } return 0; }
@Override public CedeActiveResponseProto cedeActive(RpcController controller, CedeActiveRequestProto request) throws ServiceException { try { server.cedeActive(request.getMillisToCede()); return CedeActiveResponseProto.getDefaultInstance(); } catch (IOException e) { throw new ServiceException(e); } }
/** * Initiate a graceful failover by talking to the target node's ZKFC. * This sends an RPC to the ZKFC, which coordinates the failover. * * @param toNode the node to fail to * @return status code (0 for success) * @throws IOException if failover does not succeed */ private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode) throws IOException { int timeout = FailoverController.getRpcTimeoutToNewActive(getConf()); ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout); try { proxy.gracefulFailover(); out.println("Failover to " + toNode + " successful"); } catch (ServiceFailedException sfe) { errOut.println("Failover failed: " + sfe.getLocalizedMessage()); return -1; } return 0; }
timeout + "ms"); ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout); oldZkfc.cedeActive(timeout); oldZkfc.cedeActive(-1);
/** * Initiate a graceful failover by talking to the target node's ZKFC. * This sends an RPC to the ZKFC, which coordinates the failover. * * @param toNode the node to fail to * @return status code (0 for success) * @throws IOException if failover does not succeed */ private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode) throws IOException { int timeout = FailoverController.getRpcTimeoutToNewActive(getConf()); ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout); try { proxy.gracefulFailover(); out.println("Failover to " + toNode + " successful"); } catch (ServiceFailedException sfe) { errOut.println("Failover failed: " + sfe.getLocalizedMessage()); return -1; } return 0; }
timeout + "ms"); ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout); oldZkfc.cedeActive(timeout); oldZkfc.cedeActive(-1);
/** * Initiate a graceful failover by talking to the target node's ZKFC. * This sends an RPC to the ZKFC, which coordinates the failover. * * @param toNode the node to fail to * @return status code (0 for success) * @throws IOException if failover does not succeed */ private int gracefulFailoverThroughZKFCs(HAServiceTarget toNode) throws IOException { int timeout = FailoverController.getRpcTimeoutToNewActive(getConf()); ZKFCProtocol proxy = toNode.getZKFCProxy(getConf(), timeout); try { proxy.gracefulFailover(); out.println("Failover to " + toNode + " successful"); } catch (ServiceFailedException sfe) { errOut.println("Failover failed: " + sfe.getLocalizedMessage()); return -1; } return 0; }
timeout + "ms"); ZKFCProtocol oldZkfc = oldActive.getZKFCProxy(conf, timeout); oldZkfc.cedeActive(timeout); oldZkfc.cedeActive(-1);