Nacos官网地址下载
下载对应的tag版本
我这里以1.4.1版本为演示版本
找不到包com.alibaba.nacos.consistency.entity,原因是应为这个需要protobuf编译生成,我们可以安装protobuf打包工具生成这个包,当然我们也有简单的办法就是install一下consistency这个模块。
报错如下
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) at com.alibaba.nacos.Nacos.main(Nacos.java:35)
原因是环境变量有些问题,我们在main方法中添加两行代码
public static void main(String[] args) {
System.setProperty("nacos.standalone", "true");
System.setProperty("nacos.core.auth.enabled", "false");
SpringApplication.run(Nacos.class, args);
}
重新启动
访问测试
持久化数据库



