当前位置:网站首页>Analysis of port 9848 error at startup of Nacos client (non-version upgrade problem)
Analysis of port 9848 error at startup of Nacos client (non-version upgrade problem)
2022-08-02 06:44:00 【m0_67402564】
I. Background
Many people will report the following error when the Nacos client is started, indicating that the connection to port 9848 has timed out.
I also searched for it myself, and many articles said that it was a version problem. It would be good to upgrade the client to 2.0, but I found that many people still report this error after upgrading.Well, there is no answer on the Internet, so I can only analyze it myself.

Second, analyzing the source code
Find the place where the error is reported GrpcClient.serverCheck() method, then break the point, restart, wait for the following line to be executed, and find that the error is not reported again, and then the startup is successful!
responseFuture.get(3000L, TimeUnit.MILLISECONDS);
After several attempts, no error will be reported as long as the breakpoint is interrupted, and an error will be reported if the breakpoint is not interrupted.

After careful study, requestBlockingStub.request is a non-blocking request, and directly enters after the request
responseFuture.get(3000L, TimeUnit.MILLISECONDS) In the method, this method is to judge whether the above request response is returned. You can look at the logic inside, generally within the 3-second timeout period, it will loop to determine whether the response isReturn, if the timeout does not return, an exception will be thrown.



This is why after hitting the breakpoint, no error will be reported. Hitting the breakpoint will invisibly increase the timeout period. Before judging the timeout method, the response has been returned, and naturally no error will be reported.
Third, whether the startup is successful
Most people, after the error is reported at startup, the project is still successfully started, and the nocas service list is already available, but they are still a little confused when they see the error. Is it really okay?Let's analyze it again, find the source, and report the error method serverCheck, where did it start to call
Follow step by step, find the connectToServer method of this class
Continue to find the place to call the connectToServer method and locate the start method in RpcClient.class

I found that when connectToServer is called, it returns null (that is, it returns null after the previous error is reported), it willRetry three times, generally the connection will be successful the second time, and it will print out Success to connect to serveron start up

So after you start the error report, see if there is a success log below the error log. If there is a success log, it means that it is normal and there is no problem.
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢

【解决】RESP.app 连接不上redis

蚂蚁三面:MQ 消息丢失、重复、积压问题,有哪些解决方案?

无代码生产新模式探索

6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
![[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays](/img/eb/9b05508e88b7f17d80de2afa8c08ce.png)
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays

深度学习——CNN实现MNIST手写数字的识别

Block elements, inline elements (
随机推荐
51单片机外设篇:点阵式LCD
C语言小游戏——扫雷小游戏
洛谷小游戏大全(用洛谷的人都得知道)
go里面的基本知识
How to perform concurrent calculation (stability test and stress test)?
Install and use Google Chrome
npm 和 yarn的区别
虚拟现实房产展示系统提前预见未来装修效果
网安学习-内网渗透4
Constructors, member variables, local variables
代码编世界 科技创未来
Automated operation and maintenance tools - ansible, overview, installation, module introduction
Difference and analysis of CPU usage and load
关于 VS Code 优化启动性能的实践
面试官:设计“抖音”直播功能测试用例吧
NPM ---- 安装yarn
There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
selenium + robotframework的运行原理
金山云团队分享 | 5000字读懂Presto如何与Alluxio搭配
npm、cnpm的安装


