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


边栏推荐
- MySQL sorts out the review content -- with mind map
- Unity foundation 6-rotation
- Unit editor details
- Ctfshow network lost track record (2)
- DLL decompile (decompile encrypted DLL)
- What is low code? Which platforms are suitable for business personnel? Is it reliable to develop the system?
- EfficientFormer:轻量化ViT Backbone
- Cause analysis of restart of EMC cx4-120 SPB controller
- 向往的开源之多YOUNG新生 | 从开源到就业的避坑指南来啦!
- [Zhou Zhou has a prize] cloud native programming challenge "edge container" track invites you to fight!
猜你喜欢

JS page black and white background switch JS special effect

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

How can enterprises successfully complete cloud migration?

ctfshow 网络迷踪做题记录(2)

Moco V1: the visual field can also be self supervised

Explain various coordinate systems in unity in detail
![[C language brush questions] explanation of linked list application](/img/44/1de4e3f0712780680fbdc904dfe39a.png)
[C language brush questions] explanation of linked list application

(转)冒泡排序及优化详解

npm如何切换淘宝源镜像

Color finder actual combat (QT including source code)
随机推荐
又一款装机神器
Confusing knowledge points of software designer examination
MFC WPF WinForm (Industrial MFC or QT)
npm如何切换淘宝源镜像
Explain the mobile control implementation of unity in detail
Explain the script data transmission and notification in unity
How to build internal Wikipedia
What is low code? Which platforms are suitable for business personnel? Is it reliable to develop the system?
Why on earth is it not recommended to use select *?
Using viewpager to slide through pages in fragment
Interesting pictures and words
Report redirect after authorized login on wechat official account_ The problem of wrong URI parameters
[C language brush questions] explanation of linked list application
DLL decompile (decompile encrypted DLL)
oracle如何导出数据(oracle如何备份数据库)
C # basic 4-written examination question 1
C # basic 7-iterator and coroutine
Huawei cloud digital asset chain, "chain" connects the digital economy, infinite splendor
什么是“安全感”?沃尔沃用它自己独特的理解以及行动来告诉你
有奖征文 | 2022 云原生编程挑战赛征稿活动开启