【发布时间】:2016-07-31 05:46:44
【问题描述】:
我研究 spring cloud eureka , cloud 和它们工作得很好。但是在 eureka 服务中添加安全之后,它遇到了一些错误。
所有代码和错误详情都在https://github.com/keryhu/eureka-security
eureka 服务应用程序.yml
security:
user:
name: user
password: password
eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
wait-time-in-ms-when-sync-empty: 0
还有配置服务application.java
@SpringBootApplication
@EnableConfigServer
@EnableDiscoveryClient
配置服务应用程序.yml
eureka:
client:
registry-fetch-interval-seconds: 5
serviceUrl:
defaultZone: http://user:password@${domain.name:localhost}:8761/eureka/
spring:
cloud:
config:
server:
git:
uri: https://github.com/spring-cloud-samples/config-repo
basedir: target/config
启动配置服务后导出错误:
2016-04-10 11:22:39.402 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:22:39.402 WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
2016-04-10 11:23:09.411 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:23:09.412 WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
2016-04-10 11:23:39.429 ERROR 80526 --- [get_localhost-3] c.n.e.cluster.ReplicationTaskProcessor : Batch update failure with HTTP status code 401; discarding 1 replication tasks
2016-04-10 11:23:39.430 WARN 80526 --- [get_localhost-3] c.n.eureka.util.batcher.TaskExecutors : Discarding 1 tasks of TaskBatchingWorker-target_localhost-3 due to permanent error
【问题讨论】:
-
你可以试试 Brixton.RC2 吗?
-
@spencergibb 我使用 Brixton.RC1
-
是的,请用RC2试试,如果还有问题,我们可以看看。
-
@spencergibb ,我已经更新到 RC2,但 eureka 仍然有
Batch update failure with HTTP status code 401; discarding 1 replication tasks... -
你的eureka服务也需要设置安全serviceUrl
标签: spring spring-security spring-cloud netflix-eureka spring-cloud-netflix