alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.33k stars 12.85k forks source link

nacos 2.2.1 cluster can not running to nacos-opreator #12704

Open klllmxx opened 1 month ago

klllmxx commented 1 month ago

TWO-WAY FOR THIS ISSUES!!! NO.1 Not Running config: apiVersion: nacos.io/v1alpha1 kind: Nacos metadata: name: nacos namespace: abc spec: type: cluster image: nacos-registry.cn-hangzhou.cr.aliyuncs.com/nacos/nacos-server:v2.2.1 replicas: 2 resources: requests: memory: 1Gi database: type: mysql mysqlHost: svc-mysql.default.svc.cluster.local mysqlPort: "3306" mysqlDb: nacos mysqlUser: root mysqlPassword: "admin@123" k8sWrapper: PodSpec: env:

nacos-operator: https://github.com/nacos-group/nacos-k8s/blob/master/operator

Running Log: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:423) at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at com.alibaba.nacos.Nacos.main(Nacos.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.(TomcatWebServer.java:104) at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ... 16 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}" at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:212) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:203) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:97) at org.springframework.boot.web.servlet.ServletContextInitializerBeans.(ServletContextInitializerBeans.java:86) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:260) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234) at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5211) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1383) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:430) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) ... 21 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}" at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 61 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}" at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 75 common frames omitted Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:230) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:79) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:60) at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:594) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:153) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:149) at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74) at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:159) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1332) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ... 87 common frames omitted

NO.2 Talking About Personalized Customization of Nacos Core: also how to use operator manage the personalized customization of nacos

klllmxx commented 1 month ago

After a period of trying, Nacos clusters can run in ,operator but how to access through ingress is a challenge and I don't know how to set it up.

klllmxx commented 1 month ago

2024-09-30 09:31:36,842 INFO Nacos is starting... 2024-09-30 09:31:37,844 INFO Nacos is starting... 2024-09-30 09:31:38,846 INFO Nacos is starting... 2024-09-30 09:31:39,612 INFO Nacos started successfully in cluster mode. use external storage ......

[root@k8s-master nacos-operator]# kubectl get nacos -n xxxx NAME REPLICAS READY TYPE DBTYPE VERSION CREATETIME nacos 3 Creating cluster mysql 2024-09-30T01:31:11Z [root@k8s-master nacos-operator]# kubectl top po -n xxxx NAME CPU(cores) MEMORY(bytes)
nacos-0 962m 854Mi
nacos-1 808m 890Mi
nacos-2 1327m 831Mi

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nacos-ingress namespace: xxxx spec: ingressClassName: nginx rules:

klllmxx commented 1 month ago

Also how to use operator manage the personalized customization of nacos,Maybe someting is wrong?

klllmxx commented 1 month ago

[root@k8s-master nacos-operator]# kubectl logs -f -n xxxx nacos-0 sh: 1: Syntax error: "(" unexpected [root@k8s-master nacos-operator]# kubectl logs -f -n xxxx nacos-1 sh: 1: Syntax error: "(" unexpected

KomachiSion commented 1 month ago

Can you login to pod and use env | grep NACOS to see whether env variable inject into pod.

klllmxx commented 1 month ago

Can you login to pod and use to see whether env variable inject into pod.env | grep NACOS Dockerfile already define env variables , but use "env | grep NACOS" didn't find env variables By the way,This one from personalized customization of nacos

klllmxx commented 1 month ago

Can you login to pod and use env | grep NACOS to see whether env variable inject into pod. Also I find some envvariables from my personalized nacos right now,I will show you: NACOS_TEST_PORT_8848_TCP_PROTO=tcp NACOS_TEST_SERVICE_PORT=9848 NACOS_TEST_PORT_8848_TCP_ADDR=10.96.114.214 NACOS_TEST_SERVICE_HOST=10.96.114.214 NACOS_TEST_SERVICE_PORT_NACOS=9848 NACOS_TEST_PORT_8848_TCP=tcp://10.96.114.214:8848 NACOS_TEST_PORT=tcp://10.96.114.214:9848 NACOS_TEST_PORT_9848_TCP=tcp://10.96.114.214:9848 NACOS_TEST_PORT_9848_TCP_PORT=9848 NACOS_TEST_PORT_9848_TCP_PROTO=tcp NACOS_TEST_PORT_9848_TCP_ADDR=10.96.114.214 NACOS_TEST_PORT_8848_TCP_PORT=8848 NACOS_TEST_SERVICE_PORT_NACOS_MANGER=8848

