eureka注册中心设置用户名密码,版本不同,配置文件有差别吗,修改后client端就注册不上去
来源:6-2 Config Server
Sss777
2018-06-27
eureka注册中心设置用户名密码,引用相应的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
版本不同配置文件有差别吗
例如:springboot版本用2.0.0.M3
application.yml 配置文件需这样写:
security:
user:
name:你的用户名
password:你的密码
在访问路径上加入用户名密码
eureka:
client:
serviceUrl:
defaultZone:http://你的用户名:你的密码@127.0.0.1:8761/eureka/
对应的client端的url也要改为一样的,能注册上去
springBoot版本用2.0.3.RELEASE
application.yml 配置文件需改写为:
spring:
security:
user:
name:你的用户名
password:你的密码
如果改为之前的配置文件会报错

client端就不能注册上去

1回答
-
wirechen
2018-06-27
我猜测可能是springboot版本不同导致的吧,你可以在两个版本中的yml配置文件中都ctrl左键点进去看下,如果正式版security.user点都不进去的话说明这部分已经做过修改,个人猜想哈
012018-06-28
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
5674 学习 · 2489 问题
相似问题