当前位置:网站首页>Eureka registers with each other, only showing each other or only showing problems in one
Eureka registers with each other, only showing each other or only showing problems in one
2022-07-28 21:08:00 【_ Xiao Xu_】
In the use of eureka When writing a microservice program , There's a problem , It's in two eureka_server When registering with each other , Every eureka Or only show each other , Or only show in one .
The two configurations are as follows :
# Configure service name == Registry Center server
spring.application.name=eureka_server_copy
# Service port number
server.port=7000
# Configure the service instance ip
eureka.instance.hostname=localhost
# Whether or not to eureka Register with the registry ( This self registration )
eureka.client.register-with-eureka=true
# Whether from eureka Get the registered address in ( Background has ip Display instead of domain name )
eureka.client.fetch-registry=false
# To configure eureka Information about the server to which the client is connected
eureka.client.service-url.defaultZone=http://localhost:9000/eureka/,http://localhost:7000/eureka/
# Configure service name == Registry Center server
spring.application.name=eureka_server
# Service port number
server.port=9000
# Configure the service instance ip
eureka.instance.hostname=localhost
# Whether or not to eureka Register with the registry ( This self registration )
# Register yourself in the registry
eureka.client.register-with-eureka=true
# Whether from eureka Get the registered address in ( Background has ip Display instead of domain name )
eureka.client.fetch-registry=false
# To configure eureka Information about the server to which the client is connected
eureka.client.service-url.defaultZone=http://localhost:7000/eureka/,http://localhost:9000/eureka/
I modified eureka.client.service-url.defaultZone The order of addresses , When the port of this machine is in front , Only show each other's , Don't show yourself , When the address of the local port is in the back, it is only displayed on one :


The reason for this result is that the hostname is the same and localhost As the registered address :
# Configure the service instance ip
eureka.instance.hostname=localhost
eureka.client.service-url.defaultZone=http://localhost:9000/eureka/,http://localhost:7000/eureka/
The reasons why registration centers cannot register with each other in the above two cases , Name the host name randomly , Use 172.0.0.1 Instead of localhost that will do :
eureka.instance.hostname=machine2
# Whether or not to eureka Register with the registry ( This self registration )
eureka.client.register-with-eureka=true
# Whether from eureka Get the registered address in ( Background has ip Display instead of domain name )
eureka.client.fetch-registry=false
# To configure eureka Information about the server to which the client is connected
eureka.client.service-url.defaultZone=http://127.0.0.1:9000/eureka/,http://127.0.0.1:7000/eureka/
After modification, you can register with each other :


边栏推荐
- [tool class] util package of map, common entity classes are converted to map and other operations
- What functions does MySQL have? Don't look everywhere. Just look at this.
- 既要便捷、安全+智能,也要颜值,萤石发布北斗星人脸锁DL30F和极光人脸视频锁Y3000FV
- SharkTeam完成Flow生态NFT市场MatrixMarket的安全审计
- Basic operations of unity3d scene production
- Thinking and summary of R & D Efficiency
- 查询oracle视图创建语句及如何向视图中插入数据[通俗易懂]
- Explain the script data transmission and notification in unity
- C # basic 4-written examination question 1
- Introduction to blue team: efficiency tools
猜你喜欢

Explain various coordinate systems in unity in detail

Integrating database Ecology: using eventbridge to build CDC applications

What is data center? What value does the data center bring_ Light spot technology

EfficientFormer:轻量化ViT Backbone

How to modify the ID of NetApp expansion enclosure disk shelf

程序员最大的浪漫~

小程序容器技术,让移动研发效率提升500%

取色器实战(Qt含源码)

JS page black and white background switch JS special effect

Deit: attention can also be distilled
随机推荐
Ctfshow network lost track record (2)
MFC WPF WinForm (Industrial MFC or QT)
Unity foundation 3- data persistence
Explain the mobile control implementation of unity in detail
使用缓冲的方式采集视频
Space shooting lesson 09: elf animation
Space shooting Lesson 10: score (painting and writing)
Baklib | why do enterprises need to pay attention to customer experience?
Explain in detail the rays and radiographic testing in unity
2 enjoy yuan mode
Dom4J的Bug
Space game Lesson 12: shield
Explain the camera in unity and its application
Read the recent trends of okaleido tiger and tap the value and potential behind it
Integrating database Ecology: using eventbridge to build CDC applications
Lvs+keepalived high availability deployment practical application
MySQL修改端口号(修改mysql的端口号会有问题吗)
[Zhou Zhou has a prize] cloud native programming challenge "edge container" track invites you to fight!
(转)冒泡排序及优化详解
Color finder actual combat (QT including source code)