klllmxx commented 1 month ago

FROM eclipse-temurin:8-jre MAINTAINER kllmkadx ENV TZ=Asia/Shanghai \ TIME_ZONE="Asia/Shanghai"\ BASE_DIR=/xxl/nacos \ MODE="cluster" \ PREFER_HOST_MODE="ip"\ JAVA_HOME="/opt/java/openjdk" \ JAVA="/opt/java/openjdk/bin/java"\ CLASSPATH=".:/xxl/nacos/conf/:$CLASSPATH" \ CLUSTER_CONF="/xxl/nacos/conf/cluster.conf" \ JVM_MS="128m" \ JVM_MMS="320m" \ JVM_XMS="256m" \ JVM_XMX="256m" \ JVM_XMN="512m" \ NACOS_DEBUG="n" \ FUNCTION_MODE="all" \ TOMCAT_ACCESSLOG_ENABLED="false" RUN mkdir -p /xxl/nacos/{bin,target,conf} RUN ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone WORKDIR $BASE_DIR ADD ./application.properties ./conf/application.properties ADD ./nacos-logback.xml ./conf/nacos-logback.xml ADD ./target/xxl-nacos.jar ./target/nacos-server.jar ADD ./docker-startup.sh ./bin/docker-startup.sh EXPOSE 8848 EXPOSE 9848 EXPOSE 7848 RUN mkdir -p logs \ && touch logs/start.out \ && ln -sf /dev/stdout logs/start.out \ && ln -sf /dev/stderr logs/start.out \ && chmod +x bin/docker-startup.sh ENTRYPOINT ["sh","bin/docker-startup.sh"]

KomachiSion commented 1 month ago

No env NACOS_AUTH_IDENTITY_KEY in your pod, so program can't handle the identity key.

you should add env to your pod or container when you start your images.

xuechaos commented 1 month ago

现在报错应该是没有正确的传入这个环境变量, 定制化的逻辑我没太懂,建议看新版本是不是能解决这个问题

klllmxx commented 1 month ago

No env NACOS_AUTH_IDENTITY_KEY in your pod, so program can't handle the identity key.

you should add env to your pod or container when you start your images.

Ok I will update my dockerfile to setting "NACOS_AUTH_IDENTITY_KEY" envvariables after running test continue~~~

klllmxx commented 1 month ago

现在报错应该是没有正确的传入这个环境变量, 定制化的逻辑我没太懂,建议看新版本是不是能解决这个问题

Just 2.2.1 best,Because my all devops and prod environment using this version man~

klllmxx commented 1 month ago

No env NACOS_AUTH_IDENTITY_KEY in your pod, so program can't handle the identity key.

you should add env to your pod or container when you start your images.

For now Nacos can be running,but some problems become to hard: 1、 Personalize Nacos Application can not to read dockerfile envvariables and Nacos Operator import also,then not working(from kubernetes)。 2、Only using “docker run -d xxx” can be running,however, there are still cases where environment variables cannot be read to use the built-in database. 3、Can not open cluster mode inside my Personalize Nacos。

klllmxx commented 1 month ago

现在报错应该是没有正确的传入这个环境变量, 定制化的逻辑我没太懂,建议看新版本是不是能解决这个问题

For now Nacos can be running,but some problems become to hard: 1、 Personalize Nacos Application can not to read dockerfile envvariables and Nacos Operator import also,then not working(from kubernetes)。 2、Only using “docker run -d xxx” can be running,however, there are still cases where environment variables cannot be read to use the built-in database. 3、Can not open cluster mode inside my Personalize Nacos。

KomachiSion commented 1 month ago

