Spring Boot(7)Spring Boot 注解全解析:深入理解与应用

搞个引言

在现代 Java 开发中,Spring Boot 凭借其便捷性和高效性成为了众多开发者的首选框架。而注解作为 Spring Boot 的核心特性之一,极大地简化了开发过程,提高了代码的可读性和可维护性。本文将深入探讨 Spring Boot 中几种重要的注解,帮助你全面理解它们的作用和使用场景。

一、Spring Boot 启动注解

1.1 @SpringBootApplication

@SpringBootApplication 是 Spring Boot 应用中最常用的注解之一,它是一个组合注解,包含了 @SpringBootConfiguration@EnableAutoConfiguration@ComponentScan

1.1.1 @SpringBootConfiguration

@SpringBootConfiguration 继承自 @Configuration,用于标记当前类是一个 Spring 的配置类。配置类就像是一个 XML 配置文件的 Java 版本,它可以包含多个 Bean 的定义。

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class MyApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }

    @Bean
    public MyService myService() {
        return new MyService();
    }
}

class MyService {
    public void doSomething() {
        System.out.println("Doing something...");
    }
}
1.1.2 @EnableAutoConfiguration

@EnableAutoConfiguration 是 Spring Boot 自动配置的核心注解。它会根据类路径下的依赖和配置,自动为应用配置合适的 Bean。例如,如果类路径下存在 Spring Data JPA 的依赖,Spring Boot 会自动配置数据源和 JPA 相关的 Bean。

1.1.3 @ComponentScan

@ComponentScan 用于指定 Spring 扫描组件的包路径。Spring 会自动扫描指定包及其子包下的所有带有 @Component@Service@Repository@Controller 等注解的类,并将它们注册为 Spring Bean。

1.2 @Enable* 系列注解

除了 @EnableAutoConfiguration,Spring Boot 还有许多以 @Enable 开头的注解,用于启用特定的功能。

1.2.1 @EnableScheduling

@EnableScheduling 用于启用 Spring 的定时任务功能。在配置类上添加该注解后,就可以使用 @Scheduled 注解来定义定时任务。

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@SpringBootApplication
@EnableScheduling
public class ScheduledTaskApplication {

    public static void main(String[] args) {
        SpringApplication.run(ScheduledTaskApplication.class, args);
    }

    @Scheduled(fixedRate = 5000) // 每 5 秒执行一次
    public void performTask() {
        System.out.println("Task is running...");
    }
}
1.2.2 @EnableAsync

@EnableAsync 用于启用 Spring 的异步方法执行功能。在配置类上添加该注解后,就可以使用 @Async 注解来标记异步方法。

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@SpringBootApplication
@EnableAsync
public class AsyncApplication {

    public static void main(String[] args) {
        SpringApplication.run(AsyncApplication.class, args);
    }
}

@Service
class MyAsyncService {

