原创 postgresql查詢表字段

SELECT col.table_schema AS schema_name, col.table_name, col.column_name, col.character_maximum_length, col.is_nul

原创 springboot生產環境不加載classpath:application.properties,重新指定文件

最近一次生產環境部署,發現線上的zookeeper中註冊的ip地址爲測試環境的ip,然後查看了程序裏的/src/main/resources/application.properties,發現開發人員在配置了 spring.cloud.

原创 WebFlux ServerHttpRequest RequestBody 讀取

MockServerHttpRequest request = MockServerHttpRequest.post("/test").body("test"); DecoderHttpMessageReader<byt

原创 ConfigurableEnvironment轉Map

public final class EnvironmentUtils { private EnvironmentUtils() { } public static Map<String,

原创 docker flannel安裝

1.關閉防火牆 centos7: systemctl stop firewalld.service centos6: servie iptables stop 2.安裝配置etcd yum install etcd vim /etc/et

原创 java tomcat 設置Docker容器時區

1.修改/etc/timezone echo "Asia/Shanghai" > /etc/timezone 2.啓動容器 docker run -it -v /usr/share/zoneinfo/Asia/Shanghai:/e

原创 Spring Cloud微服務 註冊中心高可用

Eureka Server的高可用 Eureka Server除了單點運行之外,還可以通過運行多個實例,並進行互相註冊的方式來實現高可用的部署,所以我們只需要將Eureke Server配置其他可用的serviceUrl就能實現高可用部署

原创 Spring Cloud微服務 Spring Boot Admin

Admin監控應用 Spring Boot提供的監控接口,例如:/health、/info等等,實際上除了之前提到的信息,還有其他信息業需要監控:當前處於活躍狀態的會話數量、當前應用的併發數、延遲以及其他度量信息。下面我們來了解如何使用s

原创 postgresql 內存使用配置

shared_buffers:這是最重要的參數,postgresql通過shared_buffers和內核和磁盤打交道,因此應該儘量大,讓更多的數據緩存在shared_buffers中。通常設置爲實際RAM的10%是合理的,比如50000

原创 Spring Cloud微服務 服務消費者

創建服務消費者 Feign Feign是一個聲明式的Web Service客戶端,它使得編寫Web Serivce客戶端變得更加簡單。我們只需要使用Feign來創建一個接口並用註解來配置它既可完成。它具備可插拔的註解支持,包括Feign

原创 Spring Cloud微服務 優雅停止

優雅停止服務 Spring Boot,作爲Spring框架對“約定優先於配置(Convention Over Configuration)”理念的最佳實踐的產物,它能幫助我們很快捷的創建出獨立運行、產品級別的基於Spring框架的應用,大

原创 Spring Reactor 線程調度

public static void main(String[] args) throws InterruptedException { Mono.create(new Consumer<MonoSink<Object>>() {

原创 阿里雲Sonatype Nexus倉庫

Maven: ${user.dir}/.m2/settings.xml <mirror> <id>alimaven</id> <mirrorOf>*</mirrorOf> <name>aliy

原创 Nginx location指令匹配順序規則

location匹配命令: ~      爲區分大小寫的匹配。~*     不區分大小寫的匹配(匹配firefox的正則同時匹配FireFox)。!~     不匹配的!~*    不匹配的 @     不是普通的location匹配,而

原创 SpringBoot集成SwaggerUI修改訪問路徑

import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowir