nacos无法连接Mysql8.0+ | linux服务器部署nacos问题
linux服务器部署nacos问题:
1、端口冲突:启动时报nacos transport error 202: bind failed: 地址已在使用;启动时有看到8000这个端口在日志输出,果断猜测是端口被占用了。netstat -ntulp查看,发现有8000端口。所以修改启动文件startup.sh中的debug端口由8000改为8011。

2、报cluster.conf文件找不到【windows环境没发现这个问题】。将nacos/confcluster.conf.example拷贝一份命名cluster.conf,并修改里面地址为自己的ip
3、报数据库连接不上,三次超时。检查发现没有配置数据库连接地址【windows环境没发现这个问题】
将application.properties.example里面的数据库连接拷一份到application.properties,改为自己的地址。需要在库中建一个nacos库并执行nacos带的sql文件。
#追加到application.properties末尾
pring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://192.168.0.39:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
#db.url.1=jdbc:mysql://11.163.152.9:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=123456
4、改完还报数据库连接不上。。。【迁环境真TM烦】
检查自己的数据库版本,我的是8+,windows环境是7+的
rpm -qi mysql-server
Name : mysql-server
Version : 8.0.21
Release : 1.module_el8.2.0+493+63b41e36
Architecture: x86_64
Install Date: 2021年04月22日 星期四 11时27分35秒
Group : Unspecified
Size : 113732452
License : GPLv2 with exceptions and LGPLv2 and BSD
Signature : RSA/SHA256, 2020年09月17日 星期四 04时22分31秒, Key ID 05b555b38483c65d
Source RPM : mysql-8.0.21-1.module_el8.2.0+493+63b41e36.src.rpm
Build Date : 2020年09月16日 星期三 02时54分05秒
Build Host : x86-02.mbox.centos.org
Relocations : (not relocatable)
Packager : CentOS Buildsys <bugs@centos.org>
Vendor : CentOS
URL : http://www.mysql.com
Summary : The MySQL server and related files
检查驱动包版本:
在nacos根目录下新建文件夹plugins/mysql,并上传驱动

再次启动成功。
更多推荐
所有评论(0)