当前位置: 首页 > news >正文

ShardingSphere水平、垂直分库、分表和公共表

目录

  • 一、ShardingSphere简介
  • 二、ShardingSphere-分库分表
    • 1、垂直拆分
      • (1)垂直分库
      • (2)垂直分表
    • 2、水平拆分
      • (1)水平分库
      • (2)水平分表
  • 三、水平分库操作
    • 1、创建数据库和表
    • 2、配置分片的规则
    • 3、测试类
  • 四、水平分表操作
    • 1、引入依赖
    • 2、创建数据库、表
    • 3、分片策略
    • 4、编写代码实现
      • (1)实体类
      • (2)编写Mapper
      • (3)启动类修改(添加扫描mapper的入口)
      • (4)测试类(采用springboot给我们提供的)
  • 五、垂直分库/分表操作
    • 1、创建数据库、表
    • 2、分片策略
    • 3、编写代码实现
      • (1)创建User实体类
      • (2)Mapper
    • 4、测试
  • 六、公共表
    • 1、概念
    • 2、实现
      • (1)在三个数据库中创建公共表
      • (2)公共表的配置
      • (3)测试代码
    • 3、相关问题及解决方法
      • (1)Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'null' in 'class com.chenxin.shardingsphere.entity.Udict'

一、ShardingSphere简介

Apache ShardingSphere 是一个开源的分布式数据库中间件解决方案组成的生态圈,且它的产品有Sharding-JDBC和Sharding-Proxy组成(他们两个之间是独立的),同时又能混合部署(组合起来一起使用)。它们都提供了标准化的数据分片、分布式事务和数据库的治理能力,可适用如Java、云原生开发的应用场景。

ShardingSphere定位是关系型数据库中间件,目的是充分为了合理地在分布式的场景下利用关系型数据库的计算能力和存储能力,而不是实现一个全新的关系型数据库。

二、ShardingSphere-分库分表

1、垂直拆分

(1)垂直分库

垂直分库:把单一的数据库按照业务的不同进行划分(专库专表)
在这里插入图片描述

(2)垂直分表

操作数据库中的某张表,我们把这张表里面的一部分字段拿出来存储到一张新的表里,剩下的字段放在另一张表里。

在这里插入图片描述

2、水平拆分

(1)水平分库

水平分库相当于把数据库水平切割,原来一个表中的数据可能会分配到不同的数据库中,这就是水平分库。
在这里插入图片描述

(2)水平分表

水平分表就是把表中的数据进行了水平切割,意味着按照行进行切割,也就是说不同行的数据被切割后可能在不同的表中。
在这里插入图片描述

三、水平分库操作

1、创建数据库和表

-- 创建两个数据库
CREATE DATABASE edu_db_1;
CREATE DATABASE edu_db_2;
-- 需要在两个数据库中都执行下面的脚本
CREATE TABLE course_1(cid BIGINT(20) PRIMARY KEY,cname VARCHAR(20) NOT NULL,user_id BIGINT(20) NOT NULL,cstatus VARCHAR(20) NOT NULL
);CREATE TABLE course_2(cid BIGINT(20) PRIMARY KEY,cname VARCHAR(20) NOT NULL,user_id BIGINT(20) NOT NULL,cstatus VARCHAR(20) NOT NULL
);

2、配置分片的规则

