美文网首页
springboot使用Nacos

springboot使用Nacos

作者: 无尘粉笔 | 来源:发表于2020-06-26 22:29 被阅读0次

官方地址

nacos快速开始

首先下载运行nacos服务器。
通过git下载,并启动。

git clone https://github.com/alibaba/nacos.git
cd nacos/
mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U  
ls -al distribution/target/
cd distribution/target/nacos-server-$version/nacos/bin

打开解压缩包,mvn打包之后,进入nacos/bin打开start.cmd

可以看到运行界面。


%W{)92D`87ODWNTE1S}%C_U.png

接下来创建一个springboot项目
添加依赖

<dependency>
    <groupId>com.alibaba.boot</groupId>
    <artifactId>nacos-config-spring-boot-starter</artifactId>
    <version>${latest.version}</version>
</dependency>

然后可以在配置文件中添加

nacos.config.server-addr=127.0.0.1:8848

相关文章

网友评论

      本文标题:springboot使用Nacos

      本文链接:https://www.haomeiwen.com/subject/tyecohtx.html