自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 SpringBoot redis 读写分离,优化lettuce客户端底层bug(-READONLY You can‘t write against a read only replica.)

springboot redis 读写分离,优化lettuce底层bug( -READONLY You can't write against a read only replica.)

2022-09-09 11:07:46 2569 1

原创 Kafka 笔记

KAFKA笔记下载wget -P ./ https://mirrors.bfsu.edu.cn/apache/kafka/2.8.0/kafka_2.12-2.8.0.tgztar -zxvf kafka_2.12-2.8.0.tgzZK集群docker pull zookeepervim docker-compose.ymlversion: '2'services: zoo1: image: zookeeper restart: always

2021-12-16 16:04:18 1087

原创 Mycat分库分表笔记

Mycat分库分表当线上某张表随着时间推移 数据越来越多时 对mysql的性能和服务器磁盘产生巨大压力读:old+new写:new这样JAVA端代码不需要任何改动 只需要搭建新的mysql服务 在使用mycat指向即可system_user表的配置demoschema.xml使用规则:auto-sharding-rang-mod(见下文 rule.xml)<mycat:schema xmlns:mycat="http://io.mycat/"> <schem

2021-07-30 17:53:37 500 1

原创 MySQL主从搭建笔记

MySQL主从搭建笔记主server_id=1 确保主从库my.cnf下server_id不同(确保data目录下auto.cnf 文件中id不同)log_bin=mysql-bin 主库开启log_binGRANT ALL ON . TO ‘baidu’@’%’ IDENTIFIED BY ‘19981101’;flush privileges;show variables like ‘log_bin’;show variables like ‘server_id’

2021-05-25 11:15:07 216 1

原创 haproxy+keepalived高可用搭建 实现vip漂移

Haproxy高可用搭建准备工作机器ipVIP 42.90.6.252HA主 42.90.6.84HA从 42.90.6.85Keepalived主 42.90.6.84Keepalived从 42.90.6.85查看挂载情况df -Th如果内网环境,先挂载yum源mkdir -p /mnt/cdrommount CentOS-7-x86_64-Everything-1708.iso /mnt/cdrom/配置本地yum源cd

2021-05-07 12:01:16 2077 2

原创 MongoDB基础知识(Docker安装MongoDB集群并与SpringBoot整合 实现高可用 读写分离等)

MongoDB笔记mac可视化工具:Studio 3T for MongoDBwin:robo3Tdocker安装mongo拉镜像docker pull mongo启动docker run -p 8002:27017 -v /mydocker/mongo/db:/data/db --name mongodb -d mongo登录docker exec -it 421b2c37b270 /bin/bashmongo或者mongo 127.0.0.1:27017/库名 -u admi

2021-03-15 16:03:14 566 4

原创 SpringBoot整合redis(实现redis分布式锁)

RedisTemplate参照:https://gitee.com/y_project/RuoYi-Vue引入坐标 pom.xml<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId></dependency><dependency> <groupId>org

2020-12-30 15:15:44 389

原创 Docker+ActiveMQ基础知识整理

Docker安装ActiveMQ拉镜像docker pull webcenter/activemq创建本地数据卷mkdir -p /mydocker/activemq/datamkdir -p /mydocker/activemq/log创建容器docker命令详解可以参照我上篇博客:https://blog.youkuaiyun.com/weixin_40760239/article/details/109652162docker run -d --name activemq -p 61616:6

2020-12-28 17:54:25 1176

原创 Docker+Jenkins持续集成

Docker安装Jenkins拉镜像docker pull jenkins/jenkins创建本地数据卷mkdir jenkins需要修改下目录权限,因为本地jenkins目录的拥有者为root用户,而容器中jenkins用户的 uid 为 1000。chown -R 1000:1000 jenkins创建容器docker命令详解可以参照我上篇博客:https://blog.youkuaiyun.com/weixin_40760239/article/details/109652162docke

2020-11-24 15:09:26 2649 17

原创 Docker基础(centos安装、阿里云镜像加速器配置、常用命令、数据卷、DockerFile、镜像推送阿里云等)

Centos 8.1安装Docker下载docker-ce.repocurl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo安装依赖yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm

2020-11-12 19:00:22 867

原创 Linux基础、Shell基础语法等

$ 当前进程号 $!后台运行的最后一个进程的进程号 $?最后一次命令返回的状态,0为正确执行。

2020-10-29 21:14:23 566 4

原创 Spring Cloud Alibaba Sentinel 之流控→排队等待(6)

配置排队等待: 让请求以匀速通过,阈值类型必须设置为QPS日志

2020-09-10 15:02:24 446 2

原创 Spring Cloud Alibaba Sentinel 之流控→Warm Up(5)

配置关联接口**应用场景:**解决系统流量突然暴增,保护系统,慢慢的把流量放进来,慢慢的把阈值增长为设置的阈值默认coldFactor为3,请求QPS从设定的阈值/3开始,经预热时长逐渐升至设定的QPS阈值开始阈值为10/3=3,经过5秒后,恢复1秒10次...

2020-09-10 11:10:59 265

原创 Java导出Excel(多sheet导出)EasyPoi

一对多导出、图片文件等导出详见我上篇文章https://blog.youkuaiyun.com/weixin_40760239/article/details/107175835多sheet导出 @RequestMapping("/export") public void export(HttpServletResponse response) { //你要放置的多sheet数据 ??? List<List<TotalReportEntity>> li

2020-08-06 21:19:51 433

原创 Spring Cloud Alibaba Sentinel 之流控→链路(4)

查看簇点链路,/testB的资源入口是sentinel_web_servlet_context配置链路入口资源为sentinel_web_servlet_context频繁访问B接口,超出访问限制时Blocked by Sentinel (flow limiting)

2020-07-29 17:31:14 1065 2

原创 Spring Cloud Alibaba Sentinel 之流控→关联(3)

配置关联接口当与A关联的资源B达到阈值后,就限流A自己模拟并发访问B接口此时超出阈值在访问A接口Blocked by Sentinel (flow limiting)

2020-07-29 16:32:35 198

原创 Spring Cloud Alibaba Sentinel 之流控→直接(2)

需要限流的接口点击添加流控配置QPS或者线程数超出访问限制时Blocked by Sentinel (flow limiting)

2020-07-29 16:07:28 179

原创 Java图片处理工具包

根据输入流转base64public static String imageToBase64ByInpusSteam(InputStream is) { ByteArrayOutputStream data = new ByteArrayOutputStream(); try { // 创建URL byte[] by = new byte[1024]; // 将内容读取内存中 i

2020-07-28 10:35:32 568

原创 Spring Cloud OpenFeign的使用(超时、日志设置)

引入pom<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId></dependency>OpenFeign接口先使用@EnableFeignClients启用@SpringBootApplication

2020-07-27 11:42:53 1321

原创 Spring Cloud Alibaba Sentinel 之初始化监控搭建(1)

安装下载jar:sentinel-dashboard-1.7.2.jar

2020-07-23 17:18:06 208

原创 Spring Cloud Gateway搭建

引入pomGateway组件 和 Eureka客户端 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> </dependency> <dependency>

2020-07-17 16:15:05 652

原创 SpringBoot 多线程 中 @Async 和 ThreadPoolTaskExecutor 的使用

配置线程池,实现AsyncConfigurer接口getAsyncExecutor 设置线程池getAsyncUncaughtExceptionHandler 异常日志处理import lombok.extern.slf4j.Slf4j;import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;import org.springframework.context.annotation.Configuration

2020-07-16 18:01:34 2193 2

原创 Java导出Excel(支持一对多导出、图片文件等导出)EasyPoi

本文采用SpringBoot+Mybatis Plus的Demo重点:导出文件基于实体类注解。实体类属性注解@Excel(name = “1:N图片”, type = 2,imageType = 2, width = 20,height = 50,needMerge = true)图片的字节数据 通过Base64Utils给属性赋值即可。源码、具体Demo如下 /** * 导出类型 1 是文本 2 是图片,3 是函数,10 是数字 默认是文本 */ public int

2020-07-07 12:09:26 3043 6

原创 Spring Cloud Stream 之 RabbitMQ

Spring Cloud Stream消息驱动作用:屏蔽底层消息中间件的差异,降低切换成本,统一消息的编程模型(目前只支持RabbitMQ、Kafka)

2020-06-29 17:27:59 399

原创 Spring Cloud Alibaba Nacos 集群搭建

环境准备:nginx+nacos集群(3台)+mysqlnacos集群版配置修改cluster.conf中的配置,配置3台节点172.19.25.206:3333172.19.25.206:4444172.19.25.206:5555新建nocas_config数据库,并执行nacos/conf/nacos-mysql.sql中的sql在application.properties末尾处添加mysql配置spring.datasource.platform=mysqldb.num=1

2020-06-23 17:38:17 439 1

空空如也

空空如也

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

TA关注的人

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