版本:naocs2.0.3
环境:windows
前置条件:环境变量中配置JAVA_HOME,否则会报以下错误:
Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better!
以单机模式启动:
startup.cmd -m standalone
常见启动错误:
- Can’t find dependent libraries
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]:
Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]:
Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]:
Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError:
C:\Users\鐔婃€濇晱\AppData\Local\Temp\librocksdbjni4782214776874896024.dll:
Can't find dependent libraries
关键信息是:Can’t find dependent libraries
原因是当前系统缺少运行库,安装最新的 Microsoft Visual C++ 可再发行程序包版本后就能成功启动了。
- Fail to init node, please see the logs to find the reason.
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos鎴?target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos鎴?target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/E:/Software/nacos-server-2.0.3/nacos鎴?target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.0.3.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.IllegalStateException:
Fail to init node, please see the logs to find the reason.
关键信息是:Fail to init node, please see the logs to find the reason.
原因是naocs默认不能识别中文路径,解决办法就是避免nacos路径包含中文
最后,从图中可以看到nacos启动成功!