问题1.数据库问题
在github下载nacos的最新版release版本解压之后
使用start.cmd
无法直接启动
抛出以下错误:
java.lang.illegalargumentexception: db.num is null
java.lang.runtimeexception: [db-load-error]load jdbc.properties error
解决办法
在mysql中创建nacos数据库
进入nacos\conf
目录下
使用 nacos-mysql.sql
初始化数据库
修改 application.properties
中的配置信息:
### count of db: ##打开注释 db.num=1 ### connect url of db: ##修改数据库配置信息 db.url.0=jdbc:mysql://192.168.235.137:3306/nacos?characterencoding=utf8&connecttimeout=1000&sockettimeout=3000&autoreconnect=true&useunicode=true&usessl=false&servertimezone=utc db.user.0=root db.password.0=root
问题2.启动模式问题
修改完成之后重新启动抛出新的异常
nacos默认启动方式是集群
这里是单机启动所以启动不了
org.springframework.context.applicationcontextexception: unable to start web server; nested exception is org.springframework.boot.web.server.webserverexception: unable to start embedded tomcat
解决办法
修改nacos\bin
目录下的 start.cmd
文件中的 set mode=“cluster” 为 set mode=“standalone”
保存重新启动即可
set mode="standalone"
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论