spring.shardingsphere.datasource.names=ds-1,ds-2spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/edu_db_1?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-1.username=root
spring.shardingsphere.datasource.ds-1.password=rootspring.shardingsphere.datasource.ds-2.jdbc-url=jdbc:mysql://localhost:3306/edu_db_2?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-2.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-2.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-2.username=root
spring.shardingsphere.datasource.ds-2.password=rootspring.main.allow-bean-definition-overriding=truespring.shardingsphere.sharding.tables.course.actual-data-nodes=ds-$->{1..2}.course_$->{1..2}spring.shardingsphere.sharding.tables.course.key-generator.column=cid
spring.shardingsphere.sharding.tables.course.key-generator.type=SNOWFLAKEspring.shardingsphere.sharding.tables.course.table-strategy.inline.sharding-column=cid
spring.shardingsphere.sharding.tables.course.table-strategy.inline.algorithm-expression=course_$->{cid % 2 + 1}spring.shardingsphere.sharding.tables.course.database-strategy.inline.sharding-column=user_id
spring.shardingsphere.sharding.tables.course.database-strategy.inline.algorithm-expression=ds-$->{user_id % 2 + 1}spring.shardingsphere.props.sql.show=true

3、测试类

// ------------- 测试分库 ---------------------@Testvoid addCorseFpdb() {Course course = new Course();course.setCname("java01");// 根据user_id进行分库,偶数是在edu_db_1,基数是在edu_db_2course.setUserId(100L);course.setCstatus("已启用");courseMapper.insert(course);}

四、水平分表操作

1、引入依赖

<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>1.1.17</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><dependency><groupId>org.apache.shardingsphere</groupId><artifactId>sharding-jdbc-spring-boot-starter</artifactId><version>4.0.0</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.0.5</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
</dependencies>

2、创建数据库、表

create table course_1(cid bigint(20) primary key,cname varchar(20) not null,user_id bigint(20) not null,cstatus varchar(20) not null
);create table course_2(cid bigint(20) primary key,cname varchar(20) not null,user_id bigint(20) not null,cstatus varchar(20) not null
);

3、分片策略

spring.shardingsphere.datasource.names=ds-0spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/course_db?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-0.username=root
spring.shardingsphere.datasource.ds-0.password=rootspring.main.allow-bean-definition-overriding=truespring.shardingsphere.sharding.tables.course.actual-data-nodes=ds-0.course_$->{1..2}spring.shardingsphere.sharding.tables.course.key-generator.column=cid
spring.shardingsphere.sharding.tables.course.key-generator.type=SNOWFLAKEspring.shardingsphere.sharding.tables.course.table-strategy.inline.sharding-column=cid
spring.shardingsphere.sharding.tables.course.table-strategy.inline.algorithm-expression=course_$->{cid % 2 + 1}spring.shardingsphere.props.sql.show=true

4、编写代码实现

(1)实体类

import lombok.Data;
import lombok.ToString;@Data
@ToString
public class Course {private Long cid;private String cname;private Long userId;private String cstatus;
}

(2)编写Mapper

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenxin.shardingsphere.entity.Course;
import org.apache.ibatis.annotations.Mapper;@Mapper
public interface CourseMapper extends BaseMapper<Course> {
}

(3)启动类修改(添加扫描mapper的入口)

@SpringBootApplication
@MapperScan("com.chenxin.shardingsphere.mapper")
public class ShardingsphereApplication {public static void main(String[] args) {SpringApplication.run(ShardingsphereApplication.class, args);}}

(4)测试类(采用springboot给我们提供的)

@SpringBootTest
class ShardingsphereApplicationTests {@ResourceCourseMapper courseMapper;@Testvoid addCourse() {Course course = null;for (int i = 0; i < 100; i++) {course = new Course();course.setCname("Java");course.setUserId(1000L);course.setCstatus("Nor1");courseMapper.insert(course);}}}

五、垂直分库/分表操作

1、创建数据库、表

CREATE DATABASE user_db;
USE user_db;
CREATE TABLE T_USER(user_id BIGINT(20) NOT NULL PRIMARY KEY,username VARCHAR(100) NOT NULL,ustatus VARCHAR(50) NOT NULL
);

2、分片策略