I don't know what's your Personalize Nacos, I test for nacos-server from dockerhub, it can run with input env NACOS_AUTH_IDENTITY_KEY and other supported env variables.

klllmxx commented 1 month ago

I don't know what's your Personalize Nacos, I test for nacos-server from dockerhub, it can run with input env NACOS_AUTH_IDENTITY_KEY and other supported env variables.

So all questions important pont is env variables import the Personalize Nacos right?

KomachiSion commented 4 weeks ago

I don't know what's your Personalize Nacos, I test for nacos-server from dockerhub, it can run with input env NACOS_AUTH_IDENTITY_KEY and other supported env variables.

So all questions important pont is env variables import the Personalize Nacos right?

I think it is one way to solve, you also can write relatived configuration into conf/application.properties in your Personalize Nacos.

klllmxx commented 4 weeks ago

ce7fbc934d2b49c091aa8feae0804102 b8f3f18f9a50cc8cc17af95215ba4af5

klllmxx commented 4 weeks ago

我不知道你的 Personalize Nacos 是什么,我从 dockerhub 测试了 nacos-server,它可以使用输入 env NACOS_AUTH_IDENTITY_KEY 和其他支持的 env 变量运行。

所以所有问题都很重要,是 env variables import the Personalize Nacos,对吧?

我认为这是一种解决方法,你也可以在你的 .conf/application.properties``Personalize Nacos

So for now I checkout offical nacos, but conf is different.also application connection nacos server but something like that:2024-10-21 09:07:29.338 ERROR 39563 --- [com.alibaba.nacos.client.remote.worker] [TID: N/A] c.a.n.c.remote.client.grpc.GrpcClient : Server check fail, please check server 172.16.96.6 ,port 31914 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:566)\ at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:445)\ at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:148)\ at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:264)\ at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:522)\ at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start$2(RpcClient.java:370)\ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\ at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)\ at java.util.concurrent.FutureTask.run(FutureTask.java)\ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\ at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\ at java.lang.Thread.run(Thread.java:750)\ Caused by: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception\ at com.alibaba.nacos.shaded.io.grpc.Status.asRuntimeException(Status.java:533)\ at com.alibaba.nacos.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:490)\ at com.alibaba.nacos.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)\ at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)\ at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)\ at com.alibaba.nacos.shaded.io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:700)\ at com.alibaba.nacos.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)\ at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)\ at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)\ at com.alibaba.nacos.shaded.io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:399)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:510)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:66)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:630)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:518)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:692)\ at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:681)\ at com.alibaba.nacos.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\ at com.alibaba.nacos.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\ ... 3 common frames omitted\ Caused by: com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /172.16.96.6:31914\ Caused by: java.net.ConnectException: Connection refused\ at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)\ at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:336)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:685)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\ at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\

KomachiSion commented 3 weeks ago

There is totally different, the error message is Connection refused: /172.16.96.6:31914, which means your 172.16.96.6 with 31914 port is not listened so that your client can't connect to your nacos server.

Please make sure your nacos server start with a right port configuration and export port to network env. And you should make sure your client node can access nacos server network.

klllmxx commented 2 weeks ago

There is totally different, the error message is Connection refused: /172.16.96.6:31914, which means your 172.16.96.6 with 31914 port is not listened so that your client can't connect to your nacos server.

Please make sure your nacos server start with a right port configuration and export port to network env. And you should make sure your client node can access nacos server network.

Maybe the question form https://nacos.io/blog/faq/nacos-user-question-history15287/ right?

klllmxx commented 2 weeks ago

31914

The Port 31914 is same as Default Port 9848?

KomachiSion commented 2 weeks ago

see https://nacos.io/docs/latest/manual/admin/deployment/deployment-overview/#1-nacos%E9%83%A8%E7%BD%B2%E6%9E%B6%E6%9E%84

klllmxx commented 2 weeks ago

see https://nacos.io/docs/latest/manual/admin/deployment/deployment-overview/#1-nacos%E9%83%A8%E7%BD%B2%E6%9E%B6%E6%9E%84

OKOK I WILL CONTINUE MY NACOS MAN