(125条消息) 服务器consul与本地服务健康检查不通问题解决_向往鸟的博客-CSDN博客_consul健康检查失败
.MathJax, .MathJax_Message, .MathJax_Preview { display: none }
.hljs-ln { border-collapse: collapse }
.hljs-ln td { padding: 0 }
.hljs-ln-n { text-align: right; padding-right: 8px }
.hljs-ln-n:before { content: attr(data-line-number) }
pre { position: relative }
pre:hover .code-full-screen { display: none !important }
.code-full-screen { display: none !important; position: absolute; right: 4px; top: 3px; width: 24px !important; height: 24px !important; margin: 4px !important }
pre:hover .hljs-button { display: block }
.hljs-button { display: none; position: absolute; right: 4px; top: 4px; font-size: 12px; color: rgba(255, 255, 255, 1); background-color: rgba(153, 153, 170, 1); padding: 2px 8px; margin: 8px; border-radius: 4px; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05) }
.hljs-button:after { content: attr(data-title) }
code .hljs-button { margin: 2px 8px }
.MathJax_Hover_Frame { border-radius: 0.25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0 0 15px rgba(136, 51, 170, 1); -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; display: inline-block; position: absolute }
.MathJax_Menu_Button .MathJax_Hover_Arrow { position: absolute; cursor: pointer; display: inline-block; border: 2px solid rgba(170, 170, 170, 1); border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px; font-family: "Courier New", Courier; font-size: 9px; color: rgba(240, 240, 240, 1) }
.MathJax_Menu_Button .MathJax_Hover_Arrow span { display: block; background-color: rgba(170, 170, 170, 1); border: 1px solid; border-radius: 3px; line-height: 0; padding: 4px }
.MathJax_Hover_Arrow:hover { color: rgba(255, 255, 255, 1) !important; border: 2px solid rgba(204, 204, 204, 1) !important }
.MathJax_Hover_Arrow:hover span { background-color: rgba(204, 204, 204, 1) !important }
#MathJax_About { position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: rgba(221, 221, 221, 1); color: rgba(0, 0, 0, 1); cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0 10px 20px rgba(128, 128, 128, 1); -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true') }
#MathJax_About.MathJax_MousePost { outline: none }
.MathJax_Menu { position: absolute; background-color: rgba(255, 255, 255, 1); color: rgba(0, 0, 0, 1); width: auto; padding: 2px; border: 1px solid rgba(204, 204, 204, 1); margin: 0; cursor: default; font: / normal menu; text-align: left; text-indent: 0; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; box-shadow: 0 10px 20px rgba(128, 128, 128, 1); -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true') }
.MathJax_MenuItem { padding: 2px 2em; background: rgba(0, 0, 0, 0) }
.MathJax_MenuArrow { position: absolute; right: 0.5em; padding-top: 0.25em; color: rgba(102, 102, 102, 1); font-size: 0.75em }
.MathJax_MenuActive .MathJax_MenuArrow { color: rgba(255, 255, 255, 1) }
.MathJax_MenuArrow.RTL { left: 0.5em; right: auto }
.MathJax_MenuCheck { position: absolute; left: 0.7em }
.MathJax_MenuCheck.RTL { right: 0.7em; left: auto }
.MathJax_MenuRadioCheck { position: absolute; left: 1em }
.MathJax_MenuRadioCheck.RTL { right: 1em; left: auto }
.MathJax_MenuLabel { padding: 2px 2em 4px 1.33em; font-style: italic }
.MathJax_MenuRule { border-top: 1px solid rgba(204, 204, 204, 1); margin: 4px 1px 0 }
.MathJax_MenuDisabled { color: rgba(128, 128, 128, 1) }
.MathJax_MenuActive { background-color: rgba(181, 213, 255, 1); color: rgba(0, 0, 0, 1) }
.MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus { background-color: rgba(232, 232, 232, 1) }
.MathJax_ContextMenu:focus { outline: none }
.MathJax_ContextMenu .MathJax_MenuItem:focus { outline: none }
#MathJax_AboutClose { top: 0.2em; right: 0.2em }
.MathJax_Menu .MathJax_MenuClose { top: -10px; left: -10px }
.MathJax_MenuClose { position: absolute; cursor: pointer; display: inline-block; border: 2px solid rgba(170, 170, 170, 1); border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; font-family: "Courier New", Courier; font-size: 24px; color: rgba(240, 240, 240, 1) }
.MathJax_MenuClose span { display: block; background-color: rgba(170, 170, 170, 1); border: 1.5px solid; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; line-height: 0; padding: 8px 0 6px }
.MathJax_MenuClose:hover { color: rgba(255, 255, 255, 1) !important; border: 2px solid rgba(204, 204, 204, 1) !important }
.MathJax_MenuClose:hover span { background-color: rgba(204, 204, 204, 1) !important }
.MathJax_MenuClose:hover:focus { outline: none }
.MathJax_Preview .MJXf-math { color: inherit !important }
.MJX_Assistive_MathML { position: absolute !important; top: 0; left: 0; clip: rect(1px, 1px, 1px, 1px); padding: 1px 0 0 !important; border: 0 !important; height: 1px !important; width: 1px !important; overflow: hidden !important; display: block !important; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none }
.MJX_Assistive_MathML.MJX_Assistive_MathML_Block { width: 100% !important }
#MathJax_Zoom { position: absolute; background-color: rgba(240, 240, 240, 1); overflow: auto; display: block; z-index: 301; padding: 0.5em; border: 1px solid rgba(0, 0, 0, 1); margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; box-shadow: 5px 5px 15px rgba(170, 170, 170, 1); -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true') }
#MathJax_ZoomOverlay { position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: rgba(255, 255, 255, 1); opacity: 0; filter: alpha(opacity=0) }
#MathJax_ZoomFrame { position: relative; display: inline-block; height: 0; width: 0 }
#MathJax_ZoomEventTrap { position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: rgba(255, 255, 255, 1); opacity: 0; filter: alpha(opacity=0) }
.MathJax_Preview { color: rgba(136, 136, 136, 1) }
#MathJax_Message { position: fixed; left: 1em; bottom: 1.5em; background-color: rgba(230, 230, 230, 1); border: 1px solid rgba(149, 149, 149, 1); margin: 0; padding: 2px 8px; z-index: 102; color: rgba(0, 0, 0, 1); font-size: 80%; width: auto; white-space: nowrap }
#MathJax_MSIE_Frame { position: absolute; top: 0; left: 0; width: 0; z-index: 101; border: 0; margin: 0; padding: 0 }
.MathJax_Error { color: rgba(204, 0, 0, 1); font-style: italic }
.MJXp-script { font-size: 0.8em }
.MJXp-right { -webkit-transform-origin: right; -moz-transform-origin: right; -ms-transform-origin: right; -o-transform-origin: right; transform-origin: right }
.MJXp-bold { font-weight: bold }
.MJXp-italic { font-style: italic }
.MJXp-scr { font-family: MathJax_Script, "Times New Roman", Times, STIXGeneral, serif }
.MJXp-frak { font-family: MathJax_Fraktur, "Times New Roman", Times, STIXGeneral, serif }
.MJXp-sf { font-family: MathJax_SansSerif, "Times New Roman", Times, STIXGeneral, serif }
.MJXp-cal { font-family: MathJax_Caligraphic, "Times New Roman", Times, STIXGeneral, serif }
.MJXp-mono { font-family: MathJax_Typewriter, "Times New Roman", Times, STIXGeneral, serif }
.MJXp-largeop { font-size: 150% }
.MJXp-largeop.MJXp-int { vertical-align: -0.2em }
.MJXp-math { display: inline-block; line-height: 1.2; text-indent: 0; font-family: "Times New Roman", Times, STIXGeneral, serif; white-space: nowrap; border-collapse: collapse }
.MJXp-display { display: block; text-align: center; margin: 1em 0 }
.MJXp-math span { display: inline-block }
.MJXp-box { display: block !important; text-align: center }
.MJXp-box:after { content: " " }
.MJXp-rule { display: block !important; margin-top: 0.1em }
.MJXp-char { display: block !important }
.MJXp-mo { margin: 0 0.15em }
.MJXp-mfrac { margin: 0 0.125em; vertical-align: 0.25em }
.MJXp-denom { display: inline-table !important; width: 100% }
.MJXp-denom>* { display: table-row !important }
.MJXp-surd { vertical-align: top }
.MJXp-surd>* { display: block !important }
.MJXp-script-box>* { display: table !important; height: 50% }
.MJXp-script-box>*>* { display: table-cell !important; vertical-align: top }
.MJXp-script-box>*:last-child>* { vertical-align: bottom }
.MJXp-script-box>*>*>* { display: block !important }
.MJXp-mphantom { visibility: hidden }
.MJXp-munderover { display: inline-table !important }
.MJXp-over { display: inline-block !important; text-align: center }
.MJXp-over>* { display: block !important }
.MJXp-munderover>* { display: table-row !important }
.MJXp-mtable { vertical-align: 0.25em; margin: 0 0.125em }
.MJXp-mtable>* { display: inline-table !important; vertical-align: middle }
.MJXp-mtr { display: table-row !important }
.MJXp-mtd { display: table-cell !important; text-align: center; padding: 0.5em 0 0 0.5em }
.MJXp-mtr>.MJXp-mtd:first-child { padding-left: 0 }
.MJXp-mtr:first-child>.MJXp-mtd { padding-top: 0 }
.MJXp-mlabeledtr { display: table-row !important }
.MJXp-mlabeledtr>.MJXp-mtd:first-child { padding-left: 0 }
.MJXp-mlabeledtr:first-child>.MJXp-mtd { padding-top: 0 }
.MJXp-merror { background-color: rgba(255, 255, 136, 1); color: rgba(204, 0, 0, 1); border: 1px solid rgba(204, 0, 0, 1); padding: 1px 3px; font-style: normal; font-size: 90% }
.MJXp-scale0 { -webkit-transform: scaleX(.0); -moz-transform: scaleX(.0); -ms-transform: scaleX(.0); -o-transform: scaleX(.0); transform: scaleX(0) }
.MJXp-scale1 { -webkit-transform: scaleX(.1); -moz-transform: scaleX(.1); -ms-transform: scaleX(.1); -o-transform: scaleX(.1); transform: scaleX(0.1) }
.MJXp-scale2 { -webkit-transform: scaleX(.2); -moz-transform: scaleX(.2); -ms-transform: scaleX(.2); -o-transform: scaleX(.2); transform: scaleX(0.2) }
.MJXp-scale3 { -webkit-transform: scaleX(.3); -moz-transform: scaleX(.3); -ms-transform: scaleX(.3); -o-transform: scaleX(.3); transform: scaleX(0.3) }
.MJXp-scale4 { -webkit-transform: scaleX(.4); -moz-transform: scaleX(.4); -ms-transform: scaleX(.4); -o-transform: scaleX(.4); transform: scaleX(0.4) }
.MJXp-scale5 { -webkit-transform: scaleX(.5); -moz-transform: scaleX(.5); -ms-transform: scaleX(.5); -o-transform: scaleX(.5); transform: scaleX(0.5) }
.MJXp-scale6 { -webkit-transform: scaleX(.6); -moz-transform: scaleX(.6); -ms-transform: scaleX(.6); -o-transform: scaleX(.6); transform: scaleX(0.6) }
.MJXp-scale7 { -webkit-transform: scaleX(.7); -moz-transform: scaleX(.7); -ms-transform: scaleX(.7); -o-transform: scaleX(.7); transform: scaleX(0.7) }
.MJXp-scale8 { -webkit-transform: scaleX(.8); -moz-transform: scaleX(.8); -ms-transform: scaleX(.8); -o-transform: scaleX(.8); transform: scaleX(0.8) }
.MJXp-scale9 { -webkit-transform: scaleX(.9); -moz-transform: scaleX(.9); -ms-transform: scaleX(.9); -o-transform: scaleX(.9); transform: scaleX(0.9) }
.MathJax_PHTML .noError { font-size: 90%; text-align: left; color: rgba(0, 0, 0, 1); padding: 1px 3px; border: 1px solid }

 

服务器consul与本地服务健康检查不通问题解决

向往鸟 于 2022-01-22 14:00:20 发布 1282 收藏
文章标签: 服务器 consul spring cloud
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。

场景

将consul部署在云服务器上,本地服务注册至consul,并调试。服务健康检查不通过。
 
  • 1

场景还原

  1. consul组件安装

    官网:https://www.consul.io/downloads
    选择系统版本下载安装,示例:CentOs7环境

    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    sudo yum -y install consul
     
    • 1
    • 2
    • 3

    验证安装,正常情况下返回版本信息

    consul -v
     
    • 1

    启动consul,示例(开发模式启动)

    consul agent -dev
     
    • 1
  2. 本地微服务启动文件配置,并启动服务

    server:
    port: 8000 spring:
    application:
    name: business
    cloud:
    consul:
    host: 218.0.55.16
    port: 8500
    discovery:
    service-name: ${spring.application.name}
     
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
  3. 启动consul客户端 观察健康检查结果

    健康检查失败。

原因分析

相比使用eureka作为服务注册中心时,服务注册如下:

  1. 服务提供者启动后,发送自己的信息到注册中心进行注册
  2. 服务提供者每隔一段时间会想注册中心发送心跳,证明自己还活着,没有挂掉!(默认90s)
  3. 服务调用者第一次调用服务提供者时,会向注册中心拉取一份服务提供者的地址,并缓存在本地(下次用可以直接从本地取)
  4. 当服务提供者不可用时,注册中心会将这个服务提供者信息同步到订阅过这个服务的服务消费者。

而consul得注册过程如下:

区别在于eureka是服务提供者定时往注册中心发送心跳,保证存活,而consul是注册中心访问服务提供者健康检查url。

问题在于:服务器无法主动与内网IP建立连接(连路由都做不到),也就是说除非你本地主机拥有公网IP, 否则无法直接ping通。

解决

如何使服务器能够访问本地得服务接口,就是问题的关键。这就需要进行内网穿透

网上有很多工具,这里使用frp,具体介绍不再赘述,官网很详尽,中文的

frp 官网地址如下:

https://gofrp.org/
 
  • 1

下载地址:

https://github.com/fatedier/frp/releases
 
  • 1

frp包含服务端和客户端。在下载的文件中都有包含,此处因涉及两个系统环境(本地window系统,服务器centos7),所以分别下载window和linux版本。

linux版本下载完成后,上传至服务器,并解压。也可以直接在linux下使用:
wget 【包下载路径】下载,示例:
linux下:

wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_386.tar.gz
 
  • 1

解压:

tar -zxvf frp_0.38.0_linux_386.tar.gz
 
  • 1

修改启动服务端配置文件frps.ini, 默认内容如下:

[common]
bind_port = 7000
 
  • 1
  • 2

启动frp服务端:

./frps -c ./frps.ini
 
  • 1

下载window版本,并解压至本地。修改客户端启动配置文件frpc.ini, 如何配置?完整配置说明在frpc_full.ini中都有说明。这里更改配置如下:

[common]
server_addr = 218.0.55.16 #ftp服务端主机IP
server_port = 7000 #ftp服务端主机端口 [range:tcp_port]
type = tcp
local_ip = 127.0.0.1 #客户端主机IP
local_port = 7000-9000 #批量端口映射, 本地
remote_port = 7000-9000 #映射远程端口
use_encryption = false
use_compression = false
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

window下启动frp程序,需要进入window的cmd下才能执行。cmd下,进入解压包路径。执行

frpc.exe -c ./frpc.ini
 
  • 1

再次查看服务注册情况,进入consul客户端管理页面:

服务健康检查正常。

 

文章知识点与官方知识档案匹配,可进一步学习相关知识
云原生入门技能树首页概览7944 人正在系统学习中


  • 2

    点赞



  • 0

    收藏
  • 打赏

  • 0

    评论
  •  

    服务器consul与本地服务健康检查不通问题解决
    服务器consul与本地服务健康检查不通问题解决

    复制链接

    扫一扫

    热门

    VIP

 

SpringCloud集成Consul服务注册后显示健康检查失败问题解决

09-29

1849

consul版本1.10.2算是比较新的版本,安装完成启动后,把自己的服务注册到consul上显示健康检查失败health check failing

问题如图

翻阅网上的解决方案,版本都比较老,有说是版本问题,尝试切换到旧版的consul发现依旧无法解决问题,也有说没有添加actuator监控依赖导致无法健康检查,看了一下自己的pom文件也没问题。有方案是自己写一个controller调用health接口,写的不太清楚,也没弄明白。

尝试了几次解决,发现在consul的web页面实例详情页ou.

Spring Cloud 爬坑记录 - Consul注册,检查状态失败

07-18

8179

按网上的例子添加一个SpringBoot工程到Consul,使用Consul版本1.2.1

工程pom文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/...

评论0条写评论
 

评论

 
SpringCloud集成Consul服务注册后显示健康检查失败问题解决

11-14

consul版本1.10.2算是比较新的版本,安装完成启动后,把自己的服务注册到consul上显示健康检查失败health check failing 问题如图 翻阅网上的解决方案,版本都比较老,有说是版本问题,尝试切换到旧版的consul发现依旧无法解决问题,也有说没有添...

Consul入门05 - 健康检测_zl1zl2zl3的博客_consul...

11-21

>/etc/consul.d/web.json 第一个定义增加了一个主机级别的检测,名为"ping"。该检测每30秒间隔运行一次,调用命令ping -c1 google.com。在一个基于脚本的健康检测中,该检测使用启动Consul进程的用户来启动该检测。如果检测命令返回一个...

consul-pager:Consul 检查失败监控代理

07-09

Consul-pager 是一个 consul check 监控代理。
它目前仅支持通过 Slack 渠道进行通知。
用法
你必须运行一个 consul 代理监听 localhost:8500。 要启动监控代理类型:
consul-pager < global> start -config config.yaml
GLOBAL OPTIONS:
--address ' 127.0.0.1:8500 ' consul address
--dc consul datacenter
--token consul token
配置文件应如下所示:
channels :
MySlackChannel :
channeli :
subdomain : bbbbb
token : bbbbbbb
c

Consul】关于健康检查的一点思考

09-25

8246

DNS查询系统利用健康检查以防止不良节点路由信息。当服务查询时,如果服务健康检查失败或者系统检查失败服务信息将会从查询结果中删除。为了实现简单的负载平衡,返回的节点集合每次都是随机的。这种机制使得利用DNS接口基于应用级重试实现面向auto-healing服务体现架构变得更加容易。...

actuator对Consul的影响 consul健康检查通不过的原因之一

actuator对Consul的影响 consul健康检查通不过的原因之一起因错误堆栈consul 业务分析
起因
总体来说就是不听老师讲的。。。自己去搭建环境的时候把maven包进行了简化,把spring-boot-starter-actuator这个包删掉了
错误堆栈
com.netflix.client.ClientException: Load balancer does not have available server for client: XXX
at com.netflix.loadba

SpirngCloud Consul 注册到主机健康检查失败

SpirngCloud Consul 注册到主机健康检查失败Spring.properties加上此配置
Spring.properties加上此配置
#(SpringCloud consul服务(注册到主机名的问题))
#1、定开启IP地址注册
spring.cloud.consul.discovery.prefer-ip-address=true
#2、当前服务的请求IP
spring.cloud.consul.discovery.ip-address=${spring.cloud.client

spring-cloud-consul:设置servlet context-path 导致的 Consul 健康检查失败

配置文件
server:
port: 9021
servlet:
context-path: /config

去掉 server.servlet.context-path=/config 后
server:
port: 9021
# servlet:
# context-path: /config

原因及解决办法
原因:consul对微服务健康检查路径是固定的。默认为 /actuator/health,没有自动加上 servlet.context-path中设置的 /c

consul服务注册后健康检查一直失败如何解决
热门推荐

2019独角兽企业重金招聘Python工程师标准>>>

...

consul健康检查接口404

在测试项目时发现consul服务端显示测试客户端的健康检查的接口调用失败,返回404:

在客户端也显示:

[org.springframework.web.servlet.PageNotFound:1176] - No mapping found for HTTP request with URI [/consul-test/health] in DispatcherServlet with name 'dispatcherServlet'

配置是正确的:

spring.profil...

前端新手请求接口失败问题

前端新手请求接口失败问题
问题描述:

原因分析:
后端的服务器没有开
解决方案:
开启对应接口的服务器

centos7启动consul,本地客户端无法连接问题

问题描述

提示:本地启动consul客户端,无法连接centos7的服务

原因分析:

1.服务端未启动

2.服务端防火墙导致无法访问

1.检查服务端是否启动 consul members

服务端启动正常。

2.检查防火墙是否关闭systemctl status firewalld

确认已关闭,没头脑了。。。。

解决方案:

1.重启服务consul

2.打开防火墙,重新关闭。

1.重启服务consul,重试启动consul客户端,仍无...

consul 服务健康检查

08-22

4746

简介
服务注册 - 服务进程在注册中心注册自己的位置。它通常注册自己的主机和端口号,有时还有身份验证信息,协议,版本号,以及运行环境的详细资料。
服务发现 - 客户端应用进程向注册中心发起查询,来获取服务的位置。服务发现的一个重要作用就是提供一个可用的服务列表。
服务定义的格式类似如下:
/ # cat /consul/config/prometheus.json
{
"service":{
"id": "promtheus",
"name": "prometheus",

consul服务注册中心-本地启动

consul agent dev,线上写到那里,使用的docker容器

consul服务注册及与spingboot的整合

1.本地安装consul

安装包可在官网下载

2.本地启动consul

进入本地的consul目录下,新建cfg目录作为config目录,data目录作为数据目录,然后输入

//这里根据自己的实际路径来写,我这里写的是我的路径
nohup /Users/cherunyu/IdeaProjects/consul/consul agent -config-dir=/Users/cherunyu/IdeaProjects/consul/cfg -data-dir=/Users/cherunyu/I

consul使用watches机制,healthcheck不通过时发送预警

参考文档:https://www.consul.io/docs/dynamic-app-config/watches#checks

watches是一个被动触发的动作,预定义有多个类型:

Key – 监视指定K/V键值对

Keyprefix – Watch a prefix in the KV store

Services – 监视服务列表

nodes – 监控节点列表

service – 监视服务实例

checks- 监视健康检查的值

event – 监视用户事件

我这里有个..

Consul提示Service Check心跳健康监测有问题解决方案

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入
欢迎使用Markdown编辑器
你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar

Consul注册中心注册的服务总是红叉 (All service checks failing)
最新发布

06-12

900

Consul注册中心注册的服务总是红叉 (All service checks failing)

服务专题:服务注册与发现之三Consul健康检测

简介
在微服务架构中,微服务会存在多个实例,部署在多台主机中。因为网络、主机状态等诸多因素,单台主机上的服务出现问题的几率大大增加。这就要求我们能够监控每台主机、每个微服务实例的健康状态。Consul作为注册中心,提供了强大、灵活的健康监测。
快速上手
定义check的位置为/etc/consul.d/,格式跟定义服务一样,也是JSON。下边我们定义两个check,分别为pingBaidu.jso...

docker里安装consul,以及遇到的坑

docker pull consul:1.6.4

版本随意

启动命令

docker run --name consul1 -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600 consul agent -server -bootstrap-expect 1 -ui -bind=0.0.0.0 -client=0 .0.0.0

这里有个坑,注意这个数字1,代表的是单机的意思。2是集群

一开始写成2,导致web界面.

“相关推荐”对你有帮助么?


  • 非常没帮助

  • 没帮助

  • 一般

  • 有帮助

  • 非常有帮助

提交

️2022 CSDN
皮肤主题:数字20
设计师:CSDN官方博客

返回首页

向往鸟

CSDN认证博客专家

CSDN认证企业博客

码龄4年


暂无认证

 
186
积分
8
粉丝
29
获赞
11
评论
57
收藏

关注

分类专栏

最新评论

您愿意向朋友推荐“博客详情页”吗?


  • 强烈不推荐

  • 不推荐

  • 一般般

  • 推荐

  • 强烈推荐

提交



 

分类专栏

 
 
 
评论
还能输入1000个字符
 
 
0 条评论被折叠 查看

打赏作者

向往鸟

你的鼓励将是我创作的最大动力

 
¥2 ¥4 ¥6 ¥10 ¥20

输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
点击重新获取
扫码支付
 
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值

 
 
 
确定取消

 
 
 

举报

选择你想要举报的内容(必选)
  • 内容涉黄
  • 政治相关
  • 内容抄袭
  • 涉嫌广告
  • 内容侵权
  • 侮辱谩骂
  • 样式问题
  • 其他

 
 
原文链接(必填)

 
请选择具体原因(必选)
  • 包含不实信息
  • 涉及个人隐私

请选择具体原因(必选)
  • 侮辱谩骂
  • 诽谤

请选择具体原因(必选)
  • 搬家样式
  • 博文样式

 

补充说明(选填)

取消

确定

.imgViewDom { display: ; position: fixed; top: 0; left: 0; height: 100%; width: 100%; z-index: 99999999; background: rgba(255, 255, 255, 0.8); overflow: auto; -webkit-box-align: center; -webkit-box-pack: center; -moz-box-align: center; -moz-box-pack: center; -o-box-align: center; -o-box-pack: center; -ms-box-align: center; -ms-box-pack: center; box-align: center; box-pack: center }
.imgViewDom img { cursor: zoom-out }

 

最新文章

  1. Distributed MVCC based cross-row transaction
  2. redmine export long csv file failed: 502 proxy error
  3. 蚂蚁【A001】
  4. sql 遍历结果集
  5. 【转】centos 6.4 samba 安装配置
  6. CentOS允许/禁止ping的方法
  7. [逼死强迫症 - C&amp;C++设计风格选择.1] : 命名规范
  8. EasyUi DataGrid 绑定数据格式问题
  9. winfrom播放动态图片
  10. Print Article hdu 3507 一道斜率优化DP 表示是基础题,但对我来说很难
  11. BZOJ 4195: [Noi2015]程序自动分析 [并查集 离散化 | 种类并查集WA]
  12. Python获取会议部分的信息内容(不断完善中)
  13. SQLSERVER列出所有用户权限
  14. VSCode里面HTML添加CSS时没有提示
  15. Redis学习-sorted set数据类型
  16. 微信跳一跳Python辅助无需配置一键操作
  17. java util Aarrys 类
  18. webpack构建工具快速上手指南
  19. [pat]数素数
  20. 《C++标准程序库》笔记之三

热门文章

  1. 以交互的方式升级ESXi主机
  2. configurable 神图
  3. springcloud04 Ribbbon
  4. 2.2.vue用法在uniapp中的使用_
  5. 大规模 IoT 边缘容器集群管理的几种架构-5-总结
  6. Linux快照利器:Timeshift,备份和还原效果杠杠的
  7. redis服务创建失败:Could not create server TCP listening socket 127.0.0.1:6379: bind
  8. kubernetes client-go功能介绍
  9. Decompiling XAPK Files
  10. 分时问候——时间类、if语句