spring.shardingsphere.datasource.names=ds-1,ds-2,ds-3spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/edu_db_1?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-1.username=root
spring.shardingsphere.datasource.ds-1.password=rootspring.shardingsphere.datasource.ds-2.jdbc-url=jdbc:mysql://localhost:3306/edu_db_2?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-2.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-2.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-2.username=root
spring.shardingsphere.datasource.ds-2.password=rootspring.shardingsphere.datasource.ds-3.jdbc-url=jdbc:mysql://localhost:3306/user_db?serverTimezone=Asia/Shanghai&useSSL=false
spring.shardingsphere.datasource.ds-3.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.ds-3.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds-3.username=root
spring.shardingsphere.datasource.ds-3.password=rootspring.main.allow-bean-definition-overriding=true# spring.shardingsphere.sharding.tables.course.actual-data-nodes=ds-$->{1..2}.course_$->{1..2}
spring.shardingsphere.sharding.tables.t_user.actual-data-nodes=ds-$->{3}.t_userspring.shardingsphere.sharding.tables.t_user.key-generator.column=user_id
spring.shardingsphere.sharding.tables.t_user.key-generator.type=SNOWFLAKEspring.shardingsphere.sharding.tables.t_user.table-strategy.inline.sharding-column=user_id
spring.shardingsphere.sharding.tables.t_user.table-strategy.inline.algorithm-expression=t_userspring.shardingsphere.props.sql.show=true

3、编写代码实现

(1)创建User实体类

import lombok.Data;
import lombok.ToString;// 实体类添加注解
@TableName(value = "t_user")
@Data
@ToString
public class User {private Long userId;private String username;private String ustatus;
}

(2)Mapper

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenxin.shardingsphere.entity.User;
import org.apache.ibatis.annotations.Mapper;@Mapper
public interface UserMapper extends BaseMapper<User> {
}

4、测试

// ------------- 测试垂直分库 ----------------------
@Test
void addUser() {User user = new User();user.setUsername("chenxin");user.setUstatus("a");userMapper.insert(user);
}

六、公共表

1、概念

存储固定数据的表,表里面的数据很少发生变化,查询的时候经常进行关联查询

在每个数据库中创建出相同的结构的表(我们将每个数据库中共有的表成为公共表)

2、实现

(1)在三个数据库中创建公共表

CREATE TABLE t_udict(dicid bigint(20) primary key,ustatus varchar(20) not null,uvalue varchar(100) not null
);

(2)公共表的配置

spring.shardingsphere.sharding.broadcast-tables=t_udict
spring.shardingsphere.sharding.tables.t_udict.key-generator.column=dicid
spring.shardingsphere.sharding.tables.t_udict.key-generator.type=SNOWFLAKE

(3)测试代码

创建实体类

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;@Data
@ToString
@TableName(value = "t_udict")
public class Udict {private Integer dicid;private String ustatus;private String uvalue;
}

Mapper

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenxin.shardingsphere.entity.Udict;
import org.apache.ibatis.annotations.Mapper;@Mapper
public interface UdictMapper extends BaseMapper<Udict> {
}

测试代码

@Test
void addDict() {Udict udict = new Udict();udict.setUstatus("0");udict.setUvalue("已启用");udictMapper.insert(udict);
}@Test
void updateDict() {Udict udict = new Udict();udict.setDicid(792033627201339393L);udict.setUstatus("1");udict.setUvalue("未启用");udictMapper.updateById(udict);
}

3、相关问题及解决方法

(1)Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘null’ in ‘class com.chenxin.shardingsphere.entity.Udict’

问题原因
数据库中字段名和实体类中相差太大,程序自己对应不上

解决方法

// 需要在实体类指定主键是哪一个属性
@Data
@ToString
@TableName(value = "t_udict")
public class Udict {@TableIdprivate Long dicid;private String ustatus;private String uvalue;
}

相关文章:

ShardingSphere水平、垂直分库、分表和公共表

目录一、ShardingSphere简介二、ShardingSphere-分库分表1、垂直拆分&#xff08;1&#xff09;垂直分库&#xff08;2&#xff09;垂直分表2、水平拆分&#xff08;1&#xff09;水平分库&#xff08;2&#xff09;水平分表三、水平分库操作1、创建数据库和表2、配置分片的规则…...

