自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 nginx 实现系统日常性能监控

在日常运维中,我们通过nginx实现了日常系统性能监控。结合nginx的参数配置,通过命令来统计请求的信息,通过这些信息来分析系统的慢请求,慢请求中最长时间的请求,慢请求中请求最频繁的请求等数据。通过这些数据来优化系统,提升性能。

2023-12-11 11:21:27 79 1

原创 SpringBoot整合SpringSecurity 入门篇超级简单

1.pom添加jar包引用 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> &

2021-07-09 21:36:21 230

原创 SpringBoot是如何加载application.properties配置文件的?

1.一个问题引发的思考 我在resouce下面增加了两个文件app.key,app.pub,application.properties 添加对应配置 jwt.private.key=classpath:app.key jwt.public.key=classpath:app.pub Config类中配置了对文件的引用 @Value("${jwt.public.key}") RSAPublicKey key; 结果启动后提示 java.io.FileNotFoundException:

2021-07-08 19:34:47 1162

原创 SpringBoot 开发实战 | 第四节 SpringBoot整合validation校验

1.引入jar包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId></dependency><!-- fastjson --><dependency> <groupId>com.alibaba</groupId

2021-07-05 20:14:38 239

原创 linux下SpringBoot优雅更新、停机、发布

#!/bin/bash# 定义变量today=`date +%y%m%d`pid=app=demo-servicejarFile=${app}.jarsourcePath=/home/code/springboot/#更新代码,启动带上分支可以切换到指定分支cd ${sourcePath}/demo/if [ -n "$1" ] ;then echo "you have input is $1" git checkout $1fiecho '当前分支::'git

2021-07-03 09:58:38 412

原创 开发人员的日常linux命令 vim/more/less/ps/netstat 基础操作

1.查找相关命令# 查找软件安装 whereis mysql# 查找关键字所在的文件,当前目录往下走,最多查找2层find . -maxdepth 2 -name "*.log" | xargs grep "error"2.vim 基础操作

2021-06-30 20:20:30 154 1

原创 SpringBoot 开发实战 | 第三节 mybatis-plus 分页、复杂条件查询

1.定义mybatis-plus的配置文件该配置文件主要是配置了自带的分页插件PaginationInnerInterceptor,同时把对dao的扫码路径也转移到该配置文件中,启动类的dao扫描就可以删除了。@Configuration@MapperScan("com.leeong.demo.dao")public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor

2021-06-27 09:20:51 511

原创 linux下 截取一个时间段的日志输出到指定文件

more catalina.out | sed -n '/2021-06-15 18:48:/,/2021-06-15 18:55:/p' > info.log

2021-06-15 16:15:24 459

原创 SpringBoot 开发实战 | 第二节 SpringBoot 整合 mybatis-plus

1.说明第二节的代码是以第一节代码为基础的。可通过第一节或者gitee的地址来获取第一节地址:https://blog.csdn.net/libankling2008/article/details/117790889gitee地址:https://gitee.com/null_484_1073/springboot.git2. 修改pom配置# 新增<dependency> <groupId>com.baomidou</groupId> <arti

2021-06-11 20:39:42 1104 2

原创 SpringBoot 开发实战 | 第一节 快速搭建SpringBoot crud 开发框架

1. 下载通用模板从https://start.spring.io/ 下载公共模板,右侧添加web,mysql,mybatis相关的类,下载后导入到idea中2. 配置application.properties配置端口、环境、数据源、mybatis相关配置server.port=8080spring.profiles.active=dev# datasourcespring.datasource.url=jdbc:mysql://127.0.0.1:3306/ds0?allowMulti

2021-06-10 21:19:31 355 1

原创 springboot @Cacheable 的实现原理

1. springboot cache 的使用 a.pom引入jar spring-boot-starter-cache b.启动类增加注解@EnableCaching c.需要缓存的方法增加注解 @Cacheable(cacheNames = "com:xxx",key = "''+#id")图12. Cacheable 的实现原理猜测 实现原理是什么呢?脑海第一反应应该当然是大名鼎鼎是AOP、动态代理、Interceptor 这些概念,那我们怎么去验证呢?3. Cacheab

2021-06-05 10:27:57 3997

原创 线上环境频繁GC问题排查,Finalizer对象该背这个锅吗?

问题描述公司的一个SpringMVC服务,最近在做运维检查的时候发现young gc 和 full gc太频繁,远远超过了正常情况。服务器配置是4核8G,该服务分配了6G内存。通过arthas的dashboard统计情况在20个小时之内发送的young gc和 full gc 次数,如下图:young gc 393次,full gc 19次问题排查在eden区达到80%的时候,通过arthas 的 heapdump dupm了堆内存文件java -jar arthas-boot.jar挂账对

2021-05-15 08:07:59 1165

原创 arthas 组合命令jad/mc/redefine,再也不用担心生产环境问题排查困难了

通过arthas神器的组合命令来实现不重启应用的情况下动态加入日志打印信息来诊断生产问题。操作步骤如下:启动arthas curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar 挂载对应进程,进入arthas环境反编译class 生成java文件到指定路径jad --source-only com.example.demo.arthas.user.UserController ...

2021-04-23 15:54:14 871 3

原创 mysql explain详解,这一篇文章就够了

建表语句create table a( id int auto_increment, aname varchar(12), age int, primary key(id));create table b( id int auto_increment, aid int, bname varchar(12), remark char(1), cname varchar(10), primary key(id), index bname(bname) using btree,

2020-06-08 20:50:23 264

原创 springboot代码中如何获取jedisPool的配置参数

最近项目中本地代码需要获取到Jedis配置参数,特意从springboot启动跟踪的整个参数的初始化、赋值过程,特将知识点记录如下。1.spring-boot-autoconfigure包下面集成了对redis客户端的config类,有Jedis,Lettuce,本次关注的是Jedis。2.我们找到对应的配置类 JedisConnectionConfiguration,从下图可以看到注解中加入了连接池,和Jedis@Configuration@ConditionalOnClass({ Generi

2020-06-02 17:01:33 1821

原创 异步子线程如何获取主线程的request中的属性

1.啥也不说先上代码2.我们来探究下这两行代码能实现属性共享的原理,其中的关键就是RequestContextHolder类3.RequestContextHolder类字面解释就是以线程绑定的的形式保存web请求的相关信息的holder类,通过设置inheritable属性来决定是否能被子线程继承;该类里面包含两个ThreadLocal全局属性4.其中的inheritableRequestAttributesHolder 存储的request属性就表示运行子线程去继承的,第一个步骤的 Reque

2020-06-01 10:47:35 3462 11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除