当前位置:网站首页>开发consul 客户端即微服务
开发consul 客户端即微服务
2022-04-23 21:58:00 【Leon_Jinhai_Sun】
# 1.创建项目并引入consul客户端依赖
<!--引入consul依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
# 2.编写properties配置
server.port=8889
spring.application.name=consulclient8889
spring.cloud.consul.host=localhost #注册consul服务的主机
spring.cloud.consul.port=8500 #注册consul服务的端口号
spring.cloud.consul.discovery.register-health-check=false #关闭consu了服务的健康检查[不推荐]
spring.cloud.consul.discovery.service-name=${spring.application.name} #指定注册的服务名称 默认就是应用名
# 3.启动服务查看consul界面服务信息
版权声明
本文为[Leon_Jinhai_Sun]所创,转载请带上原文链接,感谢
https://blog.csdn.net/leon_jinhai_sun/article/details/124209655
边栏推荐
- Two Stage Detection
- Swift import third-party library reports an error no such module““
- 在线时序流程图制作工具
- Devops and cloud computing
- [leetcode refers to offer 10 - I. Fibonacci sequence (simple)]
- Oracle intercepts special characters
- Detectron2 using custom datasets
- Implementation of service fusing
- 分布式系统服务熔断
- Subcontracting of wechat applet based on uni app
猜你喜欢
IIS cannot load * woff,*. woff2,*. Solution of SVG file
C reads excel specific data into specific columns of DataGridView
[leetcode refers to offer 32 - III. print binary tree III from top to bottom (medium)]
How to make Jenkins job run automatically after startup
openfeign集成Hystrix的备选方案处理
JS prototype and prototype chain
[leetcode refers to offer 42. Maximum sum of continuous subarrays (simple)]
分布式系统服务熔断
[leetcode refers to offer 22. The penultimate node in the linked list (simple)]
Implementation of service fusing
随机推荐
How Axure installs a catalog
Database Experiment four View experiment
OpenFeign 组件说明
21. Basic usage of MariaDB
Opening conditions and process of hystrix circuit breaker and default alternative treatment
Getting started with detectron2
基于Ribbon的服务调用
MySQL 回表
一文解决浏览器跨域问题
Database Experiment 7 stored procedure experiment
Error message: b04access.00f eve'. Read of address 000001B4
[※ leetcode refers to offer 46. Translate numbers into strings (medium)]
Oracle updates the data of different table structures and fields to another table, and then inserts it into the new table
Pyuninstaller package exe cannot find the source code when running, function error oserror: could not get source code
服务注册中心和Ribbon组件回顾
Ribbon停止维护
JS to get the browser and screen height
Mixed use of Oracle column row conversion and comma truncated string
1. Finishing huazi Mianjing -- 1
Daily operation and maintenance knowledge -- 1