《分布式技术原理与算法解析》学习笔记Day24

分布式缓存 在计算机领域&#xff0c;缓存是一个非常重要的、用来提升性能的技术。 什么是分布式缓存&#xff1f; 缓存技术是指用一个更快的存储设备存储一些经常用到的数据&#xff0c;供用户快速访问。 分布式缓存是指在分布式环境或者系统下&#xff0c;把一些热门数据…...

强化学习RL 02: Value-based Reinforcement Learning

DQN和TD更新算法。 目录 Review 1. Deep Q-Network(DQN) 1.1 Approximate the Q*(s,a) Function 1.2 Apply DQN to Play Game 1.3 Temporal Difference(TD) Learning 1.4 TD Learning for DQN 1.4.1 TD使用条件 condition 1.4.2 Train DQN using TD learning 1.5 summ…...

08_MySQL聚合函数

1. 聚合函数介绍什么是聚合函数聚合函数作用于一组数据&#xff0c;并对一组数据返回一个值。聚合函数类型AVG()SUM()MAX()MIN()COUNT()注意&#xff1a;聚合函数不能嵌套调用。比如不能出现类似“AVG(SUM(字段名称))”形式的调用。1.1 AVG和SUM函数可以对数值型数据使用AVG 和…...

「TCG 规范解读」词汇表

可信计算组织&#xff08;Ttrusted Computing Group,TCG&#xff09;是一个非盈利的工业标准组织&#xff0c;它的宗旨是加强在相异计算机平台上的计算环境的安全性。TCG于2003年春成立&#xff0c;并采纳了由可信计算平台联盟&#xff08;the Trusted Computing Platform Alli…...

第三阶段-03MyBatis 中使用XML映射文件详解

MyBatis 中使用XML映射文件 什么是XML映射 使用注解的映射SQL的问题&#xff1a; 长SQL需要折行&#xff0c;不方便维护动态SQL查询拼接复杂源代码中的SQL&#xff0c;不方便与DBA协作 MyBatis建议使用XML文件映射SQL才能最大化发挥MySQL的功能 统一管理SQL&#xff0c; 方…...

从0开始学python -41

Python3 命名空间和作用域 命名空间 先看看官方文档的一段话&#xff1a; A namespace is a mapping from names to objects.Most namespaces are currently implemented as Python dictionaries。 命名空间(Namespace)是从名称到对象的映射&#xff0c;大部分的命名空间都是…...

如何将Google浏览器安装到D盘(内含教学视频)

如何将Google浏览器安装到D盘&#xff08;内含教学视频&#xff09; 教学视频下载链接地址&#xff1a;https://download.csdn.net/download/weixin_46411355/87503968 目录如何将Google浏览器安装到D盘&#xff08;内含教学视频&#xff09;教学视频下载链接地址&#xff1a;…...

三战阿里测试岗,成功上岸,面试才是测试员涨薪真正的拦路虎...

第一次面试阿里记得是挂在技术面上&#xff0c;当时也是技术不扎实&#xff0c;准备的不充分&#xff0c;面试官出的面试题确实把我问的一头雾水&#xff0c;还没结束我就已经知道我挂了这次面试。 第二次面试&#xff0c;我准备的特别充分&#xff0c;提前刷了半个月的面试题…...

Java代码弱点与修复之——ORM persistence error(对象关系映射持久错误)

弱点描述 ORM persistence error, ORM 持久化错误 。表示 ORM 工具在尝试将对象保存到数据库中时出现了问题。可能的原因包括: 数据库连接错误:ORM 工具无法连接到数据库,或者连接到数据库的权限不足。数据库表结构错误:ORM 工具无法正确映射对象和数据库表之间的关系,可…...

原始GAN-pytorch-生成MNIST数据集(原理)