    @Async
    public void asyncMethod() {
        try {
            Thread.sleep(3000);
            System.out.println("Async method completed.");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

二、组件扫描与 Bean 定义注解

2.1 @Component、@Service、@Repository 和 @Controller

这些注解都用于标记一个类为 Spring 的组件,它们的区别主要在于语义上的不同。

2.1.1 @Component

@Component 是一个通用的组件注解,用于标记任何 Spring 管理的组件。当一个类没有明确的角色时,可以使用 @Component 注解。

import org.springframework.stereotype.Component;

@Component
public class MyComponent {
    public void doSomething() {
        System.out.println("MyComponent is doing something.");
    }
}
2.1.2 @Service

@Service 用于标记业务逻辑层的服务类。它是 @Component 的一个特殊化注解,主要用于表示服务层的组件。

import org.springframework.stereotype.Service;

@Service
public class UserService {
    public void saveUser() {
        System.out.println("Saving user...");
    }
}
2.1.3 @Repository

@Repository 用于标记数据访问层的类,通常用于与数据库交互的 DAO(Data Access Object)类。它也是 @Component 的一个特殊化注解,并且 Spring 会自动处理 @Repository 注解类抛出的异常。

import org.springframework.stereotype.Repository;

@Repository
public class UserRepository {
    public void saveUserToDatabase() {
        System.out.println("Saving user to database...");
    }
}
2.1.4 @Controller

@Controller 用于标记控制器类,负责处理 HTTP 请求。它也是 @Component 的一个特殊化注解,通常与 Spring MVC 框架一起使用。

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @GetMapping("/hello")
    @ResponseBody
    public String hello() {
        return "Hello, Spring Boot!";
    }
}

2.2 @Configuration 和 @Bean

2.2.1 @Configuration

@Configuration 用于标记一个类为配置类,它可以包含多个 @Bean 注解的方法,用于定义 Spring Bean。

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Bean;

@Configuration
public class AppConfig {

    @Bean
    public MyBean myBean() {
        return new MyBean();
    }
}

class MyBean {
    public void doSomething() {
        System.out.println("MyBean is doing something.");
    }
}
2.2.2 @Bean

@Bean 用于在配置类中定义一个 Bean。它可以将一个方法的返回值注册为 Spring 容器中的 Bean。

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AnotherConfig {

    @Bean
    public String myStringBean() {
        return "This is a string bean.";
    }
}

三、依赖注入注解

3.1 @Autowired

@Autowired 是 Spring 中最常用的依赖注入注解,它可以自动将 Spring 容器中的 Bean 注入到需要的地方。

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    private final UserRepository userRepository;

    @Autowired
    public UserService(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    public void saveUser() {
        userRepository.saveUserToDatabase();
    }
}

3.2 @Qualifier

当一个接口有多个实现类时,使用 @Autowired 可能会导致歧义。这时可以使用 @Qualifier 注解来指定具体要注入的 Bean。

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

interface MessageService {
    void sendMessage();
}

@Service("emailService")
class EmailService implements MessageService {
    @Override
    public void sendMessage() {
        System.out.println("Sending email...");
    }
}

@Service("smsService")
class SmsService implements MessageService {
    @Override
    public void sendMessage() {
        System.out.println("Sending SMS...");
    }
}

@Service
public class MessageSenderService {

    private final MessageService messageService;

    @Autowired
    public MessageSenderService(@Qualifier("emailService") MessageService messageService) {
        this.messageService = messageService;
    }

    public void send() {
        messageService.sendMessage();
    }
}

3.3 @Resource

@Resource 是 Java 标准的依赖注入注解,它可以根据名称或类型进行注入。默认情况下,它会根据名称进行注入。

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class ResourceInjectionService {

    @Resource(name = "emailService")
    private MessageService messageService;

    public void sendMessage() {
        messageService.sendMessage();
    }
}

四、Spring MVC 注解

4.1 @RestController

@RestController@Controller@ResponseBody 的组合注解,用于标记一个类为 RESTful 风格的控制器。它会自动将控制器方法的返回值转换为 JSON 或 XML 等格式返回给客户端。

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RestfulController {

    @GetMapping("/data")
    public String getData() {
        return "{\"name\": \"John\", \"age\": 30}";
    }
}

4.2 @RequestMapping、@GetMapping、@PostMapping 等

4.2.1 @RequestMapping

@RequestMapping 是一个通用的请求映射注解,用于将 HTTP 请求映射到控制器的方法上。它可以指定请求的路径、请求方法(如 GET、POST 等)、请求参数等。

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class RequestMappingController {

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello() {
        return "Hello, RequestMapping!";
    }
}
4.2.2 @GetMapping、@PostMapping 等

@GetMapping@PostMapping@PutMapping@DeleteMapping 等是 @RequestMapping 的简化注解,分别对应 HTTP 的 GET、POST、PUT、DELETE 请求方法。

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class SimplifiedMappingController {

    @GetMapping("/get")
    public String get() {
        return "This is a GET request.";
    }

    @PostMapping("/post")
    public String post() {
        return "This is a POST request.";
    }
}

4.3 @RequestBody 和 @RequestParam

4.3.1 @RequestBody

@RequestBody 用于将 HTTP 请求的 body 部分绑定到方法的参数上。通常用于处理 JSON 或 XML 格式的请求数据。

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

class User {
    private String name;
    private int age;

    // Getters and setters
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

@RestController
@RequestMapping("/users")
public class UserController {

    @PostMapping
    public String createUser(@RequestBody User user) {
        return "User created: " + user.getName() + ", " + user.getAge();
    }
}
4.3.2 @RequestParam

@RequestParam 用于从 HTTP 请求的参数中获取值,并绑定到方法的参数上。

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
public class SearchController {

    @GetMapping
    public String search(@RequestParam String keyword) {
        return "Searching for: " + keyword;
    }
}

五、数据访问注解

5.1 @Entity 和 @Table

5.1.1 @Entity

@Entity 用于标记一个类为 JPA 实体类,该类对应数据库中的一张表。

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;
    private double price;

    // Getters and setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
5.1.2 @Table

@Table 用于指定实体类对应的数据库表名。如果不指定,默认表名与实体类名相同。

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "products")
public class Product {
    // 同上
}

5.2 @Column 和 @Id

5.2.1 @Column

@Column 用于指定实体类的属性对应数据库表的列名。如果不指定,默认列名与属性名相同。

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Table(name = "products")
public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "product_name")
    private String name;

