当前位置:网站首页>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


边栏推荐
- 移动端人脸风格化技术的应用
- CVPR2020 best paper:对称可变形三维物体的无监督学习
- 数字孪生轨道交通:“智慧化”监控疏通城市运行痛点
- Autumn recruit offer harvesters, and take the offers of major manufacturers at will
- 可视化大型时间序列的技巧。
- Full version of H5 social chat platform source code [complete database + complete document tutorial]
- 【补题日记】[2022杭电暑期多校2]K-DOS Card
- PHP detects whether the URL URL link is normally accessible
- Five Ali technical experts have been offered. How many interview questions can you answer
- WPF dependent attribute (WPF dependent attribute)
猜你喜欢

Unity鼠标带动物体运动的三种方法

CVPR2020 best paper:对称可变形三维物体的无监督学习

Three methods of using unity mouse to drive objects

强缓存、协商缓存具体过程

Will PFP be the future of digital collections?

Autumn recruit offer harvesters, and take the offers of major manufacturers at will

擦黑板特效表白H5源码+非常浪漫/附BGM

Xiaoshuidi 2.0 website navigation network template

Design and implementation of SSM personal blog system

中国业务型CDP白皮书 | 爱分析报告
随机推荐
Digital twin rail transit: "intelligent" monitoring to clear the pain points of urban operation
「以云为核,无感极速」第五代验证码重磅来袭
Top ten application development trends from 2022 to 2023
STM32 drives st7701s chip (V ⅰ V0 mobile phone screen change price)
Database advanced learning notes - storage structure
从0开发一个自己的npm包
Understand how to prevent tampering and hijacking of device fingerprints
Router firmware decryption idea
Client service registration of Nacos registry
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
【补题日记】[2022牛客暑期多校2]I-let fat tension
Solutions to slow start of MATLAB
Sirius network verification source code / official genuine / included building tutorial
Service Workers让网站动态加载Webp图片
Outlook suddenly becomes very slow and too laggy. How to solve it
Techniques for visualizing large time series.
STL の 概念及其应用
AlexNet—论文分析及复现
Using C language to realize bidirectional linked list
Full version of H5 social chat platform source code [complete database + complete document tutorial]