赞
踩
根据自己项目配置的版本,下载对应的nacos客户端。
windows下载zip安装包,linux下载tar.gz包
把set MODE="cluster",默认是集群启动,修改为standalone单机模式启动。
建库
生成nacos表
- # db mysql
- spring.datasource.platform=mysql
- db.num=1
- db.url.0=jdbc:mysql://localhost:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
- db.user=root
- db.password=123456
在bin目录下双击startup.cmd文件运行nacos,启动成功。
nacos启动
nacos配置成Windows服务自启动
http://www.nssm.cc/download,解压;
解压 解压
cmd
nssm配置nacos服务
Install service;
Nacos服务
大功告成!!!
1.缺少vc++ 2015导致如下报错。下载链接:https://www.microsoft.com/zh-CN/download/details.aspx?id=48145
- 2022-06-29 09:18:04,065 ERROR Startup errors :
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/D:/java_project/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.1.0.ja
- r!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creati
- ng bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/D:/java_project/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.1.0.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class
- ]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [j
- ar:file:/D:/java_project/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.1.0.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; neste
- d exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.l
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。