栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Nacos服务配置与虚拟机数据库连接

Nacos服务配置与虚拟机数据库连接

1、Application启动异常

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
大意:数据库未正常连接或未配置

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
2、解决方式——Nacos页面新建命名空间 Maven配置类——命名空间名

在Nacos新建命名空间——命名与Maven项目配置文件一致


3、数据库连接异常

create connection SQLException, url: jdbc:mysql://localhost:3306/pd_sms?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true, errorCode 0, state 08001 
4、解决方式——在Nacos配置区修改数据库配置文件

需先配置好命名空间才能进行这一步

修改IP地址到虚拟机IP

之所以如此是因为本地MySQL版本过低——别骂,就想试试虚拟机数据库



5、端口占用问题及解决

netty服务启动异常-Address already in use: bind
# 根据报错信息查找文件
[com.itherima.sms.netty.NettyServer.start:63]

6、Nacos注册问题——尚未解决,但不影响功能

nacos registry, pd-sms-api register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', endpoint='', namespace='pinda-sms', watchDelay=30000, logName='', service='pd-sms-api', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD, management.endpoints.web.base-path=/actuator, management.context-path=/actuator}, registerEnabled=true, ip='192.168.220.1', networkInterface='', port=8771, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null}}, 
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/335857.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号