gpt4 book ai didi

spring eureka security 批量更新失败,HTTP 状态码为 401

转载 作者:行者123 更新时间:2023-12-03 14:34:26 28 4
gpt4 key购买 nike

我研究 spring cloud eureka ,cloud 并且它们工作得很好。但是在eureka服务中添加了安全性后,却遇到了一些错误。

所有代码和错误详细信息都在 https://github.com/keryhu/eureka-security

Eureka 服务application.yml

security:
user:
name: user
password: password

eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
wait-time-in-ms-when-sync-empty: 0

和 config-service 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

There is errors exported after starting the config-service:


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

最佳答案

SET eureka.client.serviceUrl.defaultZone 的 eureka-server
http://username:password@localhost:8761/eureka/

关于spring eureka security 批量更新失败,HTTP 状态码为 401,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36525411/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com