1.下载源码

git clone https://github/alibaba/nacos.gitGitHub - alibaba/nacos: an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.https://github/alibaba/nacos.git

 或者直接到nacos github官网下载源码

2. 设置项目maven,本地仓库

3.设置jdk 1.8或更高版本

4.用mvn 编译项目 

mvn clear install -Dmaven.test.skip=true 来跳过测试项,否则在编译项目时,因为test项目中的问题会报错

5.运行项目中console模块中启动类Nacos

如果提示com.alibaba.nacos.consistency.entity包中实体类不存在,可以在maven-》lifecycle-》compile 编译consistency,然后再次运行console中的启动类Nacos

6.运行之后你会发现报错,是因为集群的问题,你可以在启动时设置单机模式

在这里编辑启动配置 -Dnacos.standalone=true即可

 

 7.重新运行项目,正常启动后,可以在http://localhost:8848/nacos 访问nacos,默认登录名称和密码均为:nacos

更多推荐

Nacos源码启动全过程