当前位置:网站首页>consul安装与配置
consul安装与配置
2022-07-28 11:13:00 【无休止符】
一、docker安装consul
- consul官方地址:github.com/hashicorp/consul
- docker安装命令:
docker run -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600/udp consul consul agent -dev -client=0.0.0.0


二、web访问consul
- 默认访问端口为8500:http://192.168.91.129:8500/,ip地址根据自己的地址修改
- 8600端口是dns的端口,8500是http的端口:注册与服务发现都是通过8500端口

三、dns访问
- 浏览器访问过程
- 浏览器访问域名地址会先到dns服务器解析出ip和port
- 然后再使用返回的ip和port来请求

- windows下hosts的修改:路径 -> C:\Windows\System32\drivers\etc\hosts
- 通过hosts的修改,可以不需要到dns服务器解析,就直接访问ip+port
- 浏览器访问域名的时候,如果发现hosts已经解析过了,就不会再到dns服务器请求了
- 微服务中的dns:consul支持dns服务,对于服务网关来说,注册中心consul是一个dns服务器

- linux中查看consul的dns:
dig- 如果提示找不到dig命令,就使用命令安装:
yum install bind-utils
- 如果提示找不到dig命令,就使用命令安装:

- consul的dns运行命令:
dig @192.168.91.129 -p 8600 consul.service.consul SRV- 每个服务都会生成一个域名,域名的前缀是服务名或服务id,域名后缀是 service.consul


边栏推荐
- Boutique scheme | Haitai Fangyuan full stack data security management scheme sets a "security lock" for data
- 【一知半解】零值拷贝
- LabVIEW AI视觉工具包(非NI Vision)下载与安装教程
- An example of the mandatory measures of Microsoft edge browser tracking prevention
- Database advanced learning notes -- object type
- Object stream of i/o operation (serialization and deserialization)
- Using C language to realize bidirectional linked list
- WPF layout controls are scaled up and down with the window, which is suitable for multi-resolution full screen filling applications
- R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize dot plot, set the add parameter, add violin graph to the dot plot, and add the vertical line of mean standar
- B2 sub theme / blog b2child sub theme / open source code
猜你喜欢

保障邮箱安全,验证码四个优势
![完整版H5社交聊天平台源码[完整数据库+完整文档教程]](/img/3f/03239c1b4d6906766348d545a4f234.png)
完整版H5社交聊天平台源码[完整数据库+完整文档教程]

Introduction to the usage of SAP ui5 image display control avatar trial version

An example of the mandatory measures of Microsoft edge browser tracking prevention

B2 sub theme / blog b2child sub theme / open source code

Today's sleep quality record 74 points

Will PFP be the future of digital collections?

Ripro9.0 revised and upgraded version +wp two beautification packages + rare plug-ins

STL の 概念及其应用

【一知半解】零值拷贝
随机推荐
[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~
R language - some metrics for unbalanced data sets
一种比读写锁更快的锁,还不赶紧认识一下
Has samesite cookies ever occurred when using identityserver?
P5472 [NOI2019] 斗主地(期望、数学)
Flutter tutorial flutter navigator 2.0 with gorouter, use go_ Router package learn about the declarative routing mechanism in fluent (tutorial includes source code)
【MySQL】Got an error reading communication packets
1331. 数组序号转换
Database advanced learning notes - storage structure
Sirius network verification source code / official genuine / included building tutorial
Jupiter、spyder、Anaconda Prompt 、navigator 快捷键消失的解决办法
服务器在线测速系统源码
Three methods of using unity mouse to drive objects
Server online speed measurement system source code
Advanced database technology learning notes 1 -- Oracle deployment and pl/sql overview
How to use JWT for authentication and authorization
B2 sub theme / blog b2child sub theme / open source code
[cesium] entity property and timing binding: the sampledproperty method is simple to use
Object to object mapping -automapper
How to effectively implement a rapid and reasonable safety evacuation system in hospitals