一叉抡、 數(shù)據(jù)庫異常:Public Key Retrieval is not allowed
在使用 MySQL 8.0 時重啟應用后提示 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
沒有仔細研究到底是什么問題褥民,最簡單的解決方法是在連接后面添加 allowPublicKeyRetrieval=true
二、微服務走熔斷器問題
通過feign調(diào)用有時候會走熔斷器撵颊,原因是hystrix 的線程池參數(shù)配置不夠倡勇,需要配置參數(shù):
hystrix.threadpool.default.coreSize 并發(fā)執(zhí)行的最大線程數(shù)夸浅,默認10
hystrix.threadpool.default.maxQueueSize BlockingQueue的最大隊列數(shù)题篷,當設(shè)為-1番枚,會使用SynchronousQueue,值為正時使用LinkedBlcokingQueue路星。該設(shè)置只會在初始化時有效洋丐,之后不能修改threadpool的queue size友绝,除非reinitialising thread executor迁客。默認-1。
hystrix.threadpool.default.queueSizeRejectionThreshold 即使maxQueueSize沒有達到卜范,達到queueSizeRejectionThreshold該值后海雪,請求也會被拒絕。因為maxQueueSize不能被動態(tài)修改刺彩,這個參數(shù)將允許我們動態(tài)設(shè)置該值嗡害。if maxQueueSize == -1霸妹,該字段將不起作用
hystrix的更多參數(shù)配置參考 https://www.cnblogs.com/520playboy/p/8074347.html