centos linux中使用docker关于nacos启动异常
nacos启动出现异常:
Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure :No DataSource set
在docker中启动nacos发先启动异常可以先查询docker中的镜像
docker images查询所有的镜像有nacos的
使用docker ps -a查询容器的运行情况
先关闭nacos
docker stop nacos
然后移除现有的nacos 容器
docker rm nacos
最后可以使用在配置好mysql数据库的连接
docker run -d
-e MODE=standalone
-e PREFER_HOST_MODE=hostname
-e SPRING_DATASOURCE_PLATFORM=mysql
-e MYSQL_SERVICE_HOST=(自己虚拟机ip)
-e MYSQL_SERVICE_PORT=3306
-e MYSQL_SERVICE_USER=(mysql的用户名)
-e MYSQL_SERVICE_PASSWORD=(mysql的连接密码)
-e MYSQL_SERVICE_DB_NAME=nacos
-p 8848:8848
--name nacos
--restart=always
nacos/nacos-server:1.4.1
