nacos 报错排查
报错内容
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memoryMonitor' defined in URL [jar:file:/home/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-config-2.2.3.jar!/com/alibaba/nacos/config/server/monitor/MemoryMonitor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncNotifyService': Unsatisfied dependency expressed through field 'dumpService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalDumpService': Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure : docker-nacos-1 | No DataSource set
排查步骤:
1.查看mysql服务是否正常 navicat工具正常连接,但telnet 显示 telnet: connect to address xxxxx:3306: Connection refused
2.防火墙端口是否有问题(这个报错是频率性报错,一会好了一会坏了。所以排除这个可能)
3.查看mysql最大连接数,以及正在连接的数量。
经过以上排查得出,mysql连接数达到了连接的极限。导致拒绝连接
查询当前连接数
SHOW STATUS WHERE `variable_name` = 'Threads_connected';
连接详情
SELECT * FROM information_schema.PROCESSLIST;
显示自 MySQL 服务器启动以来同时使用的最大连接数
SHOW GLOBAL STATUS LIKE 'Max_used_connections';
允许最大连接数
SHOW VARIABLES LIKE 'max_connections';
以下俩个设置超过时间杀掉连接
SET GLOBAL wait_timeout=300; -- 非交互连接空闲超时时间设置为300秒 (5分钟)
SET GLOBAL interactive_timeout=300; -- 交互式连接空闲超时时间设置为300秒 (5分钟)
SET GLOBAL wait_timeout=600;
SET GLOBAL interactive_timeout=600;
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
2024-01-03 idea 快捷键(eclipse版设置)