Nacos版本差异导致的启动失败问题(Windows10下)解决办法
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Nacos版本差异导致的启动失败问题(Windows10下)解决办法,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4416字,纯文字阅读大概需要7分钟。
内容图文
在Windows10下启动Nacos1.1.3正常,但是尝试启动Nacos1.4.0和1.3.2时,失败,部分异常如下:
"nacos is starting with cluster"
,--.
,--.'|
,--,: : | Nacos 1.4.0
,`--.'`| ' : ,---. Running in cluster mode, All function modules
| : : | | ' ,'\ .--.--. Port: 8848
: | \ | : ,--.--. ,---. / / | / / ' Pid: 31804
| : ' '; | / \ / \. ; ,. :| : /`./ Console: http://192.168.0.100:8848/nacos/index.html
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /
' : | ; : .' \ : : `----' '--'. /
; |.' | , .-./\ \ / `--'---'
'---' `--`---' `----'
java.io.IOException: java.lang.IllegalArgumentException: db.num is null
at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.reload(ExternalDataSourceServiceImpl.java:141)
at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.init(ExternalDataSourceServiceImpl.java:115)
Caused by: java.lang.IllegalArgumentException: db.num is null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:135)
at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceProperties.build(ExternalDataSourceProperties.java:96)
at com.alibaba.nacos.config.server.service.datasource.ExternalDataSourceServiceImpl.reload(ExternalDataSourceServiceImpl.java:130)
... 168 more
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.FilterRegistrationBean]: Factory method 'authFilterRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter': Unsatisfied dependency expressed through field 'authManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthManager': Unsatisfied dependency expressed through field 'authenticationManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosAuthConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'nacosUserDetailsServiceImpl': Unsatisfied dependency expressed through field 'userPersistService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'externalUserPersistServiceImpl': Unsatisfied dependency expressed through field 'persistService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalStoragePersistServiceImpl': Invocation of init method failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error
Caused by: java.lang.RuntimeException: [db-load-error]load jdbc.properties error
2020-12-15 19:26:09,273 ERROR Nacos failed to start, please see D:\Soft-Dellvostro\Soft\Distributed\Tools\nacos-server-1.4.0\logs\nacos.log for more details.
查了好长时间,没有发现有用的线索。无奈之下,只好从头开始分析日志。发现开头的"nacos is starting with cluster"提醒。于是,查了一下1.1.3到1.3.2再到1.4.0的相关差异,得知1.4.0的默认启动模式就是集群模式。而集群模式在没有进行集群配置的情况下,就会启动失败。
解决办法:将startup.cmd中的set MODE="cluster"修改为set MODE="standalone"。另外,application.properties的所有配置使用默认值即可。我之前尝试解决启动失败问题,曾将# spring.datasource.platform=mysql的注释取消了。该注释取消之后,也会导致Nacos启动失败。
启动成功后,命令行界面显示如下:
2020-12-15 20:07:05,867 INFO Nacos started successfully in stand alone mode. use embedded storage
内容总结
以上是互联网集市为您收集整理的Nacos版本差异导致的启动失败问题(Windows10下)解决办法全部内容,希望文章能够帮你解决Nacos版本差异导致的启动失败问题(Windows10下)解决办法所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。