https://sca.aliyun.com/zh-cn/docs/2021.0.5.0/user-guide/nacos/quick-start
https://github.com/alibaba/nacos/releases
startup.cmd -m standalone
http://127.0.0.1:8848/nacos/#/login
userName:nacos
passWord:nacos
阿里云仓库镜像地址查看对应版本
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>2021.0.5.0</version>
</dependency>
spring:
cloud:
nacos:
serverAddr: 127.0.0.1:8848
config:
import:
- nacos:nacos-config-example.properties?refresh=true
控制台方式:
dataId 为:nacos-config-example.properties
group 为:DEFAULT_GROUP
配置内容:
spring.cloud.nacos.config.serveraddr=127.0.0.1:8848
spring.cloud.nacos.config.prefix=PREFIX
spring.cloud.nacos.config.group=GROUP
spring.cloud.nacos.config.namespace=NAMESPACE
@RefreshScope
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2021.0.5.0</version>
</dependency>
spring:
cloud:
nacos:
serverAddr: 127.0.0.1:8848
discovery:
server-addr: 127.0.0.1:8848 #表示注册到哪个注册中心
config:
import:
- nacos:nacos-config-example.properties?refresh=true
application:
name: abcdefg #应用名