Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 启动nacos报错 #2

Open
guanxiangkai opened this issue Jan 28, 2023 · 12 comments
Open

Ubuntu 启动nacos报错 #2

guanxiangkai opened this issue Jan 28, 2023 · 12 comments

Comments

@guanxiangkai
Copy link

2023-01-28 18:18:02,933 ERROR


APPLICATION FAILED TO START


Description:

Failed to bind properties under 'db.pool.config' to com.zaxxer.hikari.HikariDataSource:

Property: db.pool.config.driver-class-name
Value: org.postgresql.Driver
Origin: System Environment Property "db.pool.config.driverClassName"
Reason: java.lang.RuntimeException: Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader

Action:

Update your application's configuration
配置文件如下
MODE=standalone
PREFER_HOST_MODE=hostname
spring.datasource.platform=postgresql
db.url.0=jdbc:postgresql://127.0.0.1:5432/nacos_config?tcpKeepAlive=true&reWriteBatchedInserts=true&ApplicationName=nacos_java
db.user=postgres
db.password=Guan1014

@wuchubuzai2018
Copy link
Owner

看看插件jar包是否放到了plugins目录下了,同时在看看打包出来的jar是否存在postgresql的JDBC驱动

@guanxiangkai
Copy link
Author

插件jar包已经放到了plugins目录下了
7ecc06107b023b02f196b1c6e89596f
jar是直接在github上下载打包好的,我也解析了,里面是有在postgresql的JDBC驱动
47045964382ab17355a42fa780bf676

@linht12
Copy link

linht12 commented Jan 30, 2023

我在hub.docker上下载的镜像docker pull nacos/nacos-server,然后替换配置和导入插件plugins,也是报错
image
直接拉去nacos的源码,进行编译,然后修改配置和导入插件plugins,就没错

@guanxiangkai
Copy link
Author

我也是一样的源码启动是可以,但是docker启动nacos-server不行

@linht12
Copy link

linht12 commented Jan 30, 2023

@guanxiangkai @wuchubuzai2018
可以看启动的bin/startup.sh文件中是否有:
JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins,${BASE_DIR}/plugins/health,${BASE_DIR}/plugins/cmdb,${BASE_DIR}/plugins/selector"
没有的话,加进去就可以了
image

@linht12
Copy link

linht12 commented Jan 31, 2023

@guanxiangkai
把镜像拉下来,修改启动的命令docker-startup.sh就可以了,增加这句话
JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins,${BASE_DIR}/plugins/health,${BASE_DIR}/plugins/cmdb,${BASE_DIR}/plugins/selector"
image

然后我重新创建的镜像命令如下:
FROM nacos/nacos-server:v2.2.0

#ARG JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins,${BASE_DIR}/plugins/health,${BASE_DIR}/plugins/cmdb,${BASE_DIR}/plugins/selector"
ADD nacos/bin/docker-startup.sh bin/docker-startup.sh
ADD nacos/conf/application.properties /home/nacos/conf/application.properties
ADD nacos/plugins/nacos-postgresql-plugin-1.0.0.jar /home/nacos/plugins/nacos-postgresql-plugin-1.0.0.jar

@guanxiangkai
Copy link
Author

@linht12 谢谢

@jwh5566
Copy link

jwh5566 commented Feb 21, 2023

我看最新版的nacos中的startup.sh 已经有plugins的路径了,为什么启动的时候 还是报这个错误呢??

@guanxiangkai
Copy link
Author

我看最新版的nacos中的startup.sh已经有plugins的路径了,为什么启动的时候还是报这个错误呢??

你是docker启动的吗?

@jwh5566
Copy link

jwh5566 commented Feb 21, 2023

不是的 官网下载的nacos-server

@guanxiangkai
Copy link
Author

nacos-server

你插件有放在plugins目录下吗?官网上的我这边启动时没问题,只有在docker上才会出现这个问题,因为docker打包的没有这个路径

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants