当前位置: 首页 > news >正文

wordpress网站数据备份网站开发的产品用什么形容词形容

wordpress网站数据备份,网站开发的产品用什么形容词形容,高端饰品品牌有哪些,西宁建设局官方网站一、IPing机制 IPing是一个主动探测服务节点存活的机制#xff0c;通过判断服务节点的当前状态#xff0c;设置节点的可用状态。只有当节点为可用时候才会作为负载均衡器的选取节点。 IPing有以下几种模式: DummyPing#xff1a;默认返回true#xff0c;即认为所有节点都…一、IPing机制 IPing是一个主动探测服务节点存活的机制通过判断服务节点的当前状态设置节点的可用状态。只有当节点为可用时候才会作为负载均衡器的选取节点。 IPing有以下几种模式: DummyPing默认返回true即认为所有节点都可用这也是单独使用Ribbon时的默认模式NIWSDiscoveryPing借助Eureka服务发现机制获取节点状态。节点状态是UP则认为是可用状态PingUrl主动向服务节点发起一次http调用对方有响应则认为节点是可用状态NoOpPing返回truePingConstant返回设置的常量值二、IPing配置 1application.yaml配置 #单个服务设置 [service-name]: ribbon: NFLoadBalancerPingClassName: com.netflix.loadbalancer.DummyPing 2代码配置 public class MicroRibbonConfig {Beanpublic IPing microIPing(){return new DummyPing();} }RibbonClient(name micro-service, configuration MicroRibbonConfig.class) public class RibbonClientConfig {} 三、IPing模式实现 1DummyPing public class DummyPing extends AbstractLoadBalancerPing {public DummyPing() {}public boolean isAlive(Server server) {return true;}Overridepublic void initWithNiwsConfig(IClientConfig clientConfig) {} }public abstract class AbstractLoadBalancerPing implements IPing, IClientConfigAware{AbstractLoadBalancer lb;Overridepublic boolean isAlive(Server server) {return true;}public void setLoadBalancer(AbstractLoadBalancer lb){this.lb lb;}public AbstractLoadBalancer getLoadBalancer(){return lb;}} 2PingUrl public class PingUrl implements IPing {private static final Logger LOGGER LoggerFactory.getLogger(PingUrl.class);String pingAppendString ;boolean isSecure false;String expectedContent null;/*** Send one ping only.** Well, send what you need to determine whether or not the* server is still alive. Should return within a reasonable* time.*/public PingUrl() {}public PingUrl(boolean isSecure, String pingAppendString) {this.isSecure isSecure;this.pingAppendString (pingAppendString ! null) ? pingAppendString : ;}public void setPingAppendString(String pingAppendString) {this.pingAppendString (pingAppendString ! null) ? pingAppendString : ;}public String getPingAppendString() {return pingAppendString;}public boolean isSecure() {return isSecure;}/*** Should the Secure protocol be used to Ping* param isSecure*/public void setSecure(boolean isSecure) {this.isSecure isSecure;}public String getExpectedContent() {return expectedContent;}/*** Is there a particular content you are hoping to see?* If so -set this here.* for e.g. the WCS server sets the content body to be true* Please be advised that this content should match the actual * content exactly for this to work. Else yo may get false status.* param expectedContent*/public void setExpectedContent(String expectedContent) {this.expectedContent expectedContent;}public boolean isAlive(Server server) {String urlStr ;if (isSecure){urlStr https://;}else{urlStr http://;}urlStr server.getId();urlStr getPingAppendString();boolean isAlive false;HttpClient httpClient new DefaultHttpClient();HttpUriRequest getRequest new HttpGet(urlStr);String contentnull;try {HttpResponse response httpClient.execute(getRequest);content EntityUtils.toString(response.getEntity());isAlive (response.getStatusLine().getStatusCode() 200);if (getExpectedContent()!null){LOGGER.debug(content: content);if (content null){isAlive false;}else{if (content.equals(getExpectedContent())){isAlive true;}else{isAlive false;}}}} catch (IOException e) {e.printStackTrace();}finally{// Release the connection.getRequest.abort();}return isAlive;}public static void main(String[] args){PingUrl p new PingUrl(false,/cs/hostRunning);p.setExpectedContent(true);Server s new Server(ec2-75-101-231-85.compute-1.amazonaws.com, 7101);boolean isAlive p.isAlive(s);System.out.println(isAlive: isAlive);} } 3PingConstant  public class PingConstant implements IPing {boolean constant true;public void setConstant(String constantStr) {constant (constantStr ! null) (constantStr.toLowerCase().equals(true));}public void setConstant(boolean constant) {this.constant constant;}public boolean getConstant() {return constant;}public boolean isAlive(Server server) {return constant;} }4NoOpPing public class NoOpPing implements IPing {Overridepublic boolean isAlive(Server server) {return true;}}
http://www.pierceye.com/news/809163/

相关文章:

  • 个人网站怎么建立深圳网站建站费用
  • 笔趣阁建站教程网页设计 网站建设啥意思
  • 海门网站开发西安响应式网站建设服务提供商
  • 自适应网站建站哈尔滨市建设安全监察网站
  • nas服务器可以做网站吗电商类网站开发方案
  • 免费的个人的网站网站建设 考虑
  • 医院网站建设的目的高端网站有哪些优势
  • 佛山网站建设首选如何备份wordpress
  • 优化稳定网站排名网站建设需要学什么语言
  • 可以做设计私单的网站硬件开发工程师面试
  • 竞价网站单页网页设计师中级证书有用吗
  • 做网站 简单外包wordpress 插件api
  • 白城网站seo新手怎么建立自己网站
  • 建立用模板建立网站wordpress feed
  • 株洲品牌网站建设优质的杭州网站优化
  • 网站开发在哪个科目核算网站平台怎么做的好处
  • 网站底部模板代码江苏建站系统
  • 写出网站开发的基本流程品牌建设网站
  • 河北省建设机械协会网站双减之下托管班合法吗
  • 江门市城乡建设局网站阿里云万网域名购买
  • 网站推广技术哪家好专业网站开发建设
  • 义乌营销型网站建设淘宝做动图网站
  • dedecms能做什么网站素材网站怎么做
  • 一流导航设计网站wordpress 七牛 插件
  • 新开元电销系统济南网站优化技术厂家
  • 有名的网站建设wordpress安装到主机
  • 网站建设的指导思想p2p金融网站建设
  • 可在哪些网站做链接郑州展厅设计公司
  • 怎么可以黑网站域名做网页的心得体会
  • 设计素材免费下载网站做广告牌子