https://github.com/alibaba/nacos/releases
压缩包解压,找到startup.cmd,我的是在E:\nacos\nacos-server-2.2.0\nacos\bin目录下。
然后在当前目录下打开终端cmd,输入:
.\startup.cmd -m standalone
因为nacos默认是集群启动,这里用单机,那就加入后缀-m
默认端口是8848,访问:http://localhost:8848/nacos,账号密码默认nacos
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
不用加版本号,因为在此基础上引入的cloud依赖中统一规定了版本号
<!--spring-cloud-alibaba组件包管理-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${springcloud.alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<springcloud.alibaba.version>2.2.2.RELEASE</springcloud.alibaba.version>
</properties>