    private double price;

    // Getters and setters
}
5.2.2 @Id

@Id 用于标记实体类的属性为主键。

5.3 @Repository

在数据访问层,@Repository 注解用于标记 DAO 类,并且 Spring 会自动处理该类抛出的异常。

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.example.demo.entity.Product;

@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
}

六、AOP 注解

6.1 @Aspect

@Aspect 用于标记一个类为切面类,该类可以包含多个通知方法。

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LoggingAspect {

    @Before("execution(* com.example.demo.service.*.*(..))")
    public void beforeAdvice() {
        System.out.println("Before method execution...");
    }
}

6.2 @Before、@After、@Around 等

6.2.1 @Before

@Before 是一个前置通知注解,用于在目标方法执行之前执行通知方法。

6.2.2 @After

@After 是一个后置通知注解,用于在目标方法执行之后执行通知方法,无论目标方法是否抛出异常。

6.2.3 @Around

@Around 是一个环绕通知注解,它可以在目标方法执行前后都进行增强处理,并且可以控制目标方法是否执行。

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AroundAspect {

    @Around("execution(* com.example.demo.service.*.*(..))")
    public Object aroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("Before method execution...");
        Object result = joinPoint.proceed();
        System.out.println("After method execution...");
        return result;
    }
}

七、总结

Spring Boot 中的注解为开发者提供了强大而便捷的功能呀,通过合理使用这些注解,可以大大简化开发过程,提高代码的质量和可维护性。你学费啦吗!

✍结尾

🀙🀚🀛🀜🀝🀞🀟🀠🀡🀐🀑🀒🀓🀔🀕🀖🀘🀗🀏🀎🀍🀌🀋🀊🀉🀈🀇🀆🀅🀃🀂🀁🀀🀄︎🀢🀣🀥🀤🀦🀧🀨🀩🀪

📘 妹妹听后点了点头,脸上露出了满意的笑容。她轻声说道:“原来如此,谢谢你,鸽鸽。看来我不仅要多读书,还要多动手实践,提升自己才行。”

看着她那充满求知欲的眼神,我不禁感叹,学习之路虽然充满挑战,但有这样一位美丽聪慧的伙伴相伴,一切都变得格外有意义。快去和妹妹一起实践一下吧!

求赞图

📘相关阅读⚡⚡

笔者 綦枫Maple 的其他作品,欢迎点击查阅哦~:
📚Jmeter性能测试大全:Jmeter性能测试大全系列教程!持续更新中!
📚UI自动化测试系列: Selenium+Java自动化测试系列教程❤
📚移动端自动化测试系列:Appium自动化测试系列教程
📚Postman系列:Postman高级使用技巧系列


👨‍🎓作者:綦枫Maple
🚀博客:CSDN、掘金等
🚀CSDN技术社区:https://bbs.csdn.net/forums/testbean
🚀网易云音乐:https://y.music.163.com/m/user?id=316706413
🚫特别声明:原创不易,转载请附上原文出处链接和本文声明,谢谢配合。
🙏版权声明:文章里可能部分文字或者图片来源于互联网或者百度百科,如有侵权请联系处理。
🀐其他:若有兴趣,可以加文章结尾的Q群,一起探讨学习哦~

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【在idea中配置两个不同端口,同时运行两个相同的主程序springboot】

