alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.95k stars 8.34k forks source link

2023.X依赖只要引入nacos的discovery依赖之后,但实际不配置地址启动报错 #3662

Closed youngledo closed 7 months ago

youngledo commented 7 months ago

Which Component Nacos Config、Discovery

Describe the bug

2024-03-22T11:04:43.593+08:00  INFO 3025 --- [demo] [           main] c.alibaba.nacos.client.utils.ParamUtil   : [settings] [req-serv] nacos-server port:8848
2024-03-22T11:04:43.594+08:00  INFO 3025 --- [demo] [           main] c.alibaba.nacos.client.utils.ParamUtil   : [settings] [http-client] connect timeout:1000
2024-03-22T11:04:43.595+08:00  INFO 3025 --- [demo] [           main] c.alibaba.nacos.client.utils.ParamUtil   : PER_TASK_CONFIG_SIZE: 3000.0
2024-03-22T11:04:43.608+08:00  INFO 3025 --- [demo] [           main] c.a.n.p.a.s.c.ClientAuthPluginManager    : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
2024-03-22T11:04:43.608+08:00  INFO 3025 --- [demo] [           main] c.a.n.p.a.s.c.ClientAuthPluginManager    : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
2024-03-22T11:04:43.618+08:00  INFO 3025 --- [demo] [       Thread-1] c.a.n.c.a.r.identify.CredentialWatcher   : null No credential found
2024-03-22T11:04:43.629+08:00  INFO 3025 --- [demo] [           main] c.a.nacos.client.config.impl.Limiter     : limitTime:5.0

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.4)

