第三章补充 Eureka Server 安全认证

#设置spring应用命名,可以自定义,非必要
spring.application.name=eureka-server-cluster
#设置Eureka Server WEB控制台端口,自定义
server.port=8761

# 设置eureka实例名称,建议与配置文件的变量相同,必须和Linux系统域名相同
eureka.instance.hostname=node01
# 设置服务注册中心地址,指向另一个注册中心,使用域名作为访问路径
eureka.client.serviceUrl.defaultZone=http://root:root@node02:8761/eureka/

# 开启基于http basic的安全认证
security.basic.enabled=true
# 设置安全认证用户名
security.user.name=root
# 设置安全认证密码
security.user.password=root

  缺少POM依赖 spring boot security安全认证启动器

<!-- spring boot security安全认证启动器 -->
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-security</artifactId>
</dependency>

  

posted on 2018-12-06 20:46  唯伊  阅读(81)  评论(0编辑  收藏  举报

导航