nacos -- Linux上部署

背景:

        之前在window上部署了nacos,现在在linux也部署

下载可参考nacos -- 下载 启动 登录_nacos登录地址_小白的码BUG之路的博客-CSDN博客

问题:

        1:解压启动后第一个遇到的问题就是集群问题,修改成单点启动

        参考命令

sh startup.sh -m standalone

        2:mysql连接错误

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grpcSdkServer': Invocation of init method failed; nested exception is java.io.IOException: Failed to bind

        配置文件application.properties加上数据库连接配置

spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://192.168.0.108:3306/ry-config-dev?characterEncoding=utf8&connectTimeout=10000&socketTimeout=30000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0=root
db.password.0=password

重要的是要在数据库连接后面加上&allowPublicKeyRetrieval=true,不然容易报错

结果:

        启动成功,也默认配置已经从数据量加载 

猜你喜欢

转载自blog.csdn.net/DGH2430284817/article/details/130349579