1:下载源码
GitHub - alibaba/nacos: an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.https://github.com/alibaba/nacosGitHub - alibaba/nacos: an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
2:导入数据
数据库文件路径:/nacos-develop/distribution/conf/mysql-schema.sql
3:修改数据库信息
nacos-develop/console/src/main/resources/application.properties
4:运行maven命令
mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
5:移动jar包位置
拷贝 nacos-develop/console/target/nacos-server.jar
到 nacos-develop/distribution/target/ 目录
6:启动
sh startup.sh -m standalone
7:访问
localhost:8848/nacos
账号密码都是nacos
常见问题
一、No DataSource set
解决方案:
在distribution/conf 下的application.properties 里写好连接地址,用户名密码
二、Unable to access jarfile ***nacos\distribution\target\nacos-server.jar
解决方案:
拷贝 nacos-develop/console/target/nacos-server.jar到 nacos-develop/distribution/target/ 目录
三、UnknownHostException
解决方案
startup.cmd中的启动模式修改为单机启动
set MODE=“standalone”
四、Error creating bean with name ‘grpcClusterServer’
原因:Nacos 2.0版本新增了gRPC的通信方式,因此需要增加2个端口,8848和9848
解决方案
查看该端口是否被占用,关掉占用的端口就好了
mac 可以使用命令lsof -i tcp:9848 ,杀掉进程就好了,kill pid