2024-03-22T11:04:43.810+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.c.impl.LocalConfigInfoProcessor  : LOCAL_SNAPSHOT_PATH:/Users/huangxiao/nacos/config
2024-03-22T11:04:43.812+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [RpcClientFactory] create a new rpc client of 59b7492e-f207-4a20-bbfe-230d4660502b_config-0
2024-03-22T11:04:43.822+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x0000000801348f98
2024-03-22T11:04:43.823+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x00000008013493b8
2024-03-22T11:04:43.823+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
2024-03-22T11:04:43.823+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
2024-03-22T11:04:43.826+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Try to connect to server on start up, server: {serverIp = '10.20.183.66', server main port = 8506}
2024-03-22T11:04:43.836+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.remote.client.grpc.GrpcClient    : grpc client connection server:10.20.183.66 ip,serverPort:9506,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
2024-03-22T11:04:44.166+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.a.AbstractAbilityControlManager  : Ready to get current node abilities...
2024-03-22T11:04:44.166+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.a.AbstractAbilityControlManager  : Ready to initialize current node abilities, support modes: [SDK_CLIENT]
2024-03-22T11:04:44.167+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.a.AbstractAbilityControlManager  : Initialize current abilities finish...
2024-03-22T11:04:44.167+08:00  INFO 3025 --- [demo] [           main] c.a.n.c.a.d.NacosAbilityManagerHolder    : [AbilityControlManager] Successfully initialize AbilityControlManager
2024-03-22T11:04:44.274+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Success to connect to server [10.20.183.66:8506] on start up, connectionId = 1711076684136_10.244.1.9_60068
2024-03-22T11:04:44.275+08:00  INFO 3025 --- [demo] [t.remote.worker] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Notify connected event to listeners.
2024-03-22T11:04:44.275+08:00  INFO 3025 --- [demo] [t.remote.worker] c.a.n.client.config.impl.ClientWorker    : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Connected,notify listen context...
2024-03-22T11:04:44.275+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
2024-03-22T11:04:44.275+08:00  INFO 3025 --- [demo] [           main] com.alibaba.nacos.common.remote.client   : [59b7492e-f207-4a20-bbfe-230d4660502b_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x0000000801497a28
2024-03-22T11:04:44.303+08:00  WARN 3025 --- [demo] [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[product-delivery-center] & group[JAVA]
2024-03-22T11:04:44.360+08:00  INFO 3025 --- [demo] [           main] c.a.nacos.client.config.utils.JvmUtil    : isMultiInstance:false
2024-03-22T11:04:44.423+08:00  WARN 3025 --- [demo] [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[product-delivery-center-test.yml] & group[JAVA]
2024-03-22T11:04:44.424+08:00  INFO 3025 --- [demo] [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-product-delivery-center-test.yml,JAVA'}, BootstrapPropertySource {name='bootstrapProperties-product-delivery-center.yml,JAVA'}, BootstrapPropertySource {name='bootstrapProperties-product-delivery-center,JAVA'}]
2024-03-22T11:04:44.447+08:00  INFO 3025 --- [product-delivery-center] [           main] com.example.demo.DemoApplication         : The following 1 profile is active: "test"
2024-03-22T11:04:44.659+08:00  INFO 3025 --- [product-delivery-center] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=ab08e0f0-b677-3a0f-ac47-8526fa3a757e
2024-03-22T11:04:44.770+08:00  INFO 3025 --- [product-delivery-center] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-03-22T11:04:44.776+08:00  INFO 3025 --- [product-delivery-center] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-03-22T11:04:44.776+08:00  INFO 3025 --- [product-delivery-center] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.19]
2024-03-22T11:04:44.799+08:00  INFO 3025 --- [product-delivery-center] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-03-22T11:04:44.799+08:00  INFO 3025 --- [product-delivery-center] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 345 ms
2024-03-22T11:04:45.009+08:00  INFO 3025 --- [product-delivery-center] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path ''
2024-03-22T11:04:45.014+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.client.naming          : initializer namespace from ans.namespace attribute : null
2024-03-22T11:04:45.015+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.client.naming          : initializer namespace from ALIBABA_ALIWARE_NAMESPACE attribute :null
2024-03-22T11:04:45.015+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.client.naming          : initializer namespace from namespace attribute :null
2024-03-22T11:04:45.018+08:00  INFO 3025 --- [product-delivery-center] [           main] c.a.n.p.a.s.c.ClientAuthPluginManager    : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
2024-03-22T11:04:45.018+08:00  INFO 3025 --- [product-delivery-center] [           main] c.a.n.p.a.s.c.ClientAuthPluginManager    : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
2024-03-22T11:04:45.020+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [RpcClientFactory] create a new rpc client of 74019433-fe8c-489f-82e5-876e8cf1c34d
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.client.naming          : Create naming rpc client for uuid->74019433-fe8c-489f-82e5-876e8cf1c34d
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [74019433-fe8c-489f-82e5-876e8cf1c34d] RpcClient init, ServerListFactory = com.alibaba.nacos.client.naming.core.ServerListManager
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [74019433-fe8c-489f-82e5-876e8cf1c34d] Registry connection listener to current client:com.alibaba.nacos.client.naming.remote.gprc.redo.NamingGrpcRedoService
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [74019433-fe8c-489f-82e5-876e8cf1c34d] Register server push request handler:com.alibaba.nacos.client.naming.remote.gprc.NamingPushRequestHandler
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [74019433-fe8c-489f-82e5-876e8cf1c34d] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
2024-03-22T11:04:45.021+08:00  INFO 3025 --- [product-delivery-center] [           main] c.a.n.c.remote.client.grpc.GrpcClient    : grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
2024-03-22T11:04:45.026+08:00 ERROR 3025 --- [product-delivery-center] [           main] c.a.n.c.remote.client.grpc.GrpcClient    : Server check fail, please check server 127.0.0.1 ,port 9848 is available , error ={}

java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
    at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:592) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:467) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:243) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:367) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.common.remote.client.RpcClient.start(RpcClient.java:352) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.start(NamingGrpcClientProxy.java:117) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.<init>(NamingGrpcClientProxy.java:110) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.<init>(NamingClientProxyDelegate.java:79) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.client.naming.NacosNamingService.init(NacosNamingService.java:103) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.client.naming.NacosNamingService.<init>(NacosNamingService.java:86) ~[nacos-client-2.3.0.jar:na]
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[na:na]
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[na:na]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[na:na]
    at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:59) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.api.NacosFactory.createNamingService(NacosFactory.java:77) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.cloud.nacos.NacosServiceManager.createNewNamingService(NacosServiceManager.java:99) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at com.alibaba.cloud.nacos.NacosServiceManager.buildNamingService(NacosServiceManager.java:90) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at com.alibaba.cloud.nacos.NacosServiceManager.getNamingService(NacosServiceManager.java:46) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.namingService(NacosServiceRegistry.java:193) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at com.alibaba.cloud.nacos.registry.NacosServiceRegistry.register(NacosServiceRegistry.java:68) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.register(AbstractAutoServiceRegistration.java:264) ~[spring-cloud-commons-4.1.0.jar:4.1.0]
    at com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration.register(NacosAutoServiceRegistration.java:78) ~[spring-cloud-starter-alibaba-nacos-discovery-2023.0.0.0-RC1.jar:2023.0.0.0-RC1]
    at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.start(AbstractAutoServiceRegistration.java:156) ~[spring-cloud-commons-4.1.0.jar:4.1.0]
    at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:119) ~[spring-cloud-commons-4.1.0.jar:4.1.0]
    at org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.onApplicationEvent(AbstractAutoServiceRegistration.java:49) ~[spring-cloud-commons-4.1.0.jar:4.1.0]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:47) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:288) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:471) ~[spring-context-6.1.5.jar:6.1.5]
    at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:260) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:205) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:981) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627) ~[spring-context-6.1.5.jar:6.1.5]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.4.jar:3.2.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.4.jar:3.2.4]
    at com.example.demo.DemoApplication.main(DemoApplication.java:10) ~[classes/:na]
Caused by: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
    at com.alibaba.nacos.shaded.io.grpc.Status.asRuntimeException(Status.java:537) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:548) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:567) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:71) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:735) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:716) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[nacos-client-2.3.0.jar:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9848
Caused by: java.net.ConnectException: Connection refused
    at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
    at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[na:na]
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973) ~[na:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[nacos-client-2.3.0.jar:na]
    at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[nacos-client-2.3.0.jar:na]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2024-03-22T11:04:45.029+08:00  INFO 3025 --- [product-delivery-center] [           main] com.alibaba.nacos.common.remote.client   : [74019433-fe8c-489f-82e5-876e8cf1c34d] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
2024-03-22T11:04:45.029+08:00  INFO 3025 --- [product-delivery-center] [           main] c.a.n.c.remote.client.grpc.GrpcClient    : grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
2024-03-22T11:04:45.031+08:00 ERROR 3025 --- [product-delivery-center] [           main] c.a.n.c.remote.client.grpc.GrpcClient    : Server check fail, please check server 127.0.0.1 ,port 9848 is available , error ={}

Simplest demo

image image

我只引用了discovery依赖,但实际没有用(没有配置地址)。 注意:由于端口占用原因,修改了默认端口。

cxhello commented 7 months ago

@youngledo

image image

you can config spring.cloud.nacos.discovery.enabled=false disable nacos discovery.

yuluo-yx commented 7 months ago

@youngledo Mosaic the nacos address and user in the image, take care of data security