文章目录1. GAN 《Generative Adversarial Nets》1.1 相关概念1.2 公式理解1.3 图片理解1.4 熵、交叉熵、KL散度、JS散度1.5 其他相关&#xff08;正在补充&#xff01;&#xff09;1. GAN 《Generative Adversarial Nets》 Ian J. Goodfellow, Jean Pouget-Abadie, Yoshua Be…...

Vue下载安装步骤的详细教程(亲测有效) 1

目录 一、【准备工作】nodejs下载安装(npm环境) 1 下载安装nodejs 2 查看环境变量是否添加成功 3、验证是否安装成功 4、修改模块下载位置 &#xff08;1&#xff09;查看npm默认存放位置 &#xff08;2&#xff09;在 nodejs 安装目录下&#xff0c;创建 “node_global…...

[Android Studio] Android Studio生成数字证书,为应用签名

&#x1f7e7;&#x1f7e8;&#x1f7e9;&#x1f7e6;&#x1f7ea; Android Debug&#x1f7e7;&#x1f7e8;&#x1f7e9;&#x1f7e6;&#x1f7ea; Topic 发布安卓学习过程中遇到问题解决过程&#xff0c;希望我的解决方案可以对小伙伴们有帮助。 &#x1f4cb;笔记目…...

应用IC 卡继续教育网络管理系统前后影响因素比较

3.1 实现了继续护理教育网络化管理近年来&#xff0c;随着一些医院继续护理教育管理信息系统的建立&#xff0c;有效改进了学分档案管理模式和教学模式&#xff0c;但这些继续护理教育管理信息系统一般为局域网&#xff0c;仅能达到满足自身管理的基本需求&#xff0c;而系统如…...

Clickhouse学习(一):MergeTree概述

MergeTree一、Clickhouse表引擎概述二、MergeTree表引擎<一>、ReplacingMergeTree引擎<二>、SummingMergeTree引擎<三>、AggregatingMergeTree引擎三、MergeTree分区一、Clickhouse表引擎概述 MergeTree表引擎:允许根据日期和主键创建索引 1、ReplacingMerge…...

Windows离线安装rust

目前rust安装常用的方式就是通过Rustup安装&#xff0c;此安装方式需要访问互联网。在生产环境中由于网络限制&#xff0c;不能直接访问互联网或者不能访问目标网站&#xff0c;这时候需要用离线安装的方式&#xff0c;本文将详细介绍离线安装步骤&#xff0c;并给出了vscode如…...

Android与flutter混合开发

这里我使用的android studio版本是2020.3.1&#xff1b;flutter版本2.5.3。此前在网上搜索的很多教教程版本都不一样&#xff0c;新版的IDE和SDK让我遇到了很多坑故这里整理一下。一、创建项目1.在Android项目中点击File->New->New Flutter Project。File->New->Ne…...

Linux和C语言的学习方法你真的知道吗?

★Linux的使用 第一天&#xff0c;就给我们讲了为什么要先学c、学linux&#xff1a;因为嵌入式的根本就是软件驱动硬件&#xff0c;而C语言是最接近硬件的语言、有指针的概念、可以直接操作硬件&#xff0c;另外&#xff0c;功能复杂的硬件是含有操作系统的&#xff0c;这就需…...

代码随想录day42

1049. 最后一块石头的重量 II https://leetcode.cn/problems/last-stone-weight-ii/ 这个自己还是没想出来01背包对应。 本题其实就是尽量让石头分成重量相同的两堆&#xff0c;相撞之后剩下的石头最小&#xff0c;这样就化解成01背包问题了。 stones [2,7,4,1,8,1]也就是sum…...

【笔记】两台1200PLC进行S7 通信(1)

使用两台1200系列PLC进行S7通信&#xff08;入门&#xff09; 文章目录 目录 文章目录 前言 一、通信 1.概念 2.PLC通信 1.串口 2.网口 …...

