当前位置:   article > 正文

Windows环境下nacos的下载与安装_nacos下载安装windows

nacos下载安装windows

一、nacos的下载地址:https://github.com/alibaba/nacos

根据自己项目配置的版本,下载对应的nacos客户端。

windows下载zip安装包,linux下载tar.gz包

二、下载解压成功后,修改配置文件D:\nacos\bin下面的startup.cmd。

把set MODE="cluster",默认是集群启动,修改为standalone单机模式启动。

三、新建nacos数据库,并导入conf目录下的nacos-mysql.sql文件。

建库

生成nacos表

四、修改打开conf目录下的application.properties配置文件,配置数据库。


  1. # db mysql
  2. spring.datasource.platform=mysql
  3. db.num=1
  4. db.url.0=jdbc:mysql://localhost:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
  5. db.user=root
  6. db.password=123456

在bin目录下双击startup.cmd文件运行nacos,启动成功。

nacos启动

五、浏览器输入对应的网址进行登录,用户名和密码默认nacos/nacos


nacos配置成Windows服务自启动

六、下载nssm,

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

  1. 2022-06-29 09:18:04,065 ERROR Startup errors :
  2. 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
  3. 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
  4. 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
  5. ]: 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
  6. 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
  7. 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
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/505637
推荐阅读
相关标签
  

闽ICP备14008679号