聊聊如何玩转spring-boot-admin

news2024/10/7 16:22:28

前言

1、何为spring-boot-admin?

Spring Boot Admin 是一个监控工具,旨在以良好且易于访问的方式可视化 Spring Boot Actuators 提供的信息

快速开始

如何搭建spring-boot-admin-server

1、在服务端项目的POM引入相应的GAV

  <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>${spring-boot-admin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

2、新建springboot启动类并加上@EnableAdminServer

@SpringBootApplication
@EnableAdminServer
public class MonitorApplication {
    public static void main(String[] args) {
        SpringApplication.run(MonitorApplication.class);
    }
}

配置完,访问一下页面

虽然可以访问,但是这样不安全,接下来我们和spring security做个整合

3、整合spring security

a、 在服务端项目的pom引入security GAV

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

b、 在服务端项目的application.yml配置相关用户名和密码

spring:
  security:
    user:
      name: ${MONITOR_USER:admin}
      password: ${MONITOR_PWD:admin}

c、 定制security config

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityMonitorConfig extends WebSecurityConfigurerAdapter {



    private final AdminServerProperties adminServer;

    private final WebEndpointProperties webEndpointProperties;


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
        successHandler.setTargetUrlParameter("redirectTo");
        successHandler.setDefaultTargetUrl(this.adminServer.path("/"));


        http.authorizeRequests()
                .requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/assets/**"))).permitAll()
                .requestMatchers(new AntPathRequestMatcher(this.adminServer.path(webEndpointProperties.getBasePath() + "/info")))
                .permitAll()
                .requestMatchers(new AntPathRequestMatcher(adminServer.path(webEndpointProperties.getBasePath() + "/health")))
                .permitAll()
                .requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/login")))
                .permitAll()
                .anyRequest().authenticated()
                .and()
                .formLogin().loginPage(this.adminServer.path("/login")).successHandler(successHandler).and()
                .logout().logoutUrl(this.adminServer.path("/logout")).and()
                .httpBasic().and()
                .csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
                .ignoringRequestMatchers(
                        new AntPathRequestMatcher(this.adminServer.path("/instances"), POST.toString()),
        new AntPathRequestMatcher(this.adminServer.path("/instances/*"), DELETE.toString()),
        new AntPathRequestMatcher(this.adminServer.path(webEndpointProperties.getBasePath() + "/**")));

        http.rememberMe((rememberMe) -> rememberMe.key(UUID.randomUUID().toString()).tokenValiditySeconds(1209600));


    }

}

配置完访问一下页面


输入用户名和密码 admin/admin


如果对整合安全认证还有疑问,可以直接参考官网
https://docs.spring-boot-admin.com/current/security.html

4、页面定制

如果我们觉得登录的springboot admin logo个性化不强,我们可以简单定制一下

在application.yml做如下配置

spring:
  boot:
    admin:
      ui:
        title: ${UI_TITLE:LYB-GEEK Monitor}
        brand: <img src="assets/img/icon-spring-boot-admin.svg"><span>${spring.boot.admin.ui.title}</span>

配置好访问一下


如果有些导航栏,我们觉得不需要,比如去掉关于我们

spring:
  boot:
    admin:
      ui:
        view-settings:
          - name: "about"
            enabled: false

注: view-settings这个配置需要是2.3.1以上版本才有的属性

配置好访问一下


发现关于我们已经去掉了,以上只是简单定制,更多定制可以参考如下链接
https://docs.spring-boot-admin.com/current/customize_ui.html

5、与注册中心集成

a、 在服务端项目中pom引入eureka-client GAV

  <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

b、 在application.yml文件引入eureka 客户端相关配置

eureka:
  instance:
    instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${server.port}}
    prefer-ip-address: ${PREFER_IP:true}  #是否选择IP注册
    #   ip-address: ${IP_ADDRESS:localhost}   #指定IP地址注册
    lease-renewal-interval-in-seconds: 5  #续约更新时间间隔(默认30秒),使得eureka及时剔除无效服务
    lease-expiration-duration-in-seconds: 10 #续约到期时间(默认90秒)
    hostname: ${HOSTNAME:${spring.application.name}}
  client:
    service-url:
      defaultZone: ${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE:http://localhost:8761/eureka/}
      #缩短延迟向服务端注册的时间、默认40s
    initial-instance-info-replication-interval-seconds: 10
    #提高Eureka-Client端拉取Server注册信息的频率,默认30s
    registry-fetch-interval-seconds: 5

访问eureka控制面板


服务端的配置暂且说到这边,接下来我们说下客户端集成

如何搭建spring-boot-admin-client

1、在客户端项目的POM配置相关GAV

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>${spring-boot-admin-client.version}</version>
        </dependency>

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>


2、客户端暴露actuator相关端点

management:
  endpoints:
    web:
      exposure:
        include: "*" 
  endpoint:
    health:
      show-details: ALWAYS

3、配置spring-boot-admin服务端地址

spring:
  boot:
    admin:
      client:
        url: http://localhost:8080

启动观察控制台,会发现有如下信息

原因是因为我们服务端配置了鉴权,因此我们客户端还需做如下配置

spring:
  boot:
    admin:
      client:
        url: http://localhost:8080
        username: admin
        password: admin

配置好,观察控制台,发现没异常信息,此时我们访问服务端监控面板


如图说明客户端搭建成功

4、配置应用信息

默认我们查看服务端监控面板–应用列表详情,会发现


这个信息是空的,我们可以在yml配置形如下内容

info:
  groupId: @project.groupId@
  artifactId: @project.artifactId@
  version: @project.version@
  describe: 这是一个微服务应用

再次访问服务端监控面板

其实这个采的就是actuator/info端点。当然可以像官方介绍的示例,在项目的POM引入springboot插件,并指定goal为build-info

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>build-info</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

5、在服务端监控面板集成客户端日志

默认是没集成客户端日志,如图


通过官网
在这里插入图片描述
我们知道要配置logging.file.path或者logging.file.name

示例配置

logging:
  file:
    path: ${LOG_FILE_PATH:/data/logs/cloud-mini-comsumer}

logback-spring相关配置如下

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
    <property name="serviceName" value="cloud-mini-comsumer"/>
    <property name="logHome" value="/data/logs/${serviceName}"/>
    <contextName>${serviceName}</contextName>

    <!--输出到控制台-->
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
        </encoder>
    </appender>

    <!--按天生成日志-->
    <appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <Prudent>true</Prudent>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>
                ${logHome}/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
            </FileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>
                %d{yyyy-MM-dd HH:mm:ss} -%msg%n
            </Pattern>
        </layout>
    </appender>

    <root level="info">
        <appender-ref ref="console"/>
        <appender-ref ref="logFile"/>
    </root>

</configuration>

我们配置后,出现日志文件按钮,点击后出现

那就很诡异,明明按官网配置了,后面排查发现,其他服务可以出现日志,他们配置日志目录底下,都会生成一个spring.log日志,那意味着只要能生成spring.log即可。于是我们调整一下logback-spring,将

 <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

调整为

 <include resource="org/springframework/boot/logging/logback/base.xml" />

然后重新访问服务端监控面板


发现有日志出来了。那为毛加了这个base.xml就有用,那是因为这个日志采集的端点是actuator/logfile。因为本文不是讲解源码,我就把相关核心源码,贴在下面,感兴趣的朋友可以根据下面提供的源码,进行debug调试

核心源码

@WebEndpoint(id = "logfile")
public class LogFileWebEndpoint {

	private static final Log logger = LogFactory.getLog(LogFileWebEndpoint.class);

	private File externalFile;

	private final LogFile logFile;

	public LogFileWebEndpoint(LogFile logFile, File externalFile) {
		this.externalFile = externalFile;
		this.logFile = logFile;
	}

	@ReadOperation(produces = "text/plain; charset=UTF-8")
	public Resource logFile() {
		Resource logFileResource = getLogFileResource();
		if (logFileResource == null || !logFileResource.isReadable()) {
			return null;
		}
		return logFileResource;
	}

	private Resource getLogFileResource() {
		if (this.externalFile != null) {
			return new FileSystemResource(this.externalFile);
		}
		if (this.logFile == null) {
			logger.debug("Missing 'logging.file.name' or 'logging.file.path' properties");
			return null;
		}
		return new FileSystemResource(this.logFile.toString());
	}

}

public class LogFile {

	/**
	 * The name of the Spring property that contains the name of the log file. Names can
	 * be an exact location or relative to the current directory.
	 * @deprecated since 2.2.0 in favor of {@link #FILE_NAME_PROPERTY}
	 */
	@Deprecated
	public static final String FILE_PROPERTY = "logging.file";

	/**
	 * The name of the Spring property that contains the directory where log files are
	 * written.
	 * @deprecated since 2.2.0 in favor of {@link #FILE_PATH_PROPERTY}
	 */
	@Deprecated
	public static final String PATH_PROPERTY = "logging.path";

	/**
	 * The name of the Spring property that contains the name of the log file. Names can
	 * be an exact location or relative to the current directory.
	 * @since 2.2.0
	 */
	public static final String FILE_NAME_PROPERTY = "logging.file.name";

	/**
	 * The name of the Spring property that contains the directory where log files are
	 * written.
	 * @since 2.2.0
	 */
	public static final String FILE_PATH_PROPERTY = "logging.file.path";

	private final String file;

	private final String path;

	/**
	 * Create a new {@link LogFile} instance.
	 * @param file a reference to the file to write
	 */
	LogFile(String file) {
		this(file, null);
	}

	/**
	 * Create a new {@link LogFile} instance.
	 * @param file a reference to the file to write
	 * @param path a reference to the logging path to use if {@code file} is not specified
	 */
	LogFile(String file, String path) {
		Assert.isTrue(StringUtils.hasLength(file) || StringUtils.hasLength(path), "File or Path must not be empty");
		this.file = file;
		this.path = path;
	}

	/**
	 * Apply log file details to {@code LOG_PATH} and {@code LOG_FILE} system properties.
	 */
	public void applyToSystemProperties() {
		applyTo(System.getProperties());
	}

	/**
	 * Apply log file details to {@code LOG_PATH} and {@code LOG_FILE} map entries.
	 * @param properties the properties to apply to
	 */
	public void applyTo(Properties properties) {
		put(properties, LoggingSystemProperties.LOG_PATH, this.path);
		put(properties, LoggingSystemProperties.LOG_FILE, toString());
	}

	private void put(Properties properties, String key, String value) {
		if (StringUtils.hasLength(value)) {
			properties.put(key, value);
		}
	}

	@Override
	public String toString() {
		if (StringUtils.hasLength(this.file)) {
			return this.file;
		}
		return new File(this.path, "spring.log").getPath();
	}

加了那个logback-base可以的原因是,点开base.xml

6、客户端与注册中心集成

说实话spring-boot-admin我看过的,基本上都是用在微服务场景比较多,因此后面的内容,我以集成注册中心为核心来讲解示例,通过url配置服务端监控地址就不再论述。

a、 在客户端项目的pom引入eureka-client GAV

 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

b、 配置eureka 客户端相关信息

eureka:
  instance:
    instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${spring.application.instance_id:${random.uuid}}
    prefer-ip-address: ${PREFER_IP:false}  #是否选择IP注册
 #   ip-address: ${IP_ADDRESS:localhost}   #指定IP地址注册
    lease-renewal-interval-in-seconds: 5  #续约更新时间间隔(默认30秒),使得eureka及时剔除无效服务
    lease-expiration-duration-in-seconds: 10 #续约到期时间(默认90秒)
    hostname: ${HOSTNAME:${spring.application.name}}
    metadata-map:
      ipAddress: ${spring.cloud.client.ip-address}
      management:
        address: ${spring.cloud.client.ip-address}
  client:
    service-url:
      defaultZone: ${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE:http://localhost:8761/eureka/}
      #缩短延迟向服务端注册的时间、默认40s
    initial-instance-info-replication-interval-seconds: 10
    #提高Eureka-Client端拉取Server注册信息的频率,默认30s
    registry-fetch-interval-seconds: 5

注: 客户端和服务端集成的eureka地址必须得同一个

客户端和服务端同时配置好注册中心后,我们访问一下服务端监控面板


和用url配置服务端地址的效果一样,到这边大体就差不多了。但是实际使用,没那么简单。我们列举几种场景

场景一:客户端的默认端点不是actuator

因为公司有时候会有等保要求,正常是不能直接暴露actuator端点,所以我们客户端,可能会将端点路径改个名字,比如改成如下

management:
  endpoints:
    web:
      base-path: ${MONINTOR_BASE_PATH:/lyb-geek}
      exposure:
        include: "*"

此时通过服务端监控面板访问

会发现爆红了,点击爆红的面板进去

健康检测404,我们可以通过配置注册中心的元数据,示例如下

eureka:
  instance:
    metadata-map:
      management:
        context-path: ${management.endpoints.web.base-path:/actuator}

此时我们再访问服务端监控面板


发现可以正常访问了。

场景二:客户端的actuator需要认证才能访问

当我们没有通过认证,直接访问服务端监控面板时



会出现401,未授权访问,此时我们在注册中心配置形如下内容

eureka:
  instance:
    metadata-map:
      user.name: ${spring.security.user.name}
      user.password: ${spring.security.user.password}

访问服务端监控面板

已经可以正常访问

场景三:客户端通过hostName注册到注册中心,服务端监控面板只显示一个实例

这个场景出现在容器化部署,因为此时hostName和port都一样,因此这个客户端就被当成是同一个。此时通过如下配置

eureka:
  instance:
    metadata-map:
      management:
        address: ${spring.cloud.client.ip-address}

通过配置management.address指定ip

注: 想知道spring-boot-admin可以支持哪些注册中心元数据,可以查看官网
https://docs.spring-boot-admin.com/current/server.html


也看可以查看源码

de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter

如何为spring-boot-admin集成告警

以集成邮件告警为例,在服务端的POM引入邮件发送的GAV

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>

在服务端的application.yml配置邮件发送配置

spring:
  mail:
    host: ${MAIL_HOST:邮箱服务器地址}
    port:
    username: ${MAIL_USERNAME:邮箱服务器用户名}
    password: ${MAIL_PWD:邮箱服务器密码}
    protocol: ${MAIL_PROTOCOL:smtp}
    default-encoding: UTF-8
    properties:
      mail.smtp.auth: true
      mail.smtp.starttls.enable: true
      mail.smtp.starttls.required: true
      mail.smtp.socketFactory.port: ${MAIL_SMTP_SOCKETFACTORY_PORT:465}
      mail.smtp.socketFactory.class: javax.net.ssl.SSLSocketFactory
      mail.smtp.socketFactory.fallback: false
      mail.smtp.ssl.protocols: ${MAIL_SMTP_SSL_PROTOCOLS:TLSv1}

配置邮件通知接收人和发送人

spring:
  boot:
    admin:
      notify:
        mail:
          to: ${NOTIFY_MAIL_TO:邮箱接收人,多个用,隔开}
          from: ${NOTIFY_MAIL_FROM:邮箱发送人}

当客户端出现异常时,会收到形如下告警

更多告警的玩法可以参考官网
https://docs.spring-boot-admin.com/current/server-notifications.html

总结

spring-boot-admin其实核心就做了一件事,就是把Spring Boot Actuators 可视化。本文就不提供demo了,因为官网文档写得很详细,大部分内容都可以从官网找到https://docs.spring-boot-admin.com/current/。除了那个日志稍微有点坑

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/976734.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Linux之NFS服务器

目录 Linux之NFS服务器 简介 NFS背景介绍 生产应用场景 NFS工作原理 NFS工作流程图 流程 NFS的安装 安装nfs服务 安装rpc服务 启动rpcbind服务同时设置开机自启动 启动nfs服务同时设置开机自启动 NFS的配置文件 主配置文件分析 示例 案例 --- 建立NFS服务器&#…

4、QT中的网络编程

一、Linux中的网络编程 1、子网和公网的概念 子网网络&#xff1a;局域网&#xff0c;只能进行内网的通信公网网络&#xff1a;因特网&#xff0c;服务器等可以进行远程的通信 2、网络分层模型 4层模型&#xff1a;应用层、传输层、网络层、物理层 应用层&#xff1a;用户自…

C++核心基础教程之STL容器详解 vector容器的概述 vector常见的API

容器作用域迭代器 就是定义一个迭代器&#xff0c;迭代器的名称叫it 保存起始迭代器 *it int 相当与取内容&#xff0c;像指针&#xff0c;但不是指针&#xff0c;因为底层很多细节 vector 一次开辟两倍原来的空间 另辟空间 迭代器右边是开区间&#xff0c;不包含右端…

sql中的排序函数dense_rank(),RANK()和row_number()

dense_rank()&#xff0c;RANK()和row_number()是SQL中的排序函数。 为方便后面的函数差异比对清晰直观&#xff0c;准备数据表如下&#xff1a; 1.dense_rank() 函数语法&#xff1a;dense_rank() over( order by 列名 【desc/asc】) DENSE_RANK()是连续排序&#xff0c;比如…

避雷,软件测试常见的误区之一

随着软件规模的不断扩大&#xff0c;软件设计的复杂程度不断提高&#xff0c;软件开发中出现错误或缺陷的机会越来越多。同时&#xff0c;市场对软件质量重要性的认识逐渐增强。所以&#xff0c;软件测试在软件项目实施过程中的重要性日益突出。但是&#xff0c;现实情况是&…

RS-485/RS-422收发器电路 DP3085 国产低成本替代MAX3085

DP3085是5V、半双工、15kV ESD 保护的 RS-485/RS-422 收发器电路&#xff0c;电路内部包含一路驱动器和一路接收器。 DP3085具有增强的摆率限制&#xff0c;助于降低输出 EMI 以及不匹配的终端连接引起的反射&#xff0c;实现 500kbps 的无误码数据传输。 DP3085芯片接收器输入…

Uniapp学习之从零开始写一个简单的小程序demo(新建页面,通过导航切换页面,发送请求)

先把官网文档摆在这&#xff0c;后面会用到的 [uniapp官网文档]: https://uniapp.dcloud.net.cn/vernacular.html# 一、开发工具准备 1-1 安装HBuilder 按照官方推荐&#xff0c;先装一个HBuilder 下载地址&#xff1a; https://www.dcloud.io/hbuilderx.html1-2 安装微信开…

论文复现--VideoTo3dPoseAndBvh(视频转BVH和3D关键点开源项目)

分类&#xff1a;动作捕捉 github地址&#xff1a;https://github.com/HW140701/VideoTo3dPoseAndBvh 所需环境&#xff1a; Windows10&#xff0c;CUDA11.6&#xff0c;conda 4.13.0&#xff1b; 目录 环境搭建conda list配置内容演示生成文件说明 环境搭建 # 创建环境 conda…

淘宝天猫API技术解析,实现关键词搜索淘宝商品(商品详情接口等)批量获取,可高并发

淘宝和天猫提供了官方API接口&#xff0c;开发者可以通过这些接口获取商品信息、进行交易操作等。下面我将简要介绍如何使用淘宝API进行关键词搜索商品并批量获取商品详情。 首先&#xff0c;需要了解淘宝API的几个主要接口&#xff1a; 搜索接口&#xff1a;用于根据关键词搜…

软件与系统安全复习

软件与系统安全复习 课程复习内容 其中 软件与系统安全基础 威胁模型 对于影响系统安全的所有信息的结构化表示 本质上&#xff0c;是从安全的视角解读系统与其环境 用于理解攻击者 什么可信、什么不可信攻击者的动机、资源、能力&#xff1b;攻击造成的影响 具体场景…

Android studio实现自定义圆形进度条 带刻度进度条 计步效果 时速表 水波纹效果

目录 原文链接效果图values /layout /activity原文链接 效果图 点击重置后: 该项目总共实现了三种圆形进度条效果 CircleProgress:圆形进度条,可以实现仿 QQ 健康计步器的效果,支持配置进度条背景色、宽度、起始角度,支持进度条渐变DialProgress:类似 CircleProgress,…

linux jar包class热部署 工具 arthas安装及使用

在不改变类、方法 的前提下&#xff0c;在方法中对业务逻辑做处理 或 打日志等情况下使用。 建议线上日志调试时使用&#xff1a; arthas安装 1. 下载文件 arthas-packaging-3.7.1-bin.zip https://arthas.aliyun.com 2. 服务器安装arthas 2.1 服务器指定目录下创建目录 c…

双系统备忘

1.装了双系统&#xff0c; 找不到ubuntu,只有windows 从windows启动cmd bcdedit /set “{bootmgr}” path \EFI\ubuntu\grubx64.efi双系统分别装在两块磁盘&#xff0c; windows装在硬盘0&#xff0c; ubuntu装在硬盘1 然后启动是从硬盘0读的boot, 现在我要移除windows硬盘0…

Vue + Element UI 前端篇(一):搭建开发环境

Vue Element UI 实现权限管理系统 前端篇&#xff08;一&#xff09;&#xff1a;搭建开发环境 技术基础 开发之前&#xff0c;请先熟悉下面的4个文档 vue.js2.0中文, 优秀的JS框架vue-router, vue.js 配套路由vuex&#xff0c;vue.js 应用状态管理库Element&#xff0c;饿…

基环树和点度数相关的计数:CF1863G

https://codeforces.com/contest/1863/problem/G 首先建图&#xff0c;然后分析出交换在图上的变化&#xff0c;发现每条点最多只有一个入边标粗&#xff0c;求最终形态。 首先可以猜答案为 ∏ v ( i n v 1 ) \prod_{v}(\mathrm{in}_v 1) ∏v​(inv​1)&#xff0c;但是环…

FOXBORO P0926KP控制器

应用领域&#xff1a; FOXBORO P0926KP 控制器广泛应用于工业自动化和过程控制领域&#xff0c;包括化工、石油和天然气、电力、制造业等各种行业。 控制能力&#xff1a; 该控制器具有高性能的控制能力&#xff0c;可执行复杂的控制策略和算法&#xff0c;以确保工业过程的高…

监控 -- linux中的一些系统性能状态指令、Prometheus

目录 监控查看性能相关命令Prometheus1、安装和配置2、将 NFS服务器和LB服务器作为exporter采集数据3、在prometheus server里添加安装exporter程序的服务器 grafana出图工具 监控 监控的目的是获取数据&#xff0c;通过数据分析了解机器是否正常运行 查看性能相关命令 查看c…

R7 7840U和r7 6800u差距 锐龙R77840U和6800u对比

锐龙7 7840U 采用Zen3架构、8核心16线程&#xff0c;基准频率疑似3.3GHz&#xff0c;同样集成RDNA3架构核显Radeon 780M&#xff0c;也是12个CU单元 r7 7840U 的处理器在 Cinebench R23 中多核跑分 14825 分 选R7 7840U还是r7 6800u这些点很重要 http://www.adiannao.cn/dy r…

CMAK学习

VS中的cmake_cmake vs_今天也要debug的博客-CSDN博客 利用vs2017 CMake开发跨平台C项目实战_cmake vs2017_神气爱哥的博客-CSDN博客 【【入门】在VS中使用CMake管理若干程序】https://www.bilibili.com/video/BV1iz4y117rZ?vd_source0aeb782d0b9c2e6b0e0cdea3e2121eba

Nacos服务健康检查与服务变动事件发布源码解析

目录 1 快速入门使用2 源码解析2.1 环境准备2.2 查看实例列表源码分析2.3 nacos与zk的不同 :2.4 nacos服务发现2.5 nacos的心跳机制和服务健康检查的逻辑 1 快速入门使用 SpringCloud Nacos配置中心&#xff1a;https://blog.csdn.net/ZGL_cyy/article/details/113621565 Sprin…