环境:
案例1:
客户端:springboot(1.5.12.RELEASE)+ spring-boot-admin-starter-client 1.5.7
admin:springboot(2.1.1.RELEASE)+ spring-boot-admin-starter-server 2.1.1
当我运行客户端,并刷新管理员应用程序.错误是"调用[asyncError()]对于具有异步状态[MUST_DISPATCH]"的请求无效;
case2:
(2.1.1.RELEASE)客户端和服务器都使用相同的版本并且具有相同的错误.
详细错误如下:
2018-12-04 11:10:40.129 ERROR 2572 --- [nio-9090-exec-5] o.a.catalina.connector.CoyoteAdapter : Exception while processing an asynchronous request
java.lang.IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [MUST_DISPATCH]
at org.apache.coyote.AsyncStateMachine.asyncError(AsyncStateMachine.java:440) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:512) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.Request.action(Request.java:430) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:382) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:239) ~[tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProcessor.dispatch(AbstractProcessor.java:241) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:791) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-embed-core-9.0.13.jar:9.0.13]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.13.jar:9.0.13]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_162]
at …Run Code Online (Sandbox Code Playgroud) 我想控制在Eureka服务器上运行的微服务.我使用spring-boot-admin,但是我在访问Trace,Log等信息时遇到错误...
我得到的错误是
错误:{"timestamp":1489052472862,"status":401,"error":"Unauthorized","message":"访问此资源需要完全身份验证.","path":"/ metrics"}
我的依赖是
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.4.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
并且以下属性均无效
endpoints.info.id=information
endpoints.info.sensitive=false
endpoints.info.enabled=true
information.app.name=Actuator Example
information.app.description=Actuator Example
information.app.version=1.0.0
Run Code Online (Sandbox Code Playgroud)
所有的终点都发生了同样的事情,如映射,环境和所有接受健康
spring spring-boot microservices netflix-eureka spring-boot-admin
我已经使用oAuth2保护了Spring Boot应用程序,只有在执行器端点未受到保护的情况下,我才能从Spring Boot管理员访问应用程序。我已经检查了github上的安全性示例,即使/ health端点不安全。有什么方法可以通过spring boot admin访问由oAuth2保护的执行器端点的spring boot应用程序。
在Spring Boot Admin(SBA)服务器上注册后,客户端的一些执行器得到了解决,http://springapplication.com/actuator而不是https://springapplication.com/actuator.为什么它将端点更改为HTTP并且不会保留在HTTPS?可定制吗?
这是一些日志和Java/YML文件.
日志:
2018-07-02 06:13:27.683 INFO 3194 --- [-client-epoll-7] d.c.b.a.server.services.StatusUpdater : Couldn't retrieve status for Instance(id=0d47f12b0a94, version=57, registration=Registration(name=springbootapplication-Name, managementUrl=https://springbootapplication.com/actuator, healthUrl=https://springbootapplication.com/actuator/health, serviceUrl=https://springbootapplication.com, source=http-api), registered=true, statusInfo=StatusInfo(status=UP, details={}), statusTimestamp=2018-07-02T05:06:08.423Z, info=Info(values={}), endpoints=Endpoints(endpoints={httptrace=Endpoint(id=httptrace, url=http://springbootapplication.com/actuator/httptrace), flyway=Endpoint(id=flyway, url=http://springbootapplication.com/actuator/flyway), loggers=Endpoint(id=loggers, url=http://springbootapplication.com/actuator/loggers), health=Endpoint(id=health, url=https://springbootapplication.com/actuator/health), env=Endpoint(id=env, url=http://springbootapplication.com/actuator/env), heapdump=Endpoint(id=heapdump, url=http://springbootapplication.com/actuator/heapdump), scheduledtasks=Endpoint(id=scheduledtasks, url=http://springbootapplication.com/actuator/scheduledtasks), mappings=Endpoint(id=mappings, url=http://springbootapplication.com/actuator/mappings), beans=Endpoint(id=beans, url=http://springbootapplication.com/actuator/beans), configprops=Endpoint(id=configprops, url=http://springbootapplication.com/actuator/configprops), threaddump=Endpoint(id=threaddump, url=http://springbootapplication.com/actuator/threaddump), metrics=Endpoint(id=metrics, url=http://springbootapplication.com/actuator/metrics), conditions=Endpoint(id=conditions, url=http://springbootapplication.com/actuator/conditions), auditevents=Endpoint(id=auditevents, url=http://springbootapplication.com/actuator/auditevents), info=Endpoint(id=info, url=http://springbootapplication.com/actuator/info), jolokia=Endpoint(id=jolokia, url=http://springbootapplication.com/actuator/jolokia)}), buildVersion=null)
Run Code Online (Sandbox Code Playgroud)
Application.yml(服务器):
server:
port: 5100
spring:
security:
user:
name: admin
password: password
Run Code Online (Sandbox Code Playgroud)
SecuritySecureConfig.java(服务器):
import org.springframework.context.annotation.Configuration; …Run Code Online (Sandbox Code Playgroud) 我正在使用 Spring Boot Actuator 依赖项来获取应用程序的见解。为此,我使用了 Spring Boot Admin。客户端-服务器的配置工作正常。我必须测量将要执行的端点的计数、总时间和最大值。
uri:/user/asset/getAllAssets
TOTAL_TIME: 831ms
MAX: 0ms
uri:/user/getEmployee/{employeeId}
TOTAL_TIME: 98ms
MAX: 0ms
Run Code Online (Sandbox Code Playgroud)
为什么MAX(时间)是0而TOTAL_TIME:是Xms
当我执行泛化形式时
localhost:8889/actuator/metrics/http.server.requests我得到的MAX 为 3.00..
我还看到了生产就绪功能,但找不到任何有关 MAX 是如何计算或它代表什么的描述
注:随着请求数量的增加,COUNT、TOTAL_TIME 也会增加,但 MAX 有时会减少(具体参见请求 1、请求 2)
{
"name": "http.server.requests",
"description": null,
"baseUnit": "seconds",
"measurements": [
{
"statistic": "COUNT",
"value": 597
},
{
"statistic": "TOTAL_TIME",
"value": 144.9057076
},
{
"statistic": "MAX",
"value": 3.0002913
}
],
"availableTags": [
{
"tag": "exception",
"values": [
"None"
]
},
{
"tag": "method",
"values": …Run Code Online (Sandbox Code Playgroud) java spring spring-boot spring-boot-actuator spring-boot-admin
我试图为我的应用程序启用 Spring Boot 管理服务器。默认设置工作得很好,但是当我尝试启用安全性时,出现以下错误:
应用程序无法启动
描述:
无法注册在类路径资源 [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class] 中定义的 bean 'conversionServicePostProcessor'。具有该名称的 bean 已经在类路径资源 [org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.class] 中定义并且覆盖被禁用。
行动:
考虑通过设置 spring.main.allow-bean-definition-overriding=true 重命名其中一个 bean 或启用覆盖
进程以退出代码 1 结束
我正在使用spring-boot-admin-starter-server(2.2.0-SNAPSHOT)的最新 SNAPSHOT 版本。这是我的安全配置:
@EnableAdminServer
@EnableWebFluxSecurity
@Configuration(proxyBeanMethods = false)
class AdminServerSecurityConfigurations(val adminServerProperties: AdminServerProperties) {
@Bean
fun adminServerSecurityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain = http
// @formatter:off
.authorizeExchange()
.pathMatchers("${adminServerProperties.contextPath}/assets/**").permitAll()
.pathMatchers("${adminServerProperties.contextPath}/login").permitAll()
.anyExchange().authenticated().and()
.formLogin().loginPage("${adminServerProperties.contextPath}/login").and()
.logout().logoutUrl("${adminServerProperties.contextPath}/logout").and()
.httpBasic().and()
// @formatter:on
.csrf().disable()
.build()
@Bean
fun notifyLogger(instanceRepository: InstanceRepository) = LoggingNotifier(instanceRepository)
}
Run Code Online (Sandbox Code Playgroud) 我一直在关注Spring boot Admin的教程,但是当我运行管理应用程序时,我看不到任何用于监控的Spring启动客户端应用程序.我已经检查过管理员和客户端应用程序都在运行.Admin在端口8080上运行,客户端应用程序在端口9010上运行
这是我在管理员 应用程序中所做的
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>1.5.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
添加了这些注释
@Configuration
@SpringBootApplication
@EnableAdminServer
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我在客户端应用程序中添加的内容
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
并将其添加到我的属性文件(YAML)中
spring:
boot:
admin:
url:
- http://localhost:8080
management:
security:
enabled: false
Run Code Online (Sandbox Code Playgroud)
这就是我的仪表板的样子,因为您可以看到没有要监视的应用程序.
我有一个使用spring MVC和Dropwizard开发的REST API.我使用Dropwizard框架创建了健康检查.现在我看看如何将此API注册到Springboot管理员,以便我可以在管理UI上查看所有指标.
我有其他API使用Springboot开发.因此,将它们注册到Springboot管理员非常简单.但在另一个Dropwizard案例中,我无法注册,也不确定是否需要进行任何额外配置.
期待回应.谢谢
spring-mvc dropwizard spring-boot spring-boot-actuator spring-boot-admin
我正在尝试在 ECS Fargate 上运行 spring-boot-admin - 几分钟后服务器死机并且日志中充满了“系统中打开的文件太多”错误。
我正在使用 spring-boot 2.3.1,并尝试过 2.2.3 和 spring-boot-admin 的 2.3.0-SNAPSHOT。该 jar 在安装了 openjdk-11-jdk-headless 的 ubuntu 20.04 基础映像上运行。ECS 服务有 2gb RAM 可用,我增加了 nofile 和 nproc 的 Ulimits (100000)
Ulimits:
- Name: nofile
HardLimit: 1000000
SoftLimit: 1000000
- Name: nproc
HardLimit: 1000000
SoftLimit: 1000000
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
2020-06-29 22:03:35.691 ERROR 6 --- [io-8080-exec-24] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open …
我在 Spring Boot Admin 下监控了几个应用程序。Spring Boot Admin 非常擅长告诉我应用程序是启动还是关闭以及其他各种指标。
我还想知道这些应用程序公开的某些 URL 返回的 HTTP 状态为 200。具体来说,我想每天向这些 URL 发送一次 GET 请求。如果它从其中任何一个收到非 200 状态,它会发送一封电子邮件,说明哪些 URL 报告非 200。
Spring Boot Admin 能够做什么?我知道 custom ,HealthIndicator但不确定它是否可以安排或是否适合于此。
在我构建自己的应用程序以进行 GET 调用并发送电子邮件之前,只是想看看 Spring Boot Admin 是否提供了支持这样做的功能。
更新
URL 作为 Eureka 服务公开,我通过 Spring Cloud OpenFeign 从其他服务调用服务。
更新 2
我继续构建我自己的自定义应用程序来处理这个问题。详细信息如下,但如果 Spring 提供开箱即用的东西来做到这一点,仍然很感兴趣。
应用程序.yml
app:
serviceUrls:
- "http://car-service/cars?category=sedan"
- "http://truck-service/trucks"
cron: "0 0 10 * * *"
Run Code Online (Sandbox Code Playgroud)
网址读取为:
@Component
@ConfigurationProperties(prefix = "app")
@Getter
@Setter
public class ServiceUrls {
private String[] serviceUrls; …Run Code Online (Sandbox Code Playgroud) spring-boot ×7
spring ×4
java ×3
spring-mvc ×2
amazon-ecs ×1
docker ×1
dropwizard ×1
kotlin ×1