随笔分类 -  后端

后端系统开发笔记
摘要:Spring Boot 自定义启动Banner记录 获取自定义 Banner http://patorjk.com/software/taag/#p=display&f=3D%20Diagonal&t=Cxy%2CI%20Love%20U. 生效方式 在 resources 目录地下新建 banne 阅读全文 »
posted @ 2022-05-02 16:59 zolmk 阅读(32) 评论(0) 推荐(0) 编辑
摘要:使用 keytool 生成密钥对 + keytool 命令详解 keytool是jdk提供用来生成SSL/TLS密钥的工具。 使用案例: 这里只考虑密钥仓库的使用,假设有AB两台服务器,A的证书为cerA,B的证书为cerB,可以通过keytool导出cer证书,该证书内部包含了公钥。 当需要双向认 阅读全文 »
posted @ 2020-12-08 11:08 zolmk 阅读(2884) 评论(0) 推荐(0) 编辑
摘要:使用 Sidecar 整合非 JVM 微服务 假设有个微服务运行在 ip:123.123.123.123 port: 8080 上,我们现在需要将其注册在 Eureka Server 上 首先我们需要在该服务上提供一个 REST 接口,让该接口返回服务的状态,即 { "status":"UP" // 阅读全文 »
posted @ 2020-12-03 16:13 zolmk 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Tomcat 配置 Https 须知:网站类项目配置 https 有两种方式,一种是直接配置 Tomcat 为 Https,一种是在项目中进行配置。 在项目中配置坑较多,因此选择在 Tomcat 中配置。 一、申请证书 申请证书有以下几种方式: java 的 keytools 生成的免费证书(本地命 阅读全文 »
posted @ 2020-12-02 15:52 zolmk 阅读(329) 评论(0) 推荐(0) 编辑
摘要:SpringBoot 集成 Shiro 一、添加依赖 pom.xml <!--shiro--> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring-boot-web-starter</artifactId 阅读全文 »
posted @ 2020-12-02 15:51 zolmk 阅读(145) 评论(0) 推荐(0) 编辑
摘要:Spring Boot Security 使用注解进行权限控制 注:如 @RolesAllowed({"ADMIN"}) ,则所对应的权限为 ROLE_ADMIN,如果权限为 ADMIN,则会报无权限错误!!!!! 阅读全文 »
posted @ 2020-12-02 15:49 zolmk 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Spring Security 配合 Thymeleaf 使用 注:Thymeleaf H5标注头: xmlns:th="https://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security" 且 阅读全文 »
posted @ 2020-12-02 15:48 zolmk 阅读(107) 评论(0) 推荐(0) 编辑
摘要:Spring Security 配置 参考 https://docs.spring.io/spring-security/site/docs/5.4.1/guides/#hello-world 1、首先在 pom.xml 文件中添加 Spring Security <dependency> <gro 阅读全文 »
posted @ 2020-12-02 15:47 zolmk 阅读(87) 评论(0) 推荐(0) 编辑
摘要:Spring Boot Cache 一、Spring 缓存抽象 Spring 从 3.1 开始定义了 org.springframework.cache.Cache 和 org.springframework.cache.CacheManager 接口来统一不同的缓存技术;并支持使用 JCache( 阅读全文 »
posted @ 2020-12-02 15:46 zolmk 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Spring Boot 自定义 starters starter: 这个场景需要用到的依赖是什么 如何编写自动配置 @Configuration // 指明这个类为自动配置类 @ConditionalOnXXX // 在指定条件成立的情况下自动配置类生效 @AutoConfigureAfter // 阅读全文 »
posted @ 2020-12-02 15:44 zolmk 阅读(66) 评论(0) 推荐(0) 编辑
摘要:Spring Boot 与消息 一、概述 两个重要概念:消息代理和目的地,当消息发送者发送消息以后,将由消息代理接管,消息代理保证消息传递到指定目的地。 消息队列主要有两种形式的目的地 队列(queue):点对点消息通信 主题(topic):发布、订阅消息通信 点对点式: 消息发送者发送消息,消息代 阅读全文 »
posted @ 2020-12-02 15:41 zolmk 阅读(84) 评论(0) 推荐(0) 编辑
摘要:Spring Boot 微服务 微服务指提供一个或多个 Rest 接口的小 Spring Boot 项目,创建过程和一般 Spring Boot 项目相同 一、使用 Spring Boot Actuator 来监视 Spring Boot 项目 在创建初始化项目中,在 Ops 下选择 Spring 阅读全文 »
posted @ 2020-12-02 15:37 zolmk 阅读(116) 评论(0) 推荐(0) 编辑
摘要:Spring 中 @Component 和 @Bean 的区别 1、@Component 注解 告诉 Spring 当前类是一个组件,在扫描时应该将它当成一个 Bean,装配到容器中 是一个类注解 2、@Bean 注解 告诉 Spring 当前方法的返回值是一个 Bean 是方法注解 相对而言 @B 阅读全文 »
posted @ 2020-12-02 15:36 zolmk 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Mybatis 踩坑 url 常见配置 url: jdbc:mysql://localhost:3306/database?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval 阅读全文 »
posted @ 2020-12-02 15:31 zolmk 阅读(138) 评论(0) 推荐(0) 编辑
摘要:IDEA 一、IDEA 项目创建问题 1、Maven 项目下载过程中断网 解决方法:运行mvn -U idea:idea 阅读全文 »
posted @ 2020-12-02 15:28 zolmk 阅读(82) 评论(0) 推荐(0) 编辑
摘要:Eureka Server 配置 一、初级配置(傻瓜式,单节点) 1、新建一个 Spring Boot 项目 2、在 pom.xml 文件中添加 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-b 阅读全文 »
posted @ 2020-12-02 15:22 zolmk 阅读(961) 评论(0) 推荐(0) 编辑
摘要:Eureka Client 配置 一、初级配置(傻瓜式) 1、新建一个 Spring Boot 项目 2、在 pom.xml 文件中添加 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot- 阅读全文 »
posted @ 2020-12-02 15:21 zolmk 阅读(1629) 评论(0) 推荐(0) 编辑
摘要:在服务器之外的地方访问 MYSQL 1.修改服务器防火墙规则 iptables -L 可以查看当前的防火墙规则 iptables -F 可以清空所有防火墙规则 也可以通过云服务器的 UI 界面修改 2.确保 mysql 的监听地址是 0.0.0.0 监听地址是 0.0.0.0 ,表示该 mysql 阅读全文 »
posted @ 2020-12-02 15:16 zolmk 阅读(133) 评论(0) 推荐(0) 编辑
摘要:1、版本一致性 Elasticsearch 客户端版本和服务器版本需一致 2、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] 每个进程最大同时打开文件数太小, 阅读全文 »
posted @ 2020-12-02 14:56 zolmk 阅读(115) 评论(0) 推荐(0) 编辑
摘要:ElasticSearch 安装与使用 一、ElasticSearch 安装 1、使用 docker search elasticsearch 搜索 ElashticSearch 镜像 2、docker pull imageName 3、运行镜像(需2G以上内存),docker run -d -p 阅读全文 »
posted @ 2020-12-02 14:55 zolmk 阅读(190) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示