title: OAuth2.0 实践 Spring Authorization Server 搭建授权服务器 + Resource + Client date: 2023-03-27 01:41:26 tags:OAuth2.0Spring Authorization Server categories:开发实践 cover: https://cover.png feature: false1.            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-04-17 10:53:28
                            
                                66阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
             文章目录1、错误处理机制1、SpringBoot默认的错误处理机制2、定制错误响应:**1、如何定制错误的页面;**2、如何定制错误的json数据;3、将我们的定制数据携带出去;2、配置嵌入式Servlet容器1、如何定制和修改Servlet容器的相关配置;2、注册Servlet三大组件【Servlet、Filter、Listener】3、替换为其他嵌入式Servlet容器4、嵌入式Servle            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-10-25 22:11:53
                            
                                32阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            今天在博客的交流区收到一条不错的问题,拿出来给大家分享一下。具体问题如下:因为项目里面用到了redis集群,但并不是用spring boot的配置方式,启动后项目健康检查老是检查redis的时候状态为down,导致注册到eureka后项目状态也是down。问下能不能设置spring boot不检查 redis的健康状态 "redis": { 
    "status": "DOWN",            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-01-04 22:28:46
                            
                                145阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Table of Contents 01. Spring概述1.1 spring的优势1.2 spring的体系结构01. Spring概述 Spring是⼀个开源框架,Spring是于2003 年兴起的⼀个轻量级的Java 开发框架,由Rod Johnson 在其 著作Expert One-On-One J2EE Development and Design中阐述的部分理念和            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-02-08 06:01:09
                            
                                24阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            以下只是适合现在所在公司的方案:方案一:通过nginx的healthcheck_nginx_upstreams模块来实现缺点是:属于第三方模块,需要独立编译安装,且2年多没有更新了,不知道对1.6以上的nginx版本支持如何;项目的仓库地址:https://github.com/cep21/healthcheck_nginx_upstreams方案二:使用Tengine,自带了ngx_http_u            
                
         
            
            
            
            如何在 Spring Boot 中提高应用程序的安全性Spring Boot是一种流行的Java开发框架,用于构建Web应用程序和微服务。在构建应用程序时,安全性是至关重要的因素。不论您的应用程序是面向公众用户还是企业内部使用,都需要采取适当的措施来确保数据和系统的安全性。本文将探讨如何在Spring Boot应用程序中提高安全性,并提供示例代码来说明不同的安全性措施。1. 使用Spring Se            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-10-09 16:18:49
                            
                                107阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            原因?为什么会使用nginx_heath 这个模块,主要是如nginx+tomcat部署的时,tomcat挂了之后nginx->upstream 轮询是可以踢掉挂掉的tomcat服务的,如果部署的机器挂了之后nginx轮询是不能踢掉的,如果服务再去请求,就会出现请求超时!1、ngx_http_proxy_module 模块和ngx_http_upstream_module模块(自带) 官网地            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-05-28 10:59:22
                            
                                143阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            wget http://labs.consol.de/wp-content/uploads/2011/08/check_mysql_health-2.1.7.tar.gzwget http://labs.consol.de/wp-content/uploads/2010/03/check_mysql_health-2.1.1.tar.gz  wget http://www.shinguz            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2013-04-15 10:10:19
                            
                                2757阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            针对Linux的检查,编写了shell脚本,如下:   
 #!/bin/sh################################################################################################################Script name: linuxHealthCheck.sh#Script descripti            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-04 09:41:28
                            
                                165阅读
                            
                                                                             
                 
                
                             
         
            
            
            
             项目中某个微服务开启了spring健康检查:eureka:
  client:
    healthcheck:
      enabled: true
    serviceUrl:
      defaultZone: http://localhost:8800/eureka/  #注册中心地址
  instance:
    hostname: localhost
    ins            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-07-09 10:27:43
                            
                                153阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1、下载check_oracle_health,从http://labs.consol.de/wp-content/uploads/2009/09/check_oracle_health-1.6.3.tar.gz下载源文件。#tar -zxvf check_oracle_health-1.6.3.tar.gz #cd check_oracle_health-            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2013-07-25 11:09:30
                            
                                1247阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            batch job to restart tomcat and health check for tomcat application            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2023-06-27 16:54:43
                            
                                65阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            ## Redis Cluster Health Check
Redis is an open-source, in-memory data structure store that is used as a database, cache, and message broker. Redis Cluster is a distributed implementation of Redis tha            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2024-06-30 06:21:36
                            
                                37阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            # 如何实现python redis health check
## 简介
在开发过程中,经常需要对redis服务器进行健康检查,以确保系统的正常运行。本文将介绍如何使用python来实现redis健康检查,并指导刚入行的小白如何完成这个任务。
## 流程
以下是实现python redis健康检查的流程:
```mermaid
journey
    title 实现python redi            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2024-02-27 07:17:14
                            
                                146阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            #!/bin/bash
#
fwm=6
sorry_server=127.0.0.1
rs=('172.16.100.21' '172.16.100.22')
rw=('1' '2')
type='-g'
chkloop=3
rsstatus=(0 0)
logfile=/var/log/            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2019-01-10 17:09:21
                            
                                606阅读
                            
                                                        
                                点赞
                            
                                                                             
                 
                
                             
         
            
            
            
            对 health_check_period与healht_check_timeout,官方解释如下:health_check_periodThis parameter specifies the interval between the health checks in seconds. Default is 0, which means health check is disabled. You need to reload pgpool.conf if you change health_check_period.health_check_timeoutpgpool-II periodic            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2012-08-02 15:24:00
                            
                                180阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1. If you use gfs, then you may use following command to see if the list output and df output are the same on all the nodes, e.g:
    
        
            #gfs_tool list
            #gfs_tool d            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2011-05-03 14:33:08
                            
                                800阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            以下脚本可以用于检查Grid Control(OMS) Repository的健康程度:
set linesize 130
set pagesize 50000
Set feedback off
set heading off
SPOOL RepositoryHealth.log
PROMPT ********* Report to capture the Health of the EM G            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2011-08-29 06:10:54
                            
                                391阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1. 选择稳定版还是主线版主线版:包含最新的功能和bug修复,但该版本可能会含有一些属于实验性的模块,同时可能会有新的bug,所以如果只是做测试使用,可以使用主线版。稳定版:不包含最新的功能,但修复了严重的bug,建议用在生产环境。 2. 使用预编译安装包还是源码安装包预编译包:这种是最简单和最快速的安装源码nginx的方式,预编译包几乎包含了所有的官方模块,且大部分的操作系统都能安装。            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2024-10-30 10:05:28
                            
                                113阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            # Spring Boot 微服务配置:禁用 Rabbit Health Check Failed
在微服务架构中,消息队列扮演着非常重要的角色,RabbitMQ 是最流行的消息队列之一。使用 Spring Boot 开发微服务时,RabbitMQ 提供的健康检查功能可以帮助我们监控整个集群的状态。然而,有时我们可能会遇到健康检查失败的情况,导致应用程序启动失败。本文将介绍如何在 Spring            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2024-09-13 05:32:38
                            
                                777阅读