当前位置:网站首页>When configuring Eureka, the status displays the computer name instead of localhost and IPADDR, which is the local IP
When configuring Eureka, the status displays the computer name instead of localhost and IPADDR, which is the local IP
2022-07-22 15:17:00 【_ Xiao Xu_】
Status The computer name is displayed instead of localhost Configuration related
Status The display format can be changed , The default configuration is Computer name : service name : port
、ipAddr The default is 192.168.247.1
as follows :
In fact, in the process of development , The default configuration is useless , Must be changed to localhost
、 meanwhile ipAddr It should also be for localhost Otherwise, follow-up service method access .
For each service configuration :
# To configure eureka The status of
eureka.instance.hostname=localhost
eureka.instance.instance-id=${
eureka.instance.hostname}:${
spring.application.name}:${
server.port}
# Use ip Address registration
eureka.instance.prefer-ip-address=true
# The name of the configuration service
spring.application.name=order_service
Configuring the above information can make Status
The display format of is localhost: Application name : port
Show :
take ipAddr
Change it to localhost:
cmd go in dos Command input ipconfig
:
The problem is usually caused by downloading VM ware And other similar software , There are many network cards .
Micro services to eureka When registering in the registry , According to the IP The address is abnormal. It's all localhost Or host name .( Under normal circumstances , What should be displayed is the server where the microservice is located IP Address )
Because the server is equipped with multiple network cards , Lead to eureka When discovering microservices , Unable to determine which network card the micro service is registered with , Therefore, the default display is localhost Or host name .
You need to ignore the impact of the network card on the registry in the configuration file :
# Microservice name
spring.application.name=service-name
# port
server.port=8002
# Consumer address
eureka.instance.ip-address=localhost
# With IP Address the way to eureka To register , Domain name change ip
eureka.instance.prefer-ip-address=true
#Npcap Loopback Adapter: Is the name of the ignored network card
spring.cloud.inetutils.ignored-interfaces[0]=Npcap Loopback Adapter
# To configure Staus Display format
eureka.instance.instance-id=${spring.cloud.client.address}:${spring.application.name}:${server.port}
#${spring.cloud.client.address}: For the server where the microservice is located IP Address
#${spring.application.name}: The name of the micro service
#${server.port}: Is the microservice port number
The core is :eureka.instance.ip-address=localhost
Configure the ip Address . If this is not configured, it will default to the host ip.
When the configuration is complete ipAddr
It becomes localhost
. You can visit it normally .
边栏推荐
- 双人成行本地安装&X360ce模拟手柄教程&xpadder手柄模拟键盘鼠标
- Cell isolation study - Worthington Clostridium protease program
- Read files using Win32 API
- 92. (leaflet chapter) leaflet situation plotting - acquisition of attack direction
- Recall to order: multi-objective sorting distillation recall
- Timed time test
- 2022-07-13 mysql/stonedb subquery optimizer processing record
- 测试下投票的功能
- 等保合规2022系列 | 一个中心+三重防护,助力企业等级保护建设更科学
- 【独立站运营】Shopify卖家:如何改善店铺体验?两招搞定!
猜你喜欢
微服务简介
Spark总结
Equal protection compliance 2022 series | one center + triple protection, helping the construction of enterprise level protection to be more scientific
Worthington植物原生质体制备丨纤维素酶方案
心肌黄酶丨Worthington克氏梭菌心肌黄酶的特性
滑环的分类以及用途
How to prolong the working life of slip ring
FPGA图像处理学习——人脸识别
How to solve the "last mile of delivery" of community group purchase
Redis的拓展方案
随机推荐
static变量和全局变量的区别
1.元函数与type_traits
架构设计方案(持续更新ing)
MySQL写循环语句的方法
Various application schemes of animal free collagenase Worthington
An East analysis sample
Notes de classe de la Silicon Valley (Partie 2)
JVM (一) --------- JVM 简介
2022-07-18 eliminate traversal processing of exists subquery
心肌黄酶丨Worthington克氏梭菌心肌黄酶的特性
How to review the PMP Exam
Elastase Worthington core enzyme detailed reference
某东分析样本
92. (leaflet chapter) leaflet situation plotting - acquisition of attack direction
Huawei cloud computing fuisoncompute8.0 installation
无动物型胶原酶丨Worthington的多种应用方案
双人成行本地安装&X360ce模拟手柄教程&xpadder手柄模拟键盘鼠标
2022-07-18 Jenkins deployment
Zcmu--1925: HX & XH's game (C language)
Pdf to image and content reading