1. Error Messages
nacos connect error:
2022-03-23 10:06:48 |ERROR |main |SpringApplication.java:826 |org.springframework.boot.SpringApplication |Application run failed java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848]) tried: failed to req API:localhost:8848/nacos/v1/ns/instance. code:500 msg: java.net.ConnectException: Connection refused: connect at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:467) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:389) at com.alibaba.nacos.client.naming.net.NamingProxy.registerService(NamingProxy.java:191) at com.alibaba.nacos.client.naming.NacosNamingService.registerInstance(NacosNamingService.java:207) at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:64) at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:239) at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:76) at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:138) at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.bind(AbstractAutoServiceRegistration.java:101) at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:88) at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:47) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:165) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at com.atguigu.guli.service.edu.ServiceEduApplication.main(ServiceEduApplication.java:15)
2. Solution
1.Check whether nacos is open
2.Check whether nacos is open properly
3. nacos and eureka are not the same, eureka is part of the project, nacos is more like a partner relationship.
,--.
,--.'|
,--,: : |
,`--.'`| ' : ,---.
| : : | | ' ,'\ .--.--.
: | \ | : ,--.--. ,---. / / |// '
| : ' '; |/ \ / \. ; ,. :| : /`./
' ' ;. ;.--. .-. |/ /'' | |: :| : ;_
| | | \ | \__\/: . .. '/' | .; : \ \ `.
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' // ,. |' | '.'|\ \ // /`--' /
' : | ; : .' \ : : `----' '--'. /
; |.' | , .-./\ \ / `--'---'
'---' `--`---' `----'
4. If Nacos starts normally, restart the project, or not
(1) Check annotation @enablediscoveryclient
(2) Check configuration file
# Note the space position
cloud:
nacos:
discovery:
server-addr: localhost:8848 # nacos server location
Read More:
- [Solved] Nacos Start Error: failed to req API:127.0.0.1:8848/nacos/v1/ns/service/list. code:503 msg: server is DOWN now
- [Solved] “error_code“:500,“message“:“IO Error trying to forward REST request: java.net.ConnectException: Connection Refused
- [Solved] AmqpConnectException: java.net.ConnectException: Connection refused: connect
- [Solved] kafka startup Error: java.net.ConnectException: Connection refused
- [Solved] Error running query: MetaException(message:Got exception: java.net.ConnectException Call From XXXX
- [Solved] SpringBoot integration with Redis error: java.net.ConnectException: Connection refused: no further information
- Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: [How to Solve]
- [Solved] Compile the program error: undefined reference to `cv::dnn::dnn4_v20210301::Net::~Net()‘
- [Solved] Nacos2.1.1 Startup Error: nacos is starting with standalone
- [Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected java.net.http.HttpRequest()…
- [Solved] swagger3 Error: org.springframework.context.ApplicationContextException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- Tensorflow error: attributeerror: module ‘tensorflow_ API. V1. Train ‘has no attribute’ summarywriter ‘
- [Exception] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
- TensorFlow error: AttributeError: module ‘tensorflow_core._api.v2.train’ has no attribute ‘Optimizer‘
- .Net Core 5.0 Upload File limit via Swagger Api report error: error: request entity too large [Three Methods]
- [Solved] Asp.Net Core IIS Error: HTTP Error 500.30 – ASP.NET Core app failed to start
- [Solved] net core HTTP Error 500.31 – Failed to load ASP.NET Core runtime HTTP Error 500.30 – ASP.NET Core
- socket java.net.BindException: bind failed: EACCES (Permission denied)
- [Solved] docker failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition
- Nacos Click service offline error: caused: errCode: 500, errmsg: do metadata operation failed;