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

网站建立的优劣势seo海外运营

网站建立的优劣势,seo海外运营,网络服务示范区创建情况,成立软件公司文章目录 1. 探针集成实现高可用1.1 LivenessProbe1.2 ReadinessProbe1.3 StartupProbe 2. 健康检查看板2.1 组件包 1. 探针集成实现高可用 LivenessReadinessStartup 1.1 LivenessProbe 判断服务是否存活结束“非存活”状态服务根据重启策略决定是否重启服务 1.2 Readines… 文章目录 1. 探针集成实现高可用1.1 LivenessProbe1.2 ReadinessProbe1.3 StartupProbe 2. 健康检查看板2.1 组件包 1. 探针集成实现高可用 LivenessReadinessStartup 1.1 LivenessProbe 判断服务是否存活结束“非存活”状态服务根据重启策略决定是否重启服务 1.2 ReadinessProbe 判断服务是否“就绪”“就绪”状态的服务可以接收请求非“就绪”状态的服务将会被从流量负载中摘除 1.3 StartupProbe 检测应用程序是否启动成功启动探针执行成功后将不再执行除非应用重启当启动探针检测成功后其它探针才开始工作适合启动较慢的应用配置Kuberbetes 1.16以后的支持 // startup internal static bool Ready { get; set; } true; internal static bool Live { get; set; } true;public void ConfigureServices(IServiceCollection services) {...// 注册健康检查services.AddHealthChecks().AddMySql(Configuration.GetValuestring(Mysql), mysql, tags: new string[] { mysql, live, all })// tags标签分组.AddRabbitMQ(s {var connectionFactory new RabbitMQ.Client.ConnectionFactory();Configuration.GetSection(RabbitMQ).Bind(connectionFactory);return connectionFactory;}, rabbitmq, tags: new string[] { rabbitmq, live, all }).AddCheck(liveChecker, () {return Live ? HealthCheckResult.Healthy() : HealthCheckResult.Unhealthy();}, new string[] { live, all }).AddCheck(readyChecker, () {return Ready ? HealthCheckResult.Healthy() : HealthCheckResult.Unhealthy();}, new string[] { ready, all }); }// public void Configure(IApplicationBuilder app, IWebHostEnvironment env){...app.UseEndpoints(endpoints {endpoints.MapMetrics();endpoints.MapHealthChecks(/live, new HealthCheckOptions { Predicate registration registration.Tags.Contains(live) });// 检查标记了live的检查项endpoints.MapHealthChecks(/ready, new HealthCheckOptions { Predicate registration registration.Tags.Contains(ready) });endpoints.MapHealthChecks(/hc, new Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions{ResponseWriter HealthChecks.UI.Client.UIResponseWriter.WriteHealthCheckUIResponse});// 没有传检查项检查所有endpoints.MapControllers();endpoints.MapGrpcServiceGeekTime.Ordering.API.Grpc.OrderServiceImpl();});}// Controller调用// 设置Ready的值[HttpGet]public IActionResult SetReady([FromQuery]bool ready){Startup.Ready ready;if (!ready){Task.Run(async () {await Task.Delay(60000);Startup.Ready true;});}return Content(${Environment.MachineName} : Ready{Startup.Ready});}// 设置live [HttpGet] public IActionResult SetLive([FromQuery]bool live){Startup.Live live;return Content(${Environment.MachineName} : Live{Startup.Live});}// 程序退出 [HttpGet] public IActionResult Exit([FromServices]IHostApplicationLifetime application){Task.Run(async () {await Task.Delay(3000);application.StopApplication();});return Content(${Environment.MachineName} : Stopping);}2. 健康检查看板 AspNetCore.Diagnostics.HealthCheck项目开源社区项目插件 2.1 组件包 探针检测端AspNetCore.HealthChecks.UI应用端输出AspNetCore.HealthChecks.UI.Client应用端检查项AspNetCore.HealthChecks.Xxx // startup public void ConfigureServices(IServiceCollection services) {services.AddMvc();services.AddHealthChecks();services.AddHealthChecksUI();}public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {if (env.IsDevelopment()){app.UseDeveloperExceptionPage();}app.UseRouting();app.UseEndpoints(endpoints {endpoints.MapHealthChecks(/live);endpoints.MapHealthChecks(/ready);endpoints.MapHealthChecks(/hc);endpoints.MapMetrics();endpoints.MapHealthChecksUI();// 使得dashboard生效endpoints.MapControllers();});}// 配置文件配置需要检查的项目 HealthChecksUI: {HealthChecks: [{Name: geektime-ordering-api,Uri: http://geektime-ordering-api/hc},{Name: geektime-mobile-apiaggregator,Uri: http://geektime-mobile-apiaggregator/hc},{Name: geektime-mobile-gateway,Uri: http://geektime-mobile-gateway/hc}],
http://www.w-s-a.com/news/821136/

相关文章:

  • 买空间哪个网站好做我的世界背景图的网站
  • 南京哪里做网站wordpress 增加子目录
  • 刚做的网站搜全名查不到网站很难被百度收录
  • 网站建设与管理期末做网站买空间用共享ip
  • 网络合同怎么签有效南京seo公司哪家
  • 厦门建设网官方网站上海网络网站建
  • 网站制作西安郑州网站建设动态
  • 外贸网站免费推广温州做网站技术员
  • 武冈 网站建设做网站能收回吗
  • 网站做前端把网站扒下来以后怎么做
  • 网站模板素材下载手机做任务佣金的网站
  • 机关网站建设考核测评总结做网站sqlserver排序
  • 凉山州建设厅官方网站html5下载教程
  • 内网网站建设方面政策id97网站怎么做的
  • 福州企业建站系统七米网站建设
  • 长春seo建站北京做机床的公司网站
  • 网站维护具体做啥如何开发wap网站
  • 公司网站设计费计入什么科目潍坊公司网站制作
  • 拖拽式网站开发模具钢东莞网站建设
  • 彩票娱乐网站建设模块化网站开发
  • 孝感网站设计用自己的名字设计头像
  • 高明网站建设哪家好深圳vi设计公司全力设计
  • 工程技术cpu游戏优化加速软件
  • 一起做网店网站入驻收费wordpress 自定义评论样式
  • 深圳高端网站建设公司排名app软件开发sh365
  • 泰州网站整站优化惠州做网站多少钱
  • 做博客网站的php代码一建论坛建工教育网
  • 邢台网站制作费用单页营销网站后台
  • 红色网站建设的比较好的高校用vs2010做购物网站
  • 网站域名备案号查询网页设计实验报告总结模板