Java，Spring Boot, Redis, 后端服务，MySQL, SQL Server
RabbitMQ 延迟消息完整指南1. 概述延迟消息是指在发送消息时指定一个延迟时间，消息不会立即投递给消费者，而是在延迟时间结束后才被投递给消费者处理。这在许多业务场景中非常有用，如订单超时处理、预约提醒、定时任务等。2. 实现方式2.1 延迟消息插件方式插件安装# 启用延迟消息插件 rabbitmq-plugins enable rabbitmq_delayed_message_exchange交换机配置@Bean public CustomExchange delayExchange() { Map<String, Object> args = new HashMap<>(); args.put("x-delayed-type", "direct"); // 指定延迟消息到期后的路由类型 return new CustomExchange("exchange.name", "x-delayed-message", true, false, args); }参数说明x-delayed-message: 交换机类型，表示这是一个延迟消息交换机x-delayed-type: 延迟消息到期后的路由类型，可选值包括：direct: 直连类型topic: 主题类型fanout: 广播类型headers: 头部类型消息发送// 发送延迟消息 MessageProperties properties = new MessageProperties(); properties.setHeader("x-delay", 5000); // 延迟5秒 Message delayedMessage = new Message(message.getBytes(), properties); rabbitTemplate.send(exchangeName, routingKey, delayedMessage);2.2 TTL + 死信队列方式当无法使用延迟消息插件时，可以使用 TTL（Time To Live）+ 死信队列的方式实现延迟消息。配置// 死信交换机 @Bean public DirectExchange deadLetterExchange() { return new DirectExchange("dead.letter.exchange"); } // 死信队列 @Bean public Queue deadLetterQueue() { return QueueBuilder.durable("dead.letter.queue") .withArgument("x-message-ttl", 5000) // 设置TTL .withArgument("x-dead-letter-exchange", "normal.exchange") // 死信转发交换机 .withArgument("x-dead-letter-routing-key", "routing.key") // 死信转发路由键 .build(); } // 绑定 @Bean public Binding deadLetterBinding() { return BindingBuilder.bind(deadLetterQueue()) .to(deadLetterExchange()) .with("dl.routing.key"); }2.3 消息级 TTL 方式在发送消息时单独设置 TTL：MessageProperties props = new MessageProperties(); props.setExpiration("5000"); // 5秒后过期 Message message = new Message(content.getBytes(), props);3. 优缺点对比方式优点缺点适用场景延迟消息插件使用简单，功能强大需要安装插件，服务器配置要求高高频延迟消息场景TTL+死信队列不需要额外插件，兼容性好配置复杂，灵活性较低对延迟精度要求不高的场景消息级TTL灵活性高不能动态修改TTL，功能有限单条消息个性化TTL需求4. 注意事项插件依赖：使用延迟消息插件方式需要确保 RabbitMQ 服务器已安装相应插件性能影响：大量延迟消息可能影响 RabbitMQ 性能可靠性：延迟消息期间若服务重启，可能导致消息丢失监控：需要监控延迟消息的处理状态，防止消息积压5. 实际应用场景订单超时处理：用户下单后一定时间内未支付则自动取消预约提醒：提前一定时间向用户发送提醒重试机制：消息处理失败后延迟重试定时任务：替代传统定时任务，更灵活高效这份文档涵盖了 RabbitMQ 延迟消息的主要知识点，希望能帮助您深入理解和应用这一重要功能。
在SQL Server中，可以使用多种方法来判断一个字符串是否为数字。以下是几种常见的方法：使用ISNUMERIC()函数ISNUMERIC()函数可以判断一个字符串是否可以转换为数字。如果字符串是数字，则返回1，否则返回0。例如：SELECT ISNUMERIC('123') AS NumberStr, -- 返回1，表示字符串是数字 ISNUMERIC('123.45') AS DecimalStr, -- 返回1，表示字符串是数字 ISNUMERIC('abc') AS NonNumericStr -- 返回0，表示字符串不是数字需要注意的是，ISNUMERIC()函数有时会返回意外的结果，例如ISNUMERIC('23e4')和ISNUMERIC('23d4')都会返回1。使用PATINDEX()函数PATINDEX()函数返回第一个满足指定模式的位置，如果没有满足的则返回0。可以使用PATINDEX()函数来判断字符串是否为纯数字。例如：SELECT CASE WHEN PATINDEX('%[^0-9]%', '123') = 0 THEN 1 ELSE 0 END AS IsNumeric, -- 返回1，表示字符串是纯数字 CASE WHEN PATINDEX('%[^0-9]%', '123.45') = 0 THEN 1 ELSE 0 END AS IsDecimal, -- 返回0，表示字符串不是纯数字 CASE WHEN PATINDEX('%[^0-9]%', 'abc') = 0 THEN 1 ELSE 0 END AS IsNonNumeric -- 返回0，表示字符串不是纯数字对于支持小数点和正负数的写法，可以使用如下模式：PATINDEX('%[^0-9|.|-|+]%', expression)使用CAST()或CONVERT()函数CAST()和CONVERT()函数可以将一个字符串转换为数字类型。如果转换成功，则表示字符串是数字，否则表示字符串不是数字。例如：SELECT CASE WHEN CAST('123' AS INT) IS NOT NULL THEN 1 ELSE 0 END AS NumberStr, -- 返回1，表示字符串是数字 CASE WHEN CAST('123.45' AS DECIMAL(10,2)) IS NOT NULL THEN 1 ELSE 0 END AS DecimalStr, -- 返回1，表示字符串是数字 CASE WHEN CAST('abc' AS INT) IS NULL THEN 0 ELSE 1 END AS NonNumericStr -- 返回0，表示字符串不是数字使用正则表达式在SQL Server中，可以使用正则表达式来判断一个字符串是否为数字。例如：SELECT CASE WHEN '123' LIKE '%[^0-9]%' THEN 0 ELSE 1 END AS NumberStr, -- 返回1，表示字符串是数字 CASE WHEN '123.45' LIKE '%[^0-9.]%' THEN 0 ELSE 1 END AS DecimalStr, -- 返回1，表示字符串是数字 CASE WHEN 'abc' LIKE '%[^0-9]%' THEN 0 ELSE 1 END AS NonNumericStr -- 返回0，表示字符串不是数字以上几种方法都可以判断一个字符串是否为数字
1. 安装 MariaDBsudo apt install -y mariadb-server mariadb-client初始化安全配置：sudo mysql_secure_installation开始安装配置：// 输入root的当前密码（如无则输入） Enter current password for root (enter for none): // Unix Socket 身份验证 建议Y切换 Switch to unix_socket authentication [Y/n] y // 更新root密码 如果root密码为空，建议Y设置新的root密码 Change the root password? [Y/n] y // 输入root的新密码 New password: // 再次输入root的新密码 Re-enter new password: // 移除匿名用户 建议删除Y Remove anonymous users? [Y/n] y // 是否禁止root远程登陆 如有需要可以开启Y Disallow root login remotely? [Y/n] n // 移除测试数据库并禁止访问 测试数据库如无需要，可以删除 Remove test database and access to it? [Y/n] y // 重新加载权限表 如果有变更，建议Y Reload privilege tables now? [Y/n] y // 出现这个提示语表示MariaDB的安全配置已完成。 All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 进入数据库并创建用户和库：sudo mysql -u root -p在 MariaDB 里执行：-- 创建数据库，并设置编码为utf8mb4,设置排序规则utf8mb4_unicode_ci CREATE DATABASE testdb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- 创建一个数据库用户devuser,只允许从localhost登陆，设置密码为devpass111 CREATE USER 'devuser'@'localhost' IDENTIFIED BY 'devpass111'; -- 授权所有权限（增删改查、建表、索引等） 作用在testdb数据库下的所有表，并把这些授权授予给devuser GRANT ALL PRIVILEGES ON testdb.* TO 'devuser'@'localhost'; -- 刷新权限 FLUSH PRIVILEGES; -- 退出 EXIT;2. 修改 MariaDB 配置文件，允许监听远程请求编辑配置文件：sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf找到：bind-address = 127.0.0.1改成：bind-address = 0.0.0.0保存退出，然后重启 MariaDB：sudo systemctl restart mariadb3. 开放防火墙端口（默认 3306）如果你启用了 ufw：sudo ufw allow 3306
关于解决项目中Lombok的注解处理器没有生效的问题
❓ 发现问题我的项目POM文件内容如下：<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.13</version> <relativePath/> </parent> <groupId>com.you</groupId> <artifactId>mfd</artifactId> <version>0.0.1-SNAPSHOT</version> <name>mfd</name> <description>mfd</description> <properties> <java.version>17</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </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> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </path> </annotationProcessorPaths> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <excludes> <exclude> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </exclude> </excludes> </configuration> </plugin> </plugins> </build> </project>以上配置，在plugin的maven-compiler-plugin中，如果注释掉configuration中的内容，即项目中的@Data注解有效，一旦将该配置释放开，即项目中的@Data就立马失效了。经过排查，发现是因为 Lombok 的注解处理器依赖没有加版本号，导致 maven-compiler-plugin 配置失效。? 根本原因我的 maven-compiler-plugin 中的配置是这样的（缺少 <version>）：<annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </path> </annotationProcessorPaths>如果没有指定 lombok 的 <version>，Maven 无法正确拉取 annotation processor，会导致编译器无法识别如 @Data、@Getter 等注解的效果，从而看起来“失效”。✅ 正确写法（推荐）<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.30</version> </path> </annotationProcessorPaths> </configuration> </plugin>? 为什么注释掉就能生效？如果你完全移除 <annotationProcessorPaths> 配置，Maven 会退回使用 Lombok 在依赖中默认的 annotation processor。但一旦你显式配置 <annotationProcessorPaths>，就只会使用你配置的那部分，如果没写版本，就等于没指定依赖，导致编译失败或无效。✅ 最佳实践建议：在 <dependencies> 中保留：<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.30</version> <scope>provided</scope> </dependency>并在 maven-compiler-plugin 中配置 annotation processor：<annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.30</version> </path> </annotationProcessorPaths>
关于SQL Server 驱动在连接加密开启时验证服务器证书失败的问题
这是一个来自 SQL Server 驱动在连接加密开启时验证服务器证书失败，错误如下：com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”。 ClientConnectionId:09fc584e-070a-4b08-bbd6-9de705bd6d21 at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3680) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:2047) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3204) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2833) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2671) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1640) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:936) ~[mssql-jdbc-10.2.3.jre8.jar:na] at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na] at com.mybatisflex.core.dialect.DbTypeUtil.getSqlserverDbType(DbTypeUtil.java:65) ~[mybatis-flex-core-1.10.9.jar:na] at com.mybatisflex.core.dialect.DbTypeUtil.getDbType(DbTypeUtil.java:48) ~[mybatis-flex-core-1.10.9.jar:na] at com.mybatisflex.core.datasource.FlexDataSource.<init>(FlexDataSource.java:62) ~[mybatis-flex-core-1.10.9.jar:na] at com.mybatisflex.core.datasource.FlexDataSource.<init>(FlexDataSource.java:52) ~[mybatis-flex-core-1.10.9.jar:na] at com.mybatisflex.spring.FlexSqlSessionFactoryBean.buildSqlSessionFactory(FlexSqlSessionFactoryBean.java:621) ~[mybatis-flex-spring-1.10.9.jar:na] at com.mybatisflex.spring.FlexSqlSessionFactoryBean.afterPropertiesSet(FlexSqlSessionFactoryBean.java:496) ~[mybatis-flex-spring-1.10.9.jar:na] at com.mybatisflex.spring.FlexSqlSessionFactoryBean.getObject(FlexSqlSessionFactoryBean.java:692) ~[mybatis-flex-spring-1.10.9.jar:na] at com.mybatisflex.spring.boot.MybatisFlexAutoConfiguration.sqlSessionFactory(MybatisFlexAutoConfiguration.java:285) ~[mybatis-flex-spring-boot-starter-1.10.9.jar:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1519) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1417) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:544) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:520) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:673) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:329) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.13.jar:2.7.13] at com.you.mfd.MfdApplication.main(MfdApplication.java:12) ~[classes/:na] Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[na:na] at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371) ~[na:na] at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314) ~[na:na] at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:309) ~[na:na] at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654) ~[na:na] at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[na:na] at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[na:na] at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) ~[na:na] at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) ~[na:na] at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) ~[na:na] at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) ~[na:na] at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[na:na] at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506) ~[na:na] at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1421) ~[na:na] at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[na:na] at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[na:na] at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1955) ~[mssql-jdbc-10.2.3.jre8.jar:na] ... 86 common frames omitted Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439) ~[na:na] at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[na:na] at java.base/sun.security.validator.Validator.validate(Validator.java:264) ~[na:na] at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:242) ~[na:na] at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:113) ~[na:na] at com.microsoft.sqlserver.jdbc.TDSChannel$HostNameOverrideX509TrustManager.checkServerTrusted(IOBuffer.java:1636) ~[mssql-jdbc-10.2.3.jre8.jar:na] at java.base/sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:1441) ~[na:na] at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638) ~[na:na] ... 98 common frames omitted Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[na:na] at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[na:na] at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[na:na] at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[na:na] ... 105 common frames omitted✅ 产生原因这是因为 SQL Server 开启了加密（SSL/TLS）连接，但 Java 客户端（JVM）：未信任 SQL Server 的 SSL 证书；或 未配置为忽略证书校验（开发阶段常用）；✅ 解决方案✅ 方法一：禁用 SSL 验证（开发测试推荐）修改 application.yml 中 JDBC URL，加上以下参数：url: jdbc:sqlserver://localhost:1433;databaseName=demo;encrypt=false如果确实需要加密连接但不验证证书（不安全，仅用于测试）：url: jdbc:sqlserver://localhost:1433;databaseName=demo;encrypt=true;trustServerCertificate=true⚠️ trustServerCertificate=true 会跳过证书验证，只在你确认环境可信时使用。✅ 方法二：将 SQL Server 的证书导入 JVM 信任库（生产推荐）导出 SQL Server 的 SSL 证书（.cer 文件）；使用 keytool 导入证书到 JVM 的 cacerts 信任库：keytool -import -alias sqlserver-cert -file sqlserver.cer -keystore $JAVA_HOME/lib/security/cacerts默认密码是：changeit✅ 示例修改将 application.yml 改成这样：spring: datasource: dynamic: primary: master strict: false datasource: master: url: jdbc:sqlserver://localhost:1433;databaseName=demo;encrypt=true;trustServerCertificate=true ... ds1: url: jdbc:sqlserver://localhost:1433;databaseName=demo_ds1;encrypt=true;trustServerCertificate=true ...
下载Redis首先去官网下载：https://redis.io/downloads/(步骤此处省略)我下载的是6.2。所以下面就以6.2为例将下载的安装包上传至服务器的目录/usr/local下(步骤此处省略)进入目录解压，执行命令tar xf redis-6.2.14.tar：[root@iZ2ze2r04br2fslxv7dx4tZ local]# tar xf redis-6.2.14.tar [root@iZ2ze2r04br2fslxv7dx4tZ local]# ls aegis bin etc games include lib lib64 libexec redis-6.2.14 redis-6.2.14.tar sbin share src安装Redis所需环境及依赖安装gcc环境：由于Redis是用C语言编写的，它的运行需要C环境，因为需要我们先安装gcc：# yum install gcc-c++ 已加载插件：fastestmirror Loading mirror speeds from cached hostfile 正在解决依赖关系 --> 正在检查事务 ---> 软件包 gcc-c++.x86_64.0.4.8.5-44.el7 将被 安装 --> 正在处理依赖关系 libstdc++-devel = 4.8.5-44.el7，它被软件包 gcc-c++-4.8.5-44.el7.x86_64 需要 --> 正在检查事务 ---> 软件包 libstdc++-devel.x86_64.0.4.8.5-44.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 ================================================================================================================================= Package 架构 版本 源 大小 ================================================================================================================================= 正在安装: gcc-c++ x86_64 4.8.5-44.el7 base 7.2 M 为依赖而安装: libstdc++-devel x86_64 4.8.5-44.el7 base 1.5 M 事务概要 ================================================================================================================================= 安装 1 软件包 (+1 依赖软件包) 总下载量：8.7 M 安装大小：25 M Is this ok [y/d/N]: y Downloading packages: (1/2): libstdc++-devel-4.8.5-44.el7.x86_64.rpm | 1.5 MB 00:00:00 (2/2): gcc-c++-4.8.5-44.el7.x86_64.rpm | 7.2 MB 00:00:00 --------------------------------------------------------------------------------------------------------------------------------- 总计 26 MB/s | 8.7 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : libstdc++-devel-4.8.5-44.el7.x86_64 1/2 正在安装 : gcc-c++-4.8.5-44.el7.x86_64 2/2 验证中 : gcc-c++-4.8.5-44.el7.x86_64 1/2 验证中 : libstdc++-devel-4.8.5-44.el7.x86_64 2/2 已安装: gcc-c++.x86_64 0:4.8.5-44.el7 作为依赖被安装: libstdc++-devel.x86_64 0:4.8.5-44.el7 完毕！ 编译并安装Redis进入到/usr/local/redis-6.2.14/目录下，运行make命令，进行编译：# make cd src && make all make[1]: 进入目录“/usr/local/redis-6.2.14/src” CC Makefile.dep make[1]: 离开目录“/usr/local/redis-6.2.14/src” make[1]: 进入目录“/usr/local/redis-6.2.14/src” rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep rm -f adlist.d quicklist.d ae.d anet.d dict.d server.d sds.d zmalloc.d lzf_c.d lzf_d.d pqsort.d zipmap.d sha1.d ziplist.d release.d networking.d util.d object.d db.d replication.d rdb.d t_string.d t_list.d t_set.d t_zset.d t_hash.d config.d aof.d pubsub.d multi.d debug.d sort.d intset.d syncio.d cluster.d crc16.d endianconv.d slowlog.d scripting.d bio.d rio.d rand.d memtest.d crcspeed.d crc64.d bitops.d sentinel.d notify.d setproctitle.d blocked.d hyperloglog.d latency.d sparkline.d redis-check-rdb.d redis-check-aof.d geo.d lazyfree.d module.d evict.d expire.d geohash.d geohash_helper.d childinfo.d defrag.d siphash.d rax.d t_stream.d listpack.d localtime.d lolwut.d lolwut5.d lolwut6.d acl.d gopher.d tracking.d connection.d tls.d sha256.d timeout.d setcpuaffinity.d monotonic.d mt19937-64.d anet.d adlist.d dict.d redis-cli.d zmalloc.d release.d ae.d crcspeed.d crc64.d siphash.d crc16.d monotonic.d cli_common.d mt19937-64.d ae.d anet.d redis-benchmark.d adlist.d dict.d zmalloc.d release.d crcspeed.d crc64.d siphash.d crc16.d monotonic.d cli_common.d mt19937-64.d (cd ../deps && make distclean) make[2]: 进入目录“/usr/local/redis-6.2.14/deps” (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (cd hdr_histogram && make clean) > /dev/null || true (rm -f .make-*) make[2]: 离开目录“/usr/local/redis-6.2.14/deps” (cd modules && make clean) make[2]: 进入目录“/usr/local/redis-6.2.14/src/modules” rm -rf *.xo *.so make[2]: 离开目录“/usr/local/redis-6.2.14/src/modules” (cd ../tests/modules && make clean) make[2]: 进入目录“/usr/local/redis-6.2.14/tests/modules” rm -f commandfilter.so basics.so testrdb.so fork.so infotest.so propagate.so misc.so hooks.so blockonkeys.so blockonbackground.so scan.so datatype.so auth.so keyspace_events.so blockedclient.so getkeys.so test_lazyfree.so timer.so defragtest.so hash.so zset.so stream.so commandfilter.xo basics.xo testrdb.xo fork.xo infotest.xo propagate.xo misc.xo hooks.xo blockonkeys.xo blockonbackground.xo scan.xo datatype.xo auth.xo keyspace_events.xo blockedclient.xo getkeys.xo test_lazyfree.xo timer.xo defragtest.xo hash.xo zset.xo stream.xo make[2]: 离开目录“/usr/local/redis-6.2.14/tests/modules” (rm -f .make-*) echo STD=-pedantic -DREDIS_STATIC='' -std=c99 >> .make-settings echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings echo OPT=-O2 >> .make-settings echo MALLOC=jemalloc >> .make-settings echo BUILD_TLS= >> .make-settings echo USE_SYSTEMD= >> .make-settings echo CFLAGS= >> .make-settings echo LDFLAGS= >> .make-settings echo REDIS_CFLAGS= >> .make-settings echo REDIS_LDFLAGS= >> .make-settings echo PREV_FINAL_CFLAGS=-pedantic -DREDIS_STATIC='' -std=c99 -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings (cd ../deps && make hiredis linenoise lua hdr_histogram jemalloc) make[2]: 进入目录“/usr/local/redis-6.2.14/deps” (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (cd hdr_histogram && make clean) > /dev/null || true (rm -f .make-*) (echo "" > .make-cflags) (echo "" > .make-ldflags) MAKE hiredis cd hiredis && make static make[3]: 进入目录“/usr/local/redis-6.2.14/deps/hiredis” cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb alloc.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb net.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb hiredis.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb sds.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb async.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb read.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb sockcompat.c ar rcs libhiredis.a alloc.o net.o hiredis.o sds.o async.o read.o sockcompat.o make[3]: 离开目录“/usr/local/redis-6.2.14/deps/hiredis” MAKE linenoise cd linenoise && make make[3]: 进入目录“/usr/local/redis-6.2.14/deps/linenoise” cc -Wall -Os -g -c linenoise.c make[3]: 离开目录“/usr/local/redis-6.2.14/deps/linenoise” MAKE lua cd lua/src && make all CFLAGS="-O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP " MYLDFLAGS="" AR="ar rc" make[3]: 进入目录“/usr/local/redis-6.2.14/deps/lua/src” cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lapi.o lapi.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lcode.o lcode.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ldebug.o ldebug.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ldo.o ldo.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ldump.o ldump.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lfunc.o lfunc.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lgc.o lgc.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o llex.o llex.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lmem.o lmem.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lobject.o lobject.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lopcodes.o lopcodes.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lparser.o lparser.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lstate.o lstate.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lstring.o lstring.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ltable.o ltable.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ltm.o ltm.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lundump.o lundump.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lvm.o lvm.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lzio.o lzio.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o strbuf.o strbuf.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o fpconv.o fpconv.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lauxlib.o lauxlib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lbaselib.o lbaselib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ldblib.o ldblib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o liolib.o liolib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lmathlib.o lmathlib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o loslib.o loslib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o ltablib.o ltablib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lstrlib.o lstrlib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o loadlib.o loadlib.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o linit.o linit.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lua_cjson.o lua_cjson.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lua_struct.o lua_struct.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lua_cmsgpack.o lua_cmsgpack.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lua_bit.o lua_bit.c ar rc liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o strbuf.o fpconv.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o lua_cjson.o lua_struct.o lua_cmsgpack.o lua_bit.o # DLL needs all object files ranlib liblua.a cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o lua.o lua.c cc -o lua lua.o liblua.a -lm cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o luac.o luac.c cc -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' -DLUA_USE_MKSTEMP -c -o print.o print.c cc -o luac luac.o print.o liblua.a -lm make[3]: 离开目录“/usr/local/redis-6.2.14/deps/lua/src” MAKE hdr_histogram cd hdr_histogram && make make[3]: 进入目录“/usr/local/redis-6.2.14/deps/hdr_histogram” cc -Wall -Os -g -c hdr_histogram.c make[3]: 离开目录“/usr/local/redis-6.2.14/deps/hdr_histogram” MAKE jemalloc cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" checking for xsltproc... false checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether compiler is cray... no checking whether compiler supports -std=gnu11... yes checking whether compiler supports -Wall... yes checking whether compiler supports -Wshorten-64-to-32... no checking whether compiler supports -Wsign-compare... yes checking whether compiler supports -Wundef... yes checking whether compiler supports -Wno-format-zero-length... yes checking whether compiler supports -pipe... yes checking whether compiler supports -g3... yes checking how to run the C preprocessor... gcc -E checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ supports C++14 features by default... no checking whether g++ supports C++14 features with -std=c++14... no checking whether g++ supports C++14 features with -std=c++0x... no checking whether g++ supports C++14 features with +std=c++14... no checking whether g++ supports C++14 features with -h std=c++14... no configure: No compiler with C++14 support was found checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking size of void *... 8 checking size of int... 4 checking size of long... 8 checking size of long long... 8 checking size of intmax_t... 8 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking whether pause instruction is compilable... yes checking number of significant virtual address bits... 48 checking for ar... ar checking for nm... nm checking for gawk... gawk checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking whether malloc_usable_size definition can use const argument... no checking for library containing log... -lm checking whether __attribute__ syntax is compilable... yes checking whether compiler supports -fvisibility=hidden... yes checking whether compiler supports -fvisibility=hidden... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether tls_model attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether alloc_size attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(gnu_printf, ...) attribute is compilable... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether format(printf, ...) attribute is compilable... yes checking for a BSD-compatible install... /usr/bin/install -c checking for ranlib... ranlib checking for ld... /usr/bin/ld checking for autoconf... false checking for memalign... yes checking for valloc... yes checking whether compiler supports -O3... yes checking whether compiler supports -O3... yes checking whether compiler supports -funroll-loops... yes checking configured backtracing method... N/A checking for sbrk... yes checking whether utrace(2) is compilable... no checking whether a program using __builtin_unreachable is compilable... yes checking whether a program using __builtin_ffsl is compilable... yes checking LG_PAGE... 12 checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_create in -lpthread... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for dlsym... no checking for dlsym in -ldl... yes checking whether pthread_atfork(3) is compilable... yes checking whether pthread_setname_np(3) is compilable... yes checking for library containing clock_gettime... none required checking whether clock_gettime(CLOCK_MONOTONIC_COARSE, ...) is compilable... yes checking whether clock_gettime(CLOCK_MONOTONIC, ...) is compilable... yes checking whether mach_absolute_time() is compilable... no checking whether compiler supports -Werror... yes checking whether syscall(2) is compilable... yes checking for secure_getenv... yes checking for sched_getcpu... yes checking for sched_setaffinity... yes checking for issetugid... no checking for _malloc_thread_cleanup... no checking for _pthread_mutex_init_calloc_cb... no checking for TLS... yes checking whether C11 atomics is compilable... no checking whether GCC __atomic atomics is compilable... yes checking whether GCC __sync atomics is compilable... yes checking whether Darwin OSAtomic*() is compilable... no checking whether madvise(2) is compilable... yes checking whether madvise(..., MADV_FREE) is compilable... no checking whether madvise(..., MADV_DONTNEED) is compilable... yes checking whether madvise(..., MADV_DO[NT]DUMP) is compilable... yes checking whether madvise(..., MADV_[NO]HUGEPAGE) is compilable... yes checking whether to force 32-bit __sync_{add,sub}_and_fetch()... no checking whether to force 64-bit __sync_{add,sub}_and_fetch()... no checking for __builtin_clz... yes checking whether Darwin os_unfair_lock_*() is compilable... no checking whether Darwin OSSpin*() is compilable... no checking whether glibc malloc hook is compilable... yes checking whether glibc memalign hook is compilable... yes checking whether pthreads adaptive mutexes is compilable... yes checking whether compiler supports -D_GNU_SOURCE... yes checking whether compiler supports -Werror... yes checking whether compiler supports -herror_on_warning... no checking whether strerror_r returns char with gnu source is compilable... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes configure: creating ./config.status config.status: creating Makefile config.status: creating jemalloc.pc config.status: creating doc/html.xsl config.status: creating doc/manpages.xsl config.status: creating doc/jemalloc.xml config.status: creating include/jemalloc/jemalloc_macros.h config.status: creating include/jemalloc/jemalloc_protos.h config.status: creating include/jemalloc/jemalloc_typedefs.h config.status: creating include/jemalloc/internal/jemalloc_preamble.h config.status: creating test/test.sh config.status: creating test/include/test/jemalloc_test.h config.status: creating config.stamp config.status: creating bin/jemalloc-config config.status: creating bin/jemalloc.sh config.status: creating bin/jeprof config.status: creating include/jemalloc/jemalloc_defs.h config.status: creating include/jemalloc/internal/jemalloc_internal_defs.h config.status: creating test/include/test/jemalloc_test_defs.h config.status: executing include/jemalloc/internal/public_symbols.txt commands config.status: executing include/jemalloc/internal/private_symbols.awk commands config.status: executing include/jemalloc/internal/private_symbols_jet.awk commands config.status: executing include/jemalloc/internal/public_namespace.h commands config.status: executing include/jemalloc/internal/public_unnamespace.h commands config.status: executing include/jemalloc/internal/size_classes.h commands config.status: executing include/jemalloc/jemalloc_protos_jet.h commands config.status: executing include/jemalloc/jemalloc_rename.h commands config.status: executing include/jemalloc/jemalloc_mangle.h commands config.status: executing include/jemalloc/jemalloc_mangle_jet.h commands config.status: executing include/jemalloc/jemalloc.h commands =============================================================================== jemalloc version : 5.1.0-0-g0 library revision : 2 CONFIG : --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ 'CFLAGS=-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops ' LDFLAGS= CC : gcc CONFIGURE_CFLAGS : -std=gnu11 -Wall -Wsign-compare -Wundef -Wno-format-zero-length -pipe -g3 -fvisibility=hidden -O3 -funroll-loops SPECIFIED_CFLAGS : -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops EXTRA_CFLAGS : CPPFLAGS : -D_GNU_SOURCE -D_REENTRANT CXX : g++ CONFIGURE_CXXFLAGS : -fvisibility=hidden -O3 SPECIFIED_CXXFLAGS : EXTRA_CXXFLAGS : LDFLAGS : EXTRA_LDFLAGS : DSO_LDFLAGS : -shared -Wl,-soname,$(@F) LIBS : -lm -lpthread -ldl RPATH_EXTRA : XSLTPROC : false XSLROOT : PREFIX : /usr/local BINDIR : /usr/local/bin DATADIR : /usr/local/share INCLUDEDIR : /usr/local/include LIBDIR : /usr/local/lib MANDIR : /usr/local/share/man srcroot : abs_srcroot : /usr/local/redis-6.2.14/deps/jemalloc/ objroot : abs_objroot : /usr/local/redis-6.2.14/deps/jemalloc/ JEMALLOC_PREFIX : je_ JEMALLOC_PRIVATE_NAMESPACE : je_ install_suffix : malloc_conf : autogen : 0 debug : 0 stats : 1 prof : 0 prof-libunwind : 0 prof-libgcc : 0 prof-gcc : 0 fill : 1 utrace : 0 xmalloc : 0 log : 0 lazy_lock : 0 cache-oblivious : 1 cxx : 0 =============================================================================== cd jemalloc && make CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " LDFLAGS="" lib/libjemalloc.a make[3]: 进入目录“/usr/local/redis-6.2.14/deps/jemalloc” gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/jemalloc.sym.o src/jemalloc.c nm -a src/jemalloc.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/jemalloc.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/arena.sym.o src/arena.c nm -a src/arena.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/arena.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/background_thread.sym.o src/background_thread.c nm -a src/background_thread.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/background_thread.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/base.sym.o src/base.c nm -a src/base.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/base.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bin.sym.o src/bin.c nm -a src/bin.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bin.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/bitmap.sym.o src/bitmap.c nm -a src/bitmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/bitmap.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ckh.sym.o src/ckh.c nm -a src/ckh.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ckh.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ctl.sym.o src/ctl.c nm -a src/ctl.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ctl.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/div.sym.o src/div.c nm -a src/div.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/div.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent.sym.o src/extent.c nm -a src/extent.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_dss.sym.o src/extent_dss.c nm -a src/extent_dss.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_dss.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/extent_mmap.sym.o src/extent_mmap.c nm -a src/extent_mmap.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/extent_mmap.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hash.sym.o src/hash.c nm -a src/hash.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hash.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/hooks.sym.o src/hooks.c nm -a src/hooks.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/hooks.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/large.sym.o src/large.c nm -a src/large.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/large.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/log.sym.o src/log.c nm -a src/log.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/log.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/malloc_io.sym.o src/malloc_io.c nm -a src/malloc_io.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/malloc_io.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex.sym.o src/mutex.c nm -a src/mutex.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/mutex_pool.sym.o src/mutex_pool.c nm -a src/mutex_pool.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/mutex_pool.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/nstime.sym.o src/nstime.c nm -a src/nstime.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/nstime.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/pages.sym.o src/pages.c nm -a src/pages.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/pages.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prng.sym.o src/prng.c nm -a src/prng.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prng.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/prof.sym.o src/prof.c nm -a src/prof.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/prof.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/rtree.sym.o src/rtree.c nm -a src/rtree.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/rtree.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/stats.sym.o src/stats.c nm -a src/stats.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/stats.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/sz.sym.o src/sz.c nm -a src/sz.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/sz.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tcache.sym.o src/tcache.c nm -a src/tcache.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tcache.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/ticker.sym.o src/ticker.c nm -a src/ticker.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/ticker.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/tsd.sym.o src/tsd.c nm -a src/tsd.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/tsd.sym gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -DJEMALLOC_NO_PRIVATE_NAMESPACE -o src/witness.sym.o src/witness.c nm -a src/witness.sym.o | gawk -f include/jemalloc/internal/private_symbols.awk > src/witness.sym /bin/sh include/jemalloc/internal/private_namespace.sh src/jemalloc.sym src/arena.sym src/background_thread.sym src/base.sym src/bin.sym src/bitmap.sym src/ckh.sym src/ctl.sym src/div.sym src/extent.sym src/extent_dss.sym src/extent_mmap.sym src/hash.sym src/hooks.sym src/large.sym src/log.sym src/malloc_io.sym src/mutex.sym src/mutex_pool.sym src/nstime.sym src/pages.sym src/prng.sym src/prof.sym src/rtree.sym src/stats.sym src/sz.sym src/tcache.sym src/ticker.sym src/tsd.sym src/witness.sym > include/jemalloc/internal/private_namespace.gen.h cp include/jemalloc/internal/private_namespace.gen.h include/jemalloc/internal/private_namespace.gen.h gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/background_thread.o src/background_thread.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bin.o src/bin.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/div.o src/div.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_dss.o src/extent_dss.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent_mmap.o src/extent_mmap.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hooks.o src/hooks.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/large.o src/large.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/log.o src/log.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/malloc_io.o src/malloc_io.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex_pool.o src/mutex_pool.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/nstime.o src/nstime.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/pages.o src/pages.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prng.o src/prng.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/sz.o src/sz.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ticker.o src/ticker.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tsd.o src/tsd.c gcc -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/witness.o src/witness.c ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/background_thread.o src/base.o src/bin.o src/bitmap.o src/ckh.o src/ctl.o src/div.o src/extent.o src/extent_dss.o src/extent_mmap.o src/hash.o src/hooks.o src/large.o src/log.o src/malloc_io.o src/mutex.o src/mutex_pool.o src/nstime.o src/pages.o src/prng.o src/prof.o src/rtree.o src/stats.o src/sz.o src/tcache.o src/ticker.o src/tsd.o src/witness.o make[3]: 离开目录“/usr/local/redis-6.2.14/deps/jemalloc” make[2]: 离开目录“/usr/local/redis-6.2.14/deps” CC adlist.o CC quicklist.o CC ae.o CC anet.o CC dict.o CC server.o CC sds.o CC zmalloc.o CC lzf_c.o CC lzf_d.o CC pqsort.o CC zipmap.o CC sha1.o CC ziplist.o CC release.o CC networking.o CC util.o CC object.o CC db.o CC replication.o CC rdb.o CC t_string.o CC t_list.o CC t_set.o CC t_zset.o CC t_hash.o CC config.o CC aof.o CC pubsub.o CC multi.o CC debug.o CC sort.o CC intset.o CC syncio.o CC cluster.o CC crc16.o CC endianconv.o CC slowlog.o CC scripting.o CC bio.o CC rio.o CC rand.o CC memtest.o CC crcspeed.o CC crc64.o CC bitops.o CC sentinel.o CC notify.o CC setproctitle.o CC blocked.o CC hyperloglog.o CC latency.o CC sparkline.o CC redis-check-rdb.o CC redis-check-aof.o CC geo.o CC lazyfree.o CC module.o CC evict.o CC expire.o CC geohash.o CC geohash_helper.o CC childinfo.o CC defrag.o CC siphash.o CC rax.o CC t_stream.o CC listpack.o CC localtime.o CC lolwut.o CC lolwut5.o CC lolwut6.o CC acl.o CC gopher.o CC tracking.o CC connection.o CC tls.o CC sha256.o CC timeout.o CC setcpuaffinity.o CC monotonic.o CC mt19937-64.o LINK redis-server INSTALL redis-sentinel CC redis-cli.o CC cli_common.o LINK redis-cli CC redis-benchmark.o LINK redis-benchmark INSTALL redis-check-rdb INSTALL redis-check-aof Hint: It's a good idea to run 'make test' ;) make[1]: 离开目录“/usr/local/redis-6.2.14/src” 进入./src/目录，也就是/usr/local/redis-6.2.14/src/目录下，执行make install，开始安装Redis:# make install CC Makefile.dep Hint: It's a good idea to run 'make test' ;) INSTALL redis-server INSTALL redis-benchmark INSTALL redis-cli 配置Redis.conf为方便后期管理，在Redis的conf配置文件和常用命令统一存放到目录中：创建两个目录bin和etc：# mkdir bin # mkdir etc # ls 00-RELEASENOTES CONDUCT deps Makefile redis.conf runtest-moduleapi src utils bin CONTRIBUTING etc MANIFESTO runtest runtest-sentinel tests BUGS COPYING INSTALL README.md runtest-cluster sentinel.conf TLS.md 将Redis目录下的redis.conf复制到目录下的/usr/local/redis-6.2.14/etc目录中：cp redis.conf ./etc/然后修改./etc/redis.conf的参数：# 允许后台启动 daemonize yes # 修改默认端口 (可选，比如默认6379) port 6379 # 设置 PID 文件路径 pidfile /var/run/redis_6379.pid # 设置日志路径(如果没有/usr/local/redis-6.2.14/logs/这个目录，请先创建，不然启动的时候会报错) logfile /usr/local/redis-6.2.14/logs/redis_6379.log # 设置持久化路径(如果没有/usr/local/lib/redis/这个目录，请先创建，不然启动的时候会报错) dir /usr/local/lib/redis/ 启动Redisredis-server /usr/local/redis-6.2.14/etc/redis.conf如果有设置了daemonize yes，Redis就会后台运行。通过命令ps aux | grep redis检查 redis-server 是否在运行# ps aux|grep redis root 16966 0.0 0.1 162520 2620 ? Ssl 22:03 0:00 redis-server 127.0.0.1:6379 root 17095 0.0 0.0 112828 988 pts/0 S+ 22:03 0:00 grep --color=auto redis 测试测试连接，使用redis-cli命令连接Redis：# redis-cli 127.0.0.1:6379> set foo 'bai'; OK 127.0.0.1:6379> get foo; "bai" 127.0.0.1:6379> 说明Redis运行成功了。配置 Systemd 服务（开机自启）创建 systemd 配置文件：sudo nano /etc/systemd/system/redis.service内容参考：[Unit] Description=Redis In-Memory Data Store After=network.target [Service] User=root Group=root ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf ExecStop=/usr/local/bin/redis-cli shutdown Restart=always [Install] WantedBy=multi-user.target然后：# 重新加载 systemd sudo systemctl daemon-reload # 开机启动 sudo systemctl enable redis # 启动 Redis sudo systemctl start redis # 查看状态 sudo systemctl status redis总结一下步骤命令下载源码wget http://download.redis.io/releases/redis-6.2.14.tar.gz安装依赖yum install gcc make 或 apt install gcc make解压源码tar xzf redis-6.2.14.tar.gz编译安装make && sudo make install配置redis.conf修改 daemonize yes 等参数启动Redisredis-server /usr/local/redis-6.2.14/etc/redis.conf测试redis-cli配置开机启动（可选）写 systemd 服务
spring-boot-devtools 是 Spring Boot 提供的一个开发工具模块，主要用于提升开发效率。它通过提供热部署（Hot Reload）和其他开发时的便捷功能，帮助开发者快速迭代和调试代码。作用热部署（Hot Reload）自动检测类路径下的文件变化（如 Java 文件、配置文件等），并重新加载应用，无需手动重启。适用于开发环境，生产环境中默认禁用。LiveReload 支持内置 LiveReload 服务器，当资源文件（如 HTML、CSS、JavaScript 等）发生变化时，浏览器会自动刷新。默认禁用缓存在开发环境中，Spring Boot 会禁用模板引擎缓存（如 Thymeleaf、Freemarker 等），确保每次请求都能获取最新的模板内容。全局设置提供了一些全局配置选项，比如可以通过 spring.devtools.restart.enabled 控制是否启用热部署。具体使用方法1. 添加依赖在 pom.xml 中添加 spring-boot-devtools 依赖：<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency><optional>true</optional> 表示该依赖仅在当前项目中生效，不会传递到其他模块。2. 配置文件设置可以在 application.properties 或 application.yml 中进行相关配置：# 启用/禁用热部署 spring.devtools.restart.enabled=true # 设置需要监控的目录（默认监控类路径） spring.devtools.restart.additional-paths=src/main/java # 排除不需要监控的目录 spring.devtools.restart.exclude=static/**,public/** # 启用 LiveReload spring.devtools.livereload.enabled=true3. 使用方式代码修改后自动重启 修改 Java 文件或配置文件后，Spring Boot 会自动重启应用。你可以在控制台看到类似以下日志：Restarting application...浏览器自动刷新 如果修改了前端资源文件（如 HTML、CSS、JS），并且浏览器安装了 LiveReload 插件，页面会自动刷新。4. 注意事项生产环境禁用 spring-boot-devtools 默认不会被打包到生产环境的 JAR 文件中，因此不会影响生产性能。如果需要强制禁用，可以在打包时排除该依赖。IDE 配置 确保 IDE 的自动编译功能已启用：IntelliJ IDEA：勾选 Build project automatically（File -> Settings -> Build, Execution, Deployment -> Compiler）。Eclipse：默认支持自动编译。性能优化 如果项目较大，热部署可能会导致重启时间较长，可以使用 spring.devtools.restart.log-condition-evaluation-delta=false 关闭条件评估日志以提升速度。总结spring-boot-devtools 是一个非常实用的开发工具，能够显著提升开发效率。通过简单的配置，开发者可以享受到热部署和 LiveReload 带来的便利，同时避免手动重启应用的繁琐操作。
在 Maven 的 pom.xml 文件中，<optional>true</optional> 是用于标记依赖项的一个属性。以下是它的作用和影响的详细说明：1. optional 属性的作用当一个依赖被标记为 <optional>true</optional> 时，表示该依赖是可选的（非必须）。这意味着，使用该项目的其他模块或项目不会自动继承这个依赖。2. 具体行为（1）对于当前项目在当前项目中，标记为 <optional>true</optional> 的依赖仍然会被正常解析和使用。例如，在您的 pom.xml 中：<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency>这里的 lombok 依赖会在当前项目的编译、运行过程中正常工作。（2）对于依赖当前项目的其他模块或项目如果其他模块或项目依赖了当前项目（holiday-club-service），它们不会自动继承标记为 <optional>true</optional> 的依赖。换句话说，其他模块如果需要使用 lombok，必须显式地在自己的 pom.xml 中声明对 lombok 的依赖。3. 为什么使用 optional？避免不必要的传递依赖：某些依赖可能只是当前项目的一部分功能所需，而不是所有功能都需要。通过设置 <optional>true</optional>，可以减少传递依赖的复杂性。灵活性：允许其他模块根据需要选择是否引入该依赖。4. 示例场景假设您有一个项目 A，它依赖了 lombok 并将其标记为 <optional>true</optional>。另一个项目 B 依赖了项目 A：如果项目 B 不需要使用 lombok，则无需额外配置。如果项目 B 需要使用 lombok，则必须在项目 B 的 pom.xml 中显式声明对 lombok 的依赖。5. 总结<optional>true</optional> 的主要作用是控制依赖的传递性，避免不必要的依赖被传递到其他模块或项目中。这种配置通常用于以下情况：依赖仅在特定场景下使用。希望减少传递依赖的复杂性，提高项目的灵活性。在您的 pom.xml 中，lombok 和 spring-boot-devtools 被标记为 <optional>true</optional>，这表明这些依赖并非所有模块都必需，其他模块可以根据需要自行决定是否引入它们。
在 Maven 中，<dependency> 的 scope 用于控制依赖项在构建生命周期的不同阶段是否可用。共有 6 种标准 scope，每种适用于不同的场景：1. compile（默认值，未指定时使用）✅ 编译（compile）、测试（test）、运行（runtime） 均可用⚠️ 会包含在最终的打包（JAR/WAR）中? 适用场景：项目中绝大多数依赖（如 Spring Core、Lombok、Gson）2. provided✅ 编译（compile）、测试（test） 可用❌ 运行时（runtime）由目标环境（如JDK/Tomcat）提供，不会打到包里? 适用场景：Servlet API、JDBC API（javax.servlet:servlet-api、Java EE APIs）3. runtime❌ 编译时（compile）不可用（无法 import 使用）✅ 测试（test）、运行（runtime） 可用? 适用场景：JDBC 驱动、反射加载的实现类（mysql-connector-java）4. test✅ 仅在测试（test）和测试编译阶段 可用❌ 不会打包到发布版本（如生产环境 JAR 包）? 适用场景：JUnit、Mockito、TestNG5. system（已弃用）✅ 类似于 provided，但要显式指定 JAR 路径（systemPath）⚠️ 不推荐使用（易移植性差）? 适用场景：本地库文件（极少使用）6. import（仅适用于 <dependencyManagement>）✅ 用于 导入 BOM（Bill of Materials） 定义的依赖版本⚠️ 不实际引入依赖，只是版本管理? 适用场景：Spring Boot BOM（spring-boot-dependencies）总结对比表Scope编译（compile）可用？测试（test）可用？运行（runtime）可用？打包（package）是否包含？主要用途compile✅✅✅✅项目主要依赖（默认值）provided✅✅❌❌由运行时环境提供（如 Tomcat 的 Servlet API）runtime❌✅✅✅仅运行时需要（如 JDBC 驱动）test❌✅❌❌测试专用（JUnit、Mockito）system✅✅❌?（取决于配置）本地 JAR（已废弃）import----仅管理依赖版本（BOM 导入）其中，最常用的是 compile、provided、runtime、test，而 system 应避免使用，import 主要用于依赖管理。
在 SQL Server 中，使用内置的 JSON 函数来解析和查询 JSON 数据。SQL Server 从 2016 版本开始支持 JSON 功能。以下是解析 JSON 数据的详细方法和示例：1. 检查 JSON 数据ISJSON()ISJSON 函数用于检查字符串是否为有效的 JSON。DECLARE @json NVARCHAR(MAX) = '{"name": "Alice", "age": 25}'; SELECT ISJSON(@json) AS is_valid_json;输出：is_valid_json1如果返回 1，表示字符串是有效的 JSON；返回 0，表示无效。2. 解析 JSON 对象JSON_VALUE()JSON_VALUE 用于从 JSON 中提取标量值（如字符串、数字）。DECLARE @json NVARCHAR(MAX) = '{"name": "Alice", "age": 25}'; SELECT JSON_VALUE(@json, '$.name') AS name, JSON_VALUE(@json, '$.age') AS age;输出：nameageAlice253. 解析 JSON 数组JSON_QUERY()JSON_QUERY 用于从 JSON 中提取数组或对象。DECLARE @json NVARCHAR(MAX) = '{"name": "Alice", "hobbies": ["reading", "swimming"]}'; SELECT JSON_QUERY(@json, '$.hobbies') AS hobbies;输出：hobbies["reading", "swimming"]4. 解析嵌套 JSONJSON_VALUE() 和 JSON_QUERY()对于嵌套的 JSON，可以组合使用 JSON_VALUE 和 JSON_QUERY。DECLARE @json NVARCHAR(MAX) = '{"user": {"name": "Alice", "age": 25}}'; SELECT JSON_VALUE(@json, '$.user.name') AS name, JSON_VALUE(@json, '$.user.age') AS age;输出：nameageAlice255. 解析 JSON 数组中的元素使用 OPENJSON 函数将 JSON 数组解析为表格形式。DECLARE @json NVARCHAR(MAX) = '[{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]'; SELECT * FROM OPENJSON(@json) WITH ( name NVARCHAR(50) '$.name', age INT '$.age' );输出：nameageAlice25Bob306. 解析嵌套 JSON 数组对于嵌套的 JSON 数组，可以多次调用 OPENJSON。DECLARE @json NVARCHAR(MAX) = '{"user": {"name": "Alice", "hobbies": ["reading", "swimming"]}}'; SELECT JSON_VALUE(@json, '$.user.name') AS name, value AS hobby FROM OPENJSON(JSON_QUERY(@json, '$.user.hobbies'));输出：namehobbyAlicereadingAliceswimming7. 查询 JSON 中的数据可以通过 WHERE 子句筛选 JSON 数据。DECLARE @json NVARCHAR(MAX) = '[{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]'; SELECT name, age FROM OPENJSON(@json) WITH ( name NVARCHAR(50) '$.name', age INT '$.age' ) WHERE age > 25;输出：nameageBob308. 将 JSON 数据插入到表中使用 OPENJSON 将 JSON 数据插入到表中。DECLARE @json NVARCHAR(MAX) = '[{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]'; INSERT INTO users (name, age) SELECT name, age FROM OPENJSON(@json) WITH ( name NVARCHAR(50) '$.name', age INT '$.age' );9. 将表数据转换为 JSON使用 FOR JSON 将表数据转换为 JSON 格式。SELECT name, age FROM users FOR JSON AUTO;输出：[{"name": "Alice", "age": 25}, {"name": "Bob", "age": 30}]10. 处理 NULL 值默认情况下，JSON_VALUE 和 OPENJSON 会忽略 NULL 值。如果需要保留 NULL，可以使用 ISNULL 或 COALESCE。DECLARE @json NVARCHAR(MAX) = '{"name": "Alice", "age": null}'; SELECT JSON_VALUE(@json, '$.name') AS name, ISNULL(JSON_VALUE(@json, '$.age'), 'N/A') AS age;输出：nameageAliceN/A11. 实战操作公司的一个用餐消费记录使用JSON保存在数据库中，如下图：这一列的类型是text,然而在使用JSON_VALUE函数解析JSON的时候，参数需要时varchar才行。所以我这里使用 CAST(CONVERT 函数 也可以)将 TEXT 转换为 NVARCHAR(MAX)，然后再对JSON进行查询。具体的查询SELECT JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_id') as cost_id, JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_fee') as cost_fee, JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_device') as cost_device, JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_user') as "cost_user", JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_type') as cost_type, JSON_VALUE(CAST(JOB_DATA AS NVARCHAR(MAX)), '$.cost_time') as cost_time FROM XIAN_Tools.dbo.T_M_MEALFEE_JOB t WHERE t.CREATE_TIME > '2025-02-11 00:00:00' AND t.CREATE_TIME < '2025-02-11 23:59:59';输出：cost_idcost_feecost_devicecost_usercost_typecost_time717bb31a5c2b4090a39dbdb7ca1125f22030001101124240064H22080273中餐2025-02-11 11:00:05a85ee6ead6c44a3e90068543d45f8ad63500172340006H22080273中餐2025-02-11 11:00:31424b05591e1b411883ce2a81b20cb7051330001101124360094H24090022中餐2025-02-11 11:02:48e8d009dc53714e0eb696a92739762b5a14500172340006H24020094中餐2025-02-11 11:03:01894fddf535944c36bfc97c8df43be5fa1230001101124240043H24090022中餐2025-02-11 11:04:00..................知识扩展:使用 TEXT 和 NVARCHAR(MAX) 的主要区别特性TEXTNVARCHAR(MAX)最大长度2GB2GB是否支持大量操作部分支持（需要特殊处理）完全支持是否支持索引不支持支持（某些情况下）性能较低较高未来兼容性已弃用推荐使用