ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

黑马头条D1 nacos

2026/9/23 22:35:17 拓冰建站 浏览量
黑马头条D1 nacos

我是南城余!阿里云开发者平台专家博士证书获得者!

欢迎关注我的博客!一同成长!

一名从事运维开发的worker,记录分享学习。

专注于AI,运维开发,windows Linux 系统领域的分享!

知识库链接:

黑马头条D1 · 语雀

1. 安装

docker pull nacos/nacos-server:1.2.0#创建容器
docker run --env MODE=standalone --name nacos --restart=always -d -p 8848:8848 nacos/nacos-server:1.2.0

2. 注册微服务

Data-ID需要与上方bootstrap的yml终的name对应

3. 配置YML

spring:datasource:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://106.14.202.122:3306/leadnews_article?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTCusername: rootpassword: 123
# 设置Mapper接口所对应的XML文件位置,如果你在Mapper接口中有自定义方法,需要进行该配置
mybatis-plus:mapper-locations: classpath*:mapper/*.xml# 设置别名包扫描路径,通过该属性可以给包中的类注册别名type-aliases-package: com.heima.model.article.pojos