step1&#xff1a; step2&#xff1a; step3&#xff1a;指定端口号&#xff0c;点击apply 经过以上步骤后&#xff0c;idea下面就会出现service选项 启动两个springboot就完成了&#xff08;我的启动失败是因为redis没有启动&#xff0c;springboot没有连接到redis报错&a…

基于Flask的全国婚姻关系数据可视化分析系统的设计与实现

【FLask】基于Flask的全国婚姻关系数据可视化分析系统的设计与实现&#xff08;完整系统源码开发笔记详细部署教程&#xff09;✅ 目录 一、项目简介二、项目界面展示三、项目视频展示 一、项目简介 该系统采用Python作为后端开发语言&#xff0c;结合Flask后端框架和Bootstra…

基于Kotlin中Flow扩展重试方法

最近项目中统一采用Kotlin的Flow来重构了网络请求相关代码。 目前的场景是&#xff0c;接口在请求的时候需要一个accessToken值&#xff0c;因为此值会过期或者不存在&#xff0c;需要刷新&#xff0c;因此最终方案是在使用Flow请求的时候先获取accessToken值然后再进行接口请求…

达梦 跟踪日志诊断

目录标题 参考连接**性能诊断&#xff1a;跟踪日志诊断****总结** 参考连接 性能诊断 -> 跟踪日志诊断 性能诊断&#xff1a;跟踪日志诊断 备份现有的日志配置文件 在修改文件之前&#xff0c;建议先备份原始文件&#xff0c;以防万一需要恢复。 cp /opt/dmdbms/dmdata/DA…

RFID智能仓储管理系统:助力仓储数字化升级

​在现代物流与仓储管理中&#xff0c;RFID智能仓储管理系统凭借其高效、精准的特点&#xff0c;已成为企业提升仓库运作效率的重要工具。结合RFID仓库管理、RFID库存管理及智能仓储管理系统等技术&#xff0c;RFID智能仓储解决方案能够实现仓储全流程的自动化与智能化&#xf…

AI 编程私有化部署,在使用 cline 时,可能无法避免私隐的泄漏问题

摘录&#xff1a;Cline Privacy Policy https://github.com/cline/cline/blob/main/docs/PRIVACY.md Key Points Cline operates entirely client-side as a VS Code extensionNo code or data is collected, stored, or transmitted to Clines servers 问题是&#xff1a…

【进阶】MySQL高级篇超详讲解!!!

Mysql服务器内部架构&#xff08;了解&#xff09; 连接层 负责客户端的链接&#xff0c;验证账号密码等授权认证 服务层 对sql进行解析&#xff0c;优化&#xff0c;调用函数&#xff0c;如果是查询操作&#xff0c;有没有缓存等操作。 引擎层 是真正负责数据存储和提取…

【学术投稿-第四届智能电网和绿色能源国际学术会议(ICSGGE 2025)】CSS基本选择器详解:掌握基础,轻松布局网页

可线上 官网&#xff1a;www.icsgge.org 时间&#xff1a;2025年2月28-3月2日 目录 前言 一、基本选择器简介 1. 元素选择器&#xff08;Type Selector&#xff09; 基本语法 示例 注意事项 2. 类选择器&#xff08;Class Selector&#xff09; 基本语法 示例 注意…

编程题-字母异位词分组(中等-重点)

题目&#xff1a; 给你一个字符串数组&#xff0c;请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。 字母异位词 是由重新排列源单词的所有字母得到的一个新单词。 解法一&#xff08;for循环遍历-时间复杂度超限&#xff09;&#xff1a; 由于互为字母异位词的…

Spring Boot整合DeepSeek实现AI对话(API调用和本地部署)

本篇文章会分基于DeepSeek开放平台上的API&#xff0c;以及本地私有化部署DeepSeek R1模型两种方式来整合使用。 本地化私有部署可以参考这篇博文 全面认识了解DeepSeek利用ollama在本地部署、使用和体验deepseek-r1大模型 Spring版本选择 根据Spring官网的描述 Spring AI是一…

阿里云IOT消息处理

