Spring Cloud全解析:注册中心之Eureka多网卡下IP选择

Eureka多网卡下IP选择

对于多网卡的服务器,如何指定注册到Eureka Server的IP呢

有四种方式可以使用

前提是eureka.instance.prefer-ip-address为true

忽略指定名称的网卡

yaml 复制代码
spring:
	cloud:
		inetutils:
			ignored-interfaces: #忽略eth0和以veth开头的网卡
				- eth0
				- veth.*

使用正则表达式指定网络地址

yaml 复制代码
spring:
	cloud:
		inetutils:
			preferredNetworks:
			 - 192.168
			 - 10.0

只使用站点本地地址

yaml 复制代码
spring:
	cloud:
		inetutils:
			useOnlySiteLocalInterfaces: true

指定IP地址

yaml 复制代码
eureka:
	instance:
		ip-address: 127.0.0.1
			

zhhll.icu/2022/框架/微服务...

相关推荐
金牌归来发现妻女流落街头7 小时前
【从SpringBoot到SpringCloud】
java·spring boot·spring cloud
Java后端的Ai之路14 小时前
【Spring全家桶】-一文弄懂Spring Cloud Gateway
java·后端·spring cloud·gateway
vx_Biye_Design1 天前
【关注可免费领取源码】房屋出租系统的设计与实现--毕设附源码40805
java·spring boot·spring·spring cloud·servlet·eclipse·课程设计
Volunteer Technology2 天前
sentinel基本操作
spring cloud·sentinel
Dragon Wu2 天前
Spring Security Oauth2.1 授权码模式实现前后端分离的方案
java·spring boot·后端·spring cloud·springboot·springcloud
vx_Biye_Design2 天前
基于Spring Boot+vue的湖北旅游景点门票预约平台的设计--毕设附源码29593
java·vue.js·spring boot·spring cloud·servlet·eclipse·课程设计
是阿楷啊2 天前
Java大厂面试场景:音视频场景中的Spring Boot与微服务实战
spring boot·redis·spring cloud·微服务·grafana·prometheus·java面试
岁岁种桃花儿3 天前
SpringCloud从入门到上天:Nacos做微服务注册中心
java·spring cloud·微服务
瑶山3 天前
Spring Cloud微服务搭建三、分布式任务调度XXL-JOB
java·spring cloud·微服务·xxljob