【笔记】Eureka显示正确的网卡

前言

Eureka显示正确的网卡

配置正确的网卡

  • 创建bootstrap.yml配置文件
1
2
3
4
5
6
7
8
9
spring:
cloud:
inetutils:
preferred-networks:
# 配置正确的网卡
- 192\.168\.3\..+
ignored-interfaces:
# 配置要忽略的网卡(可选)
- utun.+

配置正确的显示

  • 编辑application.yml配置文件
1
2
3
4
5
6
eureka:
instance:
prefer-ip-address: true
# 显示格式(可选)
instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}

完成