文章主要讲述了阿里云IOT平台如何处理设备上报的消息、如何将消息路由到不同的处理逻辑、如何进行消息转发与转换等操作。 一、接收IOT消息 1.创建订阅 2.案列代码 官网案例代码&#xff1a;如何将AMQP JMS客户端接入物联网平台接收消息_物联网平台(IoT)-阿里云帮助中心 代码…

YOLO11网络结构以及改进1

YOLO11 1.YOLO11网络结构图在哪里&#xff1f;2.对应的网络结构图3.每一个模块详解3.1 Conv模块3.2关于卷积模块3.3 关于给各个模块指定参数的细节 4.加入CBAM 1.YOLO11网络结构图在哪里&#xff1f; 2.对应的网络结构图 3.每一个模块详解 3.1 Conv模块 位置&#xff1a;ultr…

数据结构——队列、哈希存储(2025.2.11)

目录 一、队列 1.定义 2.应用 3.分类 &#xff08;1&#xff09;逻辑结构 &#xff08;2&#xff09;物理结构 顺序队列 链式队列 二、哈希存储 1.定义 2.哈希冲突 &#xff08;1&#xff09;开放定址法 &#xff08;2&#xff09;再哈希法 &#xff08;3&#xf…

鸿蒙Next开发-添加水印以及点击穿透设置

在鸿蒙Next中&#xff0c;为App全局添加水印可以通过以下方式实现&#xff0c;其中通过窗口添加水印是一种常见且高效的方式。以下是具体方案和实现细节&#xff1a; 一、全局水印的实现方式 1. 窗口叠加水印&#xff08;首选、推荐&#xff09; 原理&#xff1a;在应用的主窗口…

C++算法竞赛基础语法-9

快速排序是一种高效的排序算法&#xff0c;由C. A. R. Hoare在1960年提出&#xff0c;基本思想是分治法&#xff08;Divide and Conquer&#xff09;策略&#xff0c;通过递归将一个大问题分解为若干个较小的子问题&#xff0c;然后合并这些子问题的解来解决原始问题 快速排序…

DeepSeek v3 技术报告阅读笔记

注 本文参考 DeepSeek-v3 / v2 / v1 Technical Report 及相关参考模型论文本文不包括基础的知识点讲解&#xff0c;为笔记/大纲性质而非教程&#xff0c;建议阅读技术报告原文交流可发送至邮箱 henryhua0721foxmail.com 架构核心 核心&#xff1a; MLA 高效推理DeepSeekMOE 更…

jemalloc 5.3.0的base模块的源码及调用链使用场景的详细分析

一、背景 这篇博客&#xff0c;我们继续之前的 由jemalloc 5.3.0初始化时的内存分配的分析引入jemalloc的三个关键概念及可借鉴的高性能编码技巧-CSDN博客 博客里对初始化分配逻辑进行分析&#xff0c;已经涉及到了jemalloc 5.3.0里的非常重要的base模块的一部分逻辑&#xff…

从零搭建微服务项目(第5章——SpringBoot项目LogBack日志配置+Feign使用)

前言&#xff1a; 本章主要在原有项目上添加了日志配置&#xff0c;对SpringBoot默认的logback的配置进行了自定义修改&#xff0c;并详细阐述了xml文件配置要点&#xff08;只对日志配置感兴趣的小伙伴可选择直接跳到第三节&#xff09;&#xff0c;并使用Feign代替原有RestT…

2024最新版JavaScript逆向爬虫教程-------基础篇之Chrome开发者工具学习

目录 一、打开Chrome DevTools的三种方式二、Elements元素面板三、Console控制台面板四、Sources面板五、Network面板六、Application面板七、逆向调试技巧 7.1 善用搜索7.2 查看请求调用堆栈7.3 XHR 请求断点7.4 Console 插桩7.5 堆内存函数调用7.6 复制Console面板输出 工…

Elasticsearch+Logstash+Kibana可视化集群部署

文章目录 1.组件介绍简述2.集群规划3.Es组件部署4.Logstash组件部署5.Kibana组件部署6.Kibana的基础使用 1.组件介绍简述 Elasticsearch&#xff1a;开源实时分布式搜索和分析引擎&#xff0c;支持大规模数据存储和高吞吐量&#xff0c;提供丰富的搜索功能和可扩展性。 Logsta…