进程地址空间(比特课总结)

一、进程地址空间 1. 环境变量 1 &#xff09;⽤户级环境变量与系统级环境变量 全局属性&#xff1a;环境变量具有全局属性&#xff0c;会被⼦进程继承。例如当bash启动⼦进程时&#xff0c;环 境变量会⾃动传递给⼦进程。 本地变量限制&#xff1a;本地变量只在当前进程(ba…...

Redis相关知识总结(缓存雪崩,缓存穿透,缓存击穿,Redis实现分布式锁,如何保持数据库和缓存一致)

文章目录 1.什么是Redis&#xff1f;2.为什么要使用redis作为mysql的缓存&#xff1f;3.什么是缓存雪崩、缓存穿透、缓存击穿&#xff1f;3.1缓存雪崩3.1.1 大量缓存同时过期3.1.2 Redis宕机 3.2 缓存击穿3.3 缓存穿透3.4 总结 4. 数据库和缓存如何保持一致性5. Redis实现分布式…...

postgresql|数据库|只读用户的创建和删除(备忘)

CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...

从零实现STL哈希容器:unordered_map/unordered_set封装详解

本篇文章是对C学习的STL哈希容器自主实现部分的学习分享 希望也能为你带来些帮助~ 那咱们废话不多说&#xff0c;直接开始吧&#xff01; 一、源码结构分析 1. SGISTL30实现剖析 // hash_set核心结构 template <class Value, class HashFcn, ...> class hash_set {ty…...

LLM基础1_语言模型如何处理文本

基于GitHub项目&#xff1a;https://github.com/datawhalechina/llms-from-scratch-cn 工具介绍 tiktoken&#xff1a;OpenAI开发的专业"分词器" torch&#xff1a;Facebook开发的强力计算引擎&#xff0c;相当于超级计算器 理解词嵌入&#xff1a;给词语画"…...

12.找到字符串中所有字母异位词

&#x1f9e0; 题目解析 题目描述&#xff1a; 给定两个字符串 s 和 p&#xff0c;找出 s 中所有 p 的字母异位词的起始索引。 返回的答案以数组形式表示。 字母异位词定义&#xff1a; 若两个字符串包含的字符种类和出现次数完全相同&#xff0c;顺序无所谓&#xff0c;则互为…...

return this;返回的是谁

一个审批系统的示例来演示责任链模式的实现。假设公司需要处理不同金额的采购申请&#xff0c;不同级别的经理有不同的审批权限&#xff1a; // 抽象处理者&#xff1a;审批者 abstract class Approver {protected Approver successor; // 下一个处理者// 设置下一个处理者pub…...

从“安全密码”到测试体系:Gitee Test 赋能关键领域软件质量保障

关键领域软件测试的"安全密码"&#xff1a;Gitee Test如何破解行业痛点 在数字化浪潮席卷全球的今天&#xff0c;软件系统已成为国家关键领域的"神经中枢"。从国防军工到能源电力&#xff0c;从金融交易到交通管控&#xff0c;这些关乎国计民生的关键领域…...

es6+和css3新增的特性有哪些

一&#xff1a;ECMAScript 新特性&#xff08;ES6&#xff09; ES6 (2015) - 革命性更新 1&#xff0c;记住的方法&#xff0c;从一个方法里面用到了哪些技术 1&#xff0c;let /const块级作用域声明2&#xff0c;**默认参数**&#xff1a;函数参数可以设置默认值。3&#x…...

k8s从入门到放弃之Pod的容器探针检测

k8s从入门到放弃之Pod的容器探针检测 在Kubernetes&#xff08;简称K8s&#xff09;中&#xff0c;容器探测是指kubelet对容器执行定期诊断的过程&#xff0c;以确保容器中的应用程序处于预期的状态。这些探测是保障应用健康和高可用性的重要机制。Kubernetes提供了两种种类型…...