Nacos 配置管理案例:nacos-spring-cloud-config-example详解

article/2025/8/28 1:00:27

一、结构说明:基于Spring Cloud Alibaba的微服务示例

nacos-spring-cloud-config-example :    服务提供者 

二、技术栈:Spring Boot+Spring Cloud+Spring Cloud Alibaba Nacos + Actuator(可选:监控)

三、使用环境

安装nacos参考:

Nacos 安装配置步骤详解_nacos:2.5.1 mysql-CSDN博客

Nacos 服务注册与发现参考:Nacos 服务注册发现案例:nacos-spring-cloud-example 详解-CSDN博客

  • 安装Nacos服务(nacos-server-2.5.1)
  • 确保JDK17环境(根据pom.xml中的配置)
  • Maven环境 3.6.3 +

 四、项目结构示例:

五、代码详解配置:

(1):nacos-spring-cloud-example----父pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.alibaba.nacos</groupId><artifactId>nacos-spring-cloud-example</artifactId><packaging>pom</packaging><version>0.2.0-SNAPSHOT</version><modules><module>nacos-spring-cloud-provider-example</module><module>nacos-spring-cloud-consumer-example</module></modules><properties><spring-boot.version>3.0.2</spring-boot.version><spring-cloud.version>2022.0.0</spring-cloud.version><spring-cloud-alibaba.version>2022.0.0.0</spring-cloud-alibaba.version><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target></properties><dependencyManagement><dependencies><!-- Spring Boot --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring-boot.version}</version><type>pom</type><scope>import</scope></dependency><!-- Spring Cloud --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring-cloud.version}</version><type>pom</type><scope>import</scope></dependency><!-- Spring Cloud Alibaba --><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-alibaba-dependencies</artifactId><version>${spring-cloud-alibaba.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>
</project>
(2):配置管理 nacos-spring-cloud-config-example 

1、添加依赖:pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>nacos-spring-cloud-example</artifactId><groupId>com.alibaba.nacos</groupId><version>0.2.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>nacos-spring-cloud-config-example</artifactId><dependencies><!-- Spring Boot Web 启动器 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Nacos 配置中心依赖 --><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency><!-- Spring Cloud 基础依赖提供了 Spring Cloud 的核心功能包含 @RefreshScope 等注解的支持--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-context</artifactId></dependency><!-- Spring Boot 配置处理器用于处理 @ConfigurationProperties 注解提供配置属性的元数据支持--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-configuration-processor</artifactId><optional>true</optional></dependency><!-- 添加 actuator 监控 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!-- Spring Boot 注解处理器提供 AOP 支持用于实现配置刷新等功能 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-aop</artifactId></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin><plugin><artifactId>maven-compiler-plugin</artifactId><configuration><source>17</source><target>17</target></configuration></plugin></plugins></build>
</project> 

2、配置application.yml中配置 Nacos server 的地址:

server:port: 8080spring:application:name: nacos-config-exampleprofiles:active: devconfig:import:- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml  # 主配置文件   # optional 表示配置可选,找不到也不报错- optional:nacos:common-db.yaml  # 共享配置-数据库- optional:nacos:common-redis.yaml  # 共享配置-Redis- optional:nacos:ext-config-common.yaml  # 扩展配置-通用- optional:nacos:ext-config-${spring.profiles.active}.yaml  # 扩展配置-环境特定cloud:nacos:config:server-addr: localhost:8848namespace: publicgroup: DEFAULT_GROUPfile-extension: yamlrefresh-enabled: true# actuator 配置:用于监控和管理应用程序
management:endpoints:web:exposure:include: '*'  # 开启所有监控端点endpoint:health:show-details: always # 显示详细的健康信息

通过spring:config:import:- optional:nacos:  后面跟的是dataId是在Nacos配置中心配置将 dataId 为common-db.yaml共享配置-数据库

group: DEFAULT_GROUP的配置作为配置源

3、在 Nacos 控制台配置:访问地址http://localhost:8848/nacos  默认用户名nacos 密码nacos

需要在 Nacos 控制台创建以下配置:

3.1. 主配置文件-dev环境: nacos-config-example-dev.yaml

填写好配置:点击发布即可

3.2. 主配置文件-test环境: nacos-config-example-test.yaml ,参照上述图创建如下信息:

# Data ID: nacos-config-example-test.yaml
# Group: DEFAULT_GROUP
# 配置格式选择 YAML
# 配置内容⬇️
app.config:appName: "Nacos配置管理测试"env: "测试环境"

3.3. Redis配置文件-通用: common-redis.yaml

# Data ID: common-redis.yaml
# Group: DEFAULT_GROUP
# 配置格式选择 YAML
# 配置内容⬇️
common:title: "配置中心测试"version: "1.0.0"

3.4. 数据库配置文件-通用: common-db.yaml

# Data ID: common-db.yaml
# Group: DEFAULT_GROUP
# 配置格式选择 YAML
# 配置内容⬇️
database:url: jdbc:mysql://localhost:3306/test2222username: rootpassword: 123456driverClassName: com.mysql.cj.jdbc.Driver

3.5. 扩展配置文件-通用: ext-config-common.yaml

# Data ID: ext-config-common.yaml
# Group: DEFAULT_GROUP
# 配置格式选择 YAML
# 配置内容⬇️
ext.config:timeout: 3000        # 通用超时时间maxRetry: 3          # 通用重试次数appName: "配置中心示例"  # 应用名称

3.6. 扩展配置文件-dev环境: ext-config-dev.yaml

# Data ID: ext-config-dev.yaml
# Group: DEFAULT_GROUP
# 配置格式选择 YAML
# 配置内容⬇️
ext.config:env: "开发环境"        # 环境标识debug: true          # 是否开启调试logLevel: "DEBUG"    # 日志级别

4、编写属性类

4.1.数据库属性类--DatabaseProperties

package com.alibaba.nacos.example.spring.cloud.config.properties;import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;/*** @RefreshScope:* 实现配置的动态刷新* 当配置更新时,使用此注解的类会重新注入新的配置值*/
@Component
@RefreshScope
@ConfigurationProperties(prefix = "database")// 对应配置文件中 database 前缀的配置
public class DatabaseProperties {/***  数据库地址 - 来自数据库配置*/private String url;/***  数据库用户名 - 来自数据库配置*/private String username;/***  数据库密码 - 来自数据库配置*/private String password;/***  数据库驱动程序类名称 - 来自数据库配置*/private String driverClassName;// Getters and Setterspublic String getUrl() {return url;}public void setUrl(String url) {this.url = url;}public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getDriverClassName() {return driverClassName;}public void setDriverClassName(String driverClassName) {this.driverClassName = driverClassName;}
} 

4.2.扩展配置属性类属性类--ExtConfigProperties

package com.alibaba.nacos.example.spring.cloud.config.properties;import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;/*** 扩展配置属性类* 用于映射 ext.config 前缀的配置项* 包含通用配置和环境特定配置的属性*/
@Component
@RefreshScope  // 支持配置动态刷新
@ConfigurationProperties(prefix = "ext.config")  // 对应配置文件中 ext.config 前缀的配置
public class ExtConfigProperties {/*** 应用名称 - 来自通用配置*/private String appName;/*** 超时时间 - 来自通用配置*/private Integer timeout;/*** 最大重试次数 - 来自通用配置*/private Integer maxRetry;/*** 环境标识 - 来自环境特定配置*/private String env;/*** 是否开启调试 - 来自环境特定配置*/private Boolean debug;/*** 日志级别 - 来自环境特定配置*/private String logLevel;// Getters and Setterspublic String getAppName() {return appName;}public void setAppName(String appName) {this.appName = appName;}public Integer getTimeout() {return timeout;}public void setTimeout(Integer timeout) {this.timeout = timeout;}public Integer getMaxRetry() {return maxRetry;}public void setMaxRetry(Integer maxRetry) {this.maxRetry = maxRetry;}public String getEnv() {return env;}public void setEnv(String env) {this.env = env;}public Boolean getDebug() {return debug;}public void setDebug(Boolean debug) {this.debug = debug;}public String getLogLevel() {return logLevel;}public void setLogLevel(String logLevel) {this.logLevel = logLevel;}
} 

5、配置控制器ConfigController:用于展示各种配置的获取方式和使用方法

package com.alibaba.nacos.example.spring.cloud.config.controller;import com.alibaba.nacos.example.spring.cloud.config.properties.DatabaseProperties;
import com.alibaba.nacos.example.spring.cloud.config.properties.ExtConfigProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.HashMap;
import java.util.Map;/*** 配置控制器* 用于展示各种配置的获取方式和使用方法* @RefreshScope:* 实现配置的动态刷新* 当配置更新时,使用此注解的类会重新注入新的配置值* @Value:* 注入配置值* 格式:@Value("${key:defaultValue}")* defaultValue 为配置不存在时的默认值,如果没有设置默认值:不存在是就是为空*/
@RestController
@RequestMapping("/config")
@RefreshScope  // 支持配置动态刷新
public class ConfigController {/*** 使用 @Value 注解直接注入配置项* 来自共享配置文件 nacos-config-example-dev.yaml 或 nacos-config-example-test.yaml 动态配置*/@Value("${ext.config.appName:}")private String appName;@Value("${ext.config.env:}")private String env;/*** 使用 @Value 注解直接注入配置项* 来自共享配置文件 common-redis.yaml*/@Value("${common.title:}")private String commonTitle;@Value("${common.version:}")private String commonVersion;/*** 注入扩展配置属性类* 通过 @ConfigurationProperties 方式注入的配置*/@Autowiredprivate ExtConfigProperties extConfigProperties;/*** 注入数据库配置属性类*/@Autowiredprivate DatabaseProperties databaseProperties;/*** 获取所有配置信息* 包括:通用Redis配置、环境特定配置、数据库配置等*/@GetMapping("/get")public Map<String, Object> getConfig() {Map<String, Object> config = new HashMap<>();// 应用配置   nacos-config-example-dev.yaml 或 nacos-config-example-test.yaml 动态配置Map<String, Object> applicationConfig = new HashMap<>();applicationConfig.put("applicationName", appName);applicationConfig.put("environment", env);config.put("application", applicationConfig);// 数据库配置  common-db.yamlMap<String, String> dbConfig = new HashMap<>();dbConfig.put("url", databaseProperties.getUrl());dbConfig.put("username", databaseProperties.getUsername());dbConfig.put("password", databaseProperties.getPassword());dbConfig.put("driverClassName", databaseProperties.getDriverClassName());config.put("common-db", dbConfig);// 通用配置  common-redis.yamlMap<String, Object> commonConfig = new HashMap<>();commonConfig.put("title", commonTitle);commonConfig.put("version", commonVersion);config.put("common-redis", commonConfig);// 扩展配置ext-config-common.yaml(包含通用和环境特定的配置ext-config-dev.yaml)Map<String, Object> extConfig = new HashMap<>();extConfig.put("appName", extConfigProperties.getAppName());extConfig.put("timeout", extConfigProperties.getTimeout());extConfig.put("maxRetry", extConfigProperties.getMaxRetry());extConfig.put("env", extConfigProperties.getEnv());extConfig.put("debug", extConfigProperties.getDebug());extConfig.put("logLevel", extConfigProperties.getLogLevel());config.put("extConfig", extConfig);return config;}
} 

6、测试步骤:

6.1 首先启动Nacos服务

访问地址:http://localhost:8848/nacos  

默认用户名/密码:nacos/nacos

 配置上述的数据库,reids等配置

6.2启动应用程序服务

6.3访问接口 http://localhost:8080/config/get 

返回数据成功:开始是使用的是dev环境

6.4  修改配置测试动态刷新

测试1:修改application.yml文件,换成test环境

访问接口:测试结果:配置成功------调用的是nacos-config-example-test.yaml 中的配置

测试2:在nacos配置管理:动态修改common-redis.yaml配置文件

点击发布:--->确认发布

在修改一个数据库配置:common-db.yaml  :修改数据库名为test111

修改完成后点击发布

再次访问接口:测试结果:动态修改成功

六、监控控制:用于展示 Actuator 监控功能

Spring Boot Actuator 是一个用于监控和管理应用程序的强大功能模块

Actuator 的主要作用

1、健康检查检查应用程序的健康状态监控数据库连接、磁盘空间等
2、配置信息查看查看当前应用的所有配置信息查看配置的来源和优先级
3、度量指标监控JVM 内存使用线程使用
4、HTTP 请求统计运行时信息查看运行环境系统属性环境变量
package com.alibaba.nacos.example.spring.cloud.config.controller;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.HashMap;
import java.util.Map;/*** 监控控制器* 用于展示 Actuator 监控功能*/
@RestController
@RequestMapping("/monitor")
public class MonitorController {@Autowiredprivate HealthEndpoint healthEndpoint;/*** 获取应用健康状态* 包括:* - 应用状态* - 磁盘空间* - 数据库连接* 等系统组件的状态*/@GetMapping("/health")public HealthComponent health() {return healthEndpoint.health();}/*** 获取应用基本信息* 包括:* - 应用名称* - 启动时间* - JVM 信息* - 系统信息等*/@GetMapping("/info")public Map<String, Object> info() {Map<String, Object> info = new HashMap<>();// 运行时信息Runtime runtime = Runtime.getRuntime();Map<String, Object> jvm = new HashMap<>();jvm.put("totalMemory", runtime.totalMemory());//JVM 当前总内存jvm.put("freeMemory", runtime.freeMemory());//JVM 当前可用内存jvm.put("maxMemory", runtime.maxMemory());//JVM 最大可申请内存jvm.put("availableProcessors", runtime.availableProcessors());//可用CPU核心数// 获取JVM启动参数(如 -Xmx 设置的值)RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();jvm.put("inputArguments", runtimeMxBean.getInputArguments());info.put("jvm", jvm);// 系统信息Map<String, String> system = new HashMap<>();system.put("javaVersion", System.getProperty("java.version"));//Java 版本system.put("osName", System.getProperty("os.name"));//操作系统名称system.put("osArch", System.getProperty("os.arch"));//操作系统架构system.put("osVersion", System.getProperty("os.version"));//操作系统版本info.put("system", system);return info;}
} 

接口测试---获取应用健康状态  http://localhost:8080/monitor/health

 接口测试---获取应用基本信息 :http://localhost:8080/monitor/info 

直接访问接口:查看对应的信息 

# 查看应用健康状态
http://localhost:8080/actuator/health# 查看所有配置属性
http://localhost:8080/actuator/configprops# 查看环境信息
http://localhost:8080/actuator/env# 查看所有可用的指标
http://localhost:8080/actuator/metrics# 手动刷新配置
POST 
http://localhost:8080/actuator/refresh# 查看 JVM 内存指标
http://localhost:8080/actuator/metrics/jvm.memory.used# 查看 HTTP 请求指标
http://localhost:8080/actuator/metrics/http.server.requests

http://www.hkcw.cn/article/rAHfLgHdEw.shtml

相关文章

Python训练营---Day39

知识点回顾 图像数据的格式&#xff1a;灰度和彩色数据模型的定义显存占用的4种地方 模型参数梯度参数优化器参数数据批量所占显存神经元输出中间状态 batchisize和训练的关系 作业&#xff1a;今日代码较少&#xff0c;理解内容即可 1、图像数据的格式&#xff1a;灰度和彩色数…

KeePass安装与KeePass设置中文教程

一、下载KeePass 访问官网&#xff1a;https://keepass.info 1&#xff0c;点击最新版本 2&#xff0c;下载最新版本 3&#xff0c;选择你要下载的版本 二、安装KeePass 1&#xff0c;第一步 2&#xff0c;第二步&#xff08;一直点Next&#xff09; 3&#xff0c;安装…

SQL正则表达式总结

这里写目录标题 一、元字符二、正则表达函数1、 regexp_like(x,pattern[,match_option])2、 regexp_instr(x,pattern[,start[,occurrence[,return_option[, match_option]]]]) 3、 REGEXP_SUBSTR(x,pattern[,start[,occurrence[, match_option]]]) 4、 REGEXP_REPLACE(x,patter…

2025 一带一路暨金砖国家技能发展与技术创新大赛 第一届“信创适配及安全管理赛项”样题

2025 一带一路暨金砖国家技能发展与技术创新大赛 第一届“信创适配及安全管理赛项”样题 模块A-理论知识&#xff1a;模块B-适配环境搭建&#xff1a;系统安装与配置&#xff1a;DNS 服务配置&#xff1a;DNS 服务配置&#xff1a;CA 服务配置&#xff1a;Httpd 服务配置&#…

unity编辑器扩展dll形式展示

1.背景&#xff1a;最近搞工程迁移发现一旦c#报错就会导致编辑器菜单没法使用&#xff0c;做了一些尝试发现使用dll的方式会是不错的选择。当然有些工具还是建议用外部的c#工程来写比如winform. 2.遇到的问题&#xff1a;我记得之前2017年左右的时候做一个unity的dll工程并不需…

Nacos | 三种方式的配置中心,整合Springboot3.x + yaml文件完成 0错误 自动刷新(亲测无误)

目录 ValueRefreshScope 导入配置依赖 启动类 添加 EnableDiscoveryClient 控制器 编写 yaml 文件 创建 Nacos Data Id 项目启动问题 测试 ConfigurationProperties 无感自动刷新 导入配置依赖 启动类 添加 EnableDiscoveryClient 控制器 Nacos DataID 模板映射 编…

[嵌入式实验]实验五:freeRTOS

一、实验目的 熟悉开发环境在开发板上通过freeRTOS进行LED控制 二、实验环境 硬件&#xff1a;STM32开发板、CMSIS-DAP调试工具 软件&#xff1a;STM32CubeMX软件、ARM的IDE&#xff1a;Keil C51 三、实验内容 1.实验原理 freeRTOS是一种专门设计的嵌入式实时操作系统&…

【Unity】 HTFramework框架(六十六)缺省的运行时组件检视器

更新日期&#xff1a;2025年5月29日。 Github 仓库&#xff1a;https://github.com/SaiTingHu/HTFramework Gitee 仓库&#xff1a;https://gitee.com/SaiTingHu/HTFramework 索引 一、缺省的运行时组件检视器1.自定义运行时组件检视器 二、使用缺省的运行时组件检视器1.定义组…

Ollama v0.8.0 发布,支持通过工具调用进行流式响应!

在 2025 年 5 月 29 日的 AI 技术浪潮中&#xff0c;实时交互性和高效性成为 AI 应用的核心需求。Ollama 作为一个开源的大型语言模型服务器&#xff0c;持续更新以满足开发者需求。Ollama v0.8.0 的发布特别引入了支持通过工具调用进行流式响应的功能&#xff0c;这一更新引发…

LVS+Keepalived 高可用群集

目录 一、 Keepalived 双机热备核心技术 1.1 Keepalived 架构与 VRRP协议 1.2 双机热备配置深度优化 二、 LVSKeepalived 高可用负载均衡架构 2.1 系统架构设计 2.2 LVS集成配置详解 三、 关键技术与疑难解析 3.1 DR模式 ARP 仰制机制 3.2 健康检查策略优化 四、 企业…

python + vscode 开发环境搭建

一、下载安装Python Python 官网链接Welcome to Python.org 二、Python3.12.7安装 三、Python虚拟环境 开发编译器使用Vscode 1、打开VsCode&#xff0c;键盘输入ctrl shift p 点击完了会在文件夹目录下出现一个.venv的路径。 虚拟环境的作用是隔离不同项目的 Python 环境…

[ Qt ] | QRadioButton和QCheckBox的使用

目录 QRadioButton 常用属性 clicked(bool)信号、pressed信号、released信号 小项目 QRadioButton QRadioButton是一个单选按钮&#xff0c;也是继承自QAbstractButton(继承自QWidget) 常用属性 checkable 是否能选中 checked 是否已经被选中 autoExclusive 是否排…

关于无法下载Qt离线安装包的说明

不知道出于什么原因考虑&#xff0c;Qt官方目前不提供离线的安装包下载&#xff0c;意味着网上各种文章提供的各种下载地址都失效了&#xff0c;会提示Download from your IP address is not allowed&#xff0c;当然目前可以在线安装&#xff0c;但是据说只提供了从5.15开始的…

github双重认证怎么做

引言 好久没登陆github了&#xff0c; 今天登陆github后&#xff0c;提醒进行2FA认证。 查看了github通知&#xff0c;自 2023 年 3 月起&#xff0c;GitHub 要求所有在 GitHub.com 上贡献代码的用户启用一种或多种形式的双重身份验证 (2FA)。 假如你也遇到这个问题&#xf…

多部手机连接同一wifi的ip一样吗?

在家庭和办公环境中&#xff0c;多台手机同时连接同一个WiFi路由器已成为常态。不少用户会产生疑问&#xff1a;这些设备的IP地址会相同吗&#xff1f;下面就一起来了解一下吧。 一、多部手机连接同一WiFi的IP‌一样吗 多部手机连接同一WiFi时的IP地址是否相同&#xff0c;需要…

实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.7 R语言解题

本文是实验设计与分析&#xff08;第6版&#xff0c;Montgomery著&#xff0c;傅珏生译) 第5章析因设计引导5.7节思考题5.7 R语言解题。主要涉及方差分析&#xff0c;正态假设检验&#xff0c;残差分析&#xff0c;交互作用图&#xff0c;等值线图。 dataframe <-data.frame…

如何打造一份出色的技术文档?

文章目录 每日一句正能量前言一、明确文档的目标和受众二、合理规划文档结构三、注重内容的清晰性和准确性四、持续更新和优化文档五、实用工具推荐六、案例分享示例&#xff1a;如何使用Python编写一个简单的Web应用引言背景知识安装和配置使用指南高级用法常见问题参考文献 七…

记一次 Starrocks be 内存异常宕机

突发性 be 内存飙高&#xff0c;直至被系统 kill 掉&#xff0c;be 内存如下&#xff1a;其中 starrocks_be_update_mem_bytes 指标打满&#xff0c;重启也是如此 [rootlocalhost bin]# curl -XGET -s http://192.168.1.49:8040/metrics | grep "^starrocks_be_.*_mem_b…

阿里云服务器邮件发送失败(dail tcp xxxx:25: i/o timeout)因为阿里云默认禁用 25 端口

最近在测试发送邮件的功能&#xff0c;发现了一个奇怪的问题&#xff0c;同样的 docker 镜像&#xff0c;在本地跑起来是可以正常发送邮件的&#xff0c;但是在阿里云的服务器上跑&#xff0c;就会报错 i/o timeout。 排查了一圈发现&#xff0c;原来是阿里云的操作&#xff0…

什么叫做回表?

指的是在Mysql中使用非聚簇索引&#xff0c;也就是使用二级索引进行作为条件进行查询时&#xff0c;查询了除索引之外的数据&#xff0c;需要根据获得的主键去聚簇索引&#xff0c;查询其他的所需的数据。 有表格&#xff08;id,name,age&#xff09;,进行查询select * from w…