首页 > 系统相关 >windows 安装Nacos步骤

windows 安装Nacos步骤

时间:2022-08-25 14:24:42浏览次数:172  
标签:core windows 步骤 db Nacos auth server nacos ###

一、Nacos中文文档网址

      

1、Nacos官网地址:https://nacos.io/en-us/ 

Nacos中文文档网址:Nacos 快速开始https://nacos.io/zh-cn/docs/quick-start.html

 

 

2、点击当前版本,主页显示当前版本的一些配置信息

 

 

3、点击Tags,查看历史版本


4、找到你想要的下载的版本,点击DownLoads

5、根据系统选择版本

6、解压后的目录

记得运行sql文件!!!!

sql文件地址在解压之后的: nacos\conf\nacos-mysql.sql

先创建数据库nacos!!!

我的配置文件已经放在这了!!!

 

 

#
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#*************** Spring Boot Related Configurations ***************#
### Default web context path:
server.servlet.contextPath=/nacos
### Default web server port:
server.port=8848

#*************** Network Related Configurations ***************#
### If prefer hostname over ip for Nacos server addresses in cluster.conf:
# nacos.inetutils.prefer-hostname-over-ip=false

### Specify local server's IP:
# nacos.inetutils.ip-address=


#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://192.168.0.179:3306/nacos?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
db.user.0=root
db.password.0=root

### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2

#*************** Naming Module Related Configurations ***************#
### Data dispatch task execution period in milliseconds:
# nacos.naming.distro.taskDispatchPeriod=200

### Data count of batch sync task:
# nacos.naming.distro.batchSyncKeyCount=1000

### Retry delay in milliseconds if sync task failed:
# nacos.naming.distro.syncRetryDelay=5000

### If enable data warmup. If set to false, the server would accept request without local data preparation:
# nacos.naming.data.warmup=true

### If enable the instance auto expiration, kind like of health check of instance:
# nacos.naming.expireInstance=true

nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000


#*************** CMDB Module Related Configurations ***************#
### The interval to dump external CMDB in seconds:
# nacos.cmdb.dumpTaskInterval=3600

### The interval of polling data change event in seconds:
# nacos.cmdb.eventTaskInterval=10

### The interval of loading labels in seconds:
# nacos.cmdb.labelTaskInterval=300

### If turn on data loading task:
# nacos.cmdb.loadDataAtStart=false


#*************** Metrics Related Configurations ***************#
### Metrics for prometheus
#management.endpoints.web.exposure.include=*

### Metrics for elastic search
management.metrics.export.elastic.enabled=false
#management.metrics.export.elastic.host=http://localhost:9200

### Metrics for influx
management.metrics.export.influx.enabled=false
#management.metrics.export.influx.db=springboot
#management.metrics.export.influx.uri=http://localhost:8086
#management.metrics.export.influx.auto-create-db=true
#management.metrics.export.influx.consistency=one
#management.metrics.export.influx.compressed=true


#*************** Access Log Related Configurations ***************#
### If turn on the access log:
server.tomcat.accesslog.enabled=true

### The access log pattern:
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i

### The directory of access log:
server.tomcat.basedir=file:.


#*************** Access Control Related Configurations ***************#
### If enable spring security, this option is deprecated in 1.2.0:
#spring.security.enabled=false

### The ignore urls of auth, is deprecated in 1.2.0:
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**

### The auth system to use, currently only 'nacos' is supported:
nacos.core.auth.system.type=nacos

### If turn on auth system:
nacos.core.auth.enabled=false

### The token expiration in seconds:
nacos.core.auth.default.token.expire.seconds=18000

### The default token:
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789

### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
nacos.core.auth.caching.enabled=true

### Since 1.4.1, Turn on/off white auth for user-agent: nacos-server, only for upgrade from old version.
nacos.core.auth.enable.userAgentAuthWhite=true

### Since 1.4.1, worked when nacos.core.auth.enabled=true and nacos.core.auth.enable.userAgentAuthWhite=false.
### The two properties is the white list for auth and used by identity the request from other server.
nacos.core.auth.server.identity.key=
nacos.core.auth.server.identity.value=

#*************** Istio Related Configurations ***************#
### If turn on the MCP server:
nacos.istio.mcp.server.enabled=false



###*************** Add from 1.3.0 ***************###


#*************** Core Related Configurations ***************#

### set the WorkerID manually
# nacos.core.snowflake.worker-id=

### Member-MetaData
# nacos.core.member.meta.site=
# nacos.core.member.meta.adweight=
# nacos.core.member.meta.weight=

### MemberLookup
### Addressing pattern category, If set, the priority is highest
# nacos.core.member.lookup.type=[file,address-server]
## Set the cluster list with a configuration file or command-line argument
# nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809
## for AddressServerMemberLookup
# Maximum number of retries to query the address server upon initialization
# nacos.core.address-server.retry=5
## Server domain name address of [address-server] mode
# address.server.domain=jmenv.tbsite.net
## Server port of [address-server] mode
# address.server.port=8080
## Request address of [address-server] mode
# address.server.url=/nacos/serverlist

#*************** JRaft Related Configurations ***************#

### Sets the Raft cluster election timeout, default value is 5 second
# nacos.core.protocol.raft.data.election_timeout_ms=5000
### Sets the amount of time the Raft snapshot will execute periodically, default is 30 minute
# nacos.core.protocol.raft.data.snapshot_interval_secs=30
### raft internal worker threads
# nacos.core.protocol.raft.data.core_thread_num=8
### Number of threads required for raft business request processing
# nacos.core.protocol.raft.data.cli_service_thread_num=4
### raft linear read strategy. Safe linear reads are used by default, that is, the Leader tenure is confirmed by heartbeat
# nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe
### rpc request timeout, default 5 seconds
# nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000

 

我这边只修改了

#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://192.168.0.179:3306/nacos?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true
db.user.0=root
db.password.0=root

 

由于startup.cmd默认启动方式是cluster模式,在本地运行是需要改成standalone模式

 

 

 修改后

 

 

7、点击bin文件夹,启动startup.cmd

 

 

 

 

 

8、打开浏览器输入:http://localhost:8848/nacos/#/logi

 

 

 

9、在浏览器里面输入http://127.0.0.1:8848/nacos,然后再打开的首页输入Nacos的账号:nacos和密码:nacos,就可以登录刚刚启动的Nacos
10、出现下面页面,登录成功

 

 


======================================================================================
踩坑:
nacos启动有两种方式
方式一:直接点击bin目录下的startup.cmd启动
方式二:在bin目录下启动cmd,输入:startup.cmd启动

坑:启动服务失败,启动闪退

 

 


报错:此时不应有 \software\nacos"\logs\java_heapdump.hprof"。

错误原因:解压地址包含中文路径

三、注意事项
1、Nacos在双击startup.cmd启动时提示:Unable to start embedded Tomcat.

这是因为这里Nacos没有配置集群模式,而startup.cmd默认启动方式是cluster集群模式,所以只需要在startup.cmd启动文件中将MODE的值cluster改成standalone就可以单机模式启动。

标签:core,windows,步骤,db,Nacos,auth,server,nacos,###
From: https://www.cnblogs.com/AllWjw/p/16624151.html

相关文章

  • Vue项目创建(完整步骤级版本查看)
    涉及软件版本:Nodev14.17.0;npm6.14.13;vue3.2.13;@vue/cli5.0.8一:安装node、npm1.检查Node,未安装【https://nodejs.org/en/】访问网址下载最新版安装2.检查......
  • pytest系列——allure(二)之添加测试用例步骤(@allure.step())
    前言在编写自动化测试用例的时候经常会遇到需要编写流程性测试用例的场景,一般流程性的测试用例的测试步骤比较多,我们在测试用例中添加详细的步骤会提高测试用例的可阅读性......
  • APL概述和使用步骤和Scanner概述及其API文档的使用
    APL概述和使用步骤 概述:API(ApplicationProgrammingInterface),应用程序编程接口。JavaAPl是一本程序员的字典,JDK中提供给我们使用的类的说明文档。这些类将底层的代......
  • Q:windows系统如何开机启动批处理脚本
    方法11、win+r输入gpedit.msc进入本地策略管理器  2、点击windows设置下的脚本(启动/关机),然后双击启动。   3、点击添加,然后点击浏览,选择批处理文件然后点击......
  • librtmp推流步骤介绍
    一、概述案例:使用nginx+rtmpdump搭建一个简单的流媒体服务器,使用rtmplib来实现推流librtmp推流步骤:  二、代码示例/***开始推理*@parama......
  • redis 2.2.7 for Windows
    PECL::Package::redis2.2.7forWindows http://pecl.php.net/package/redis/2.2.7/windowsredis2.2.7forWindowsPackageInformationSummaryPHPex......
  • 终于等到了!Windows电脑桌面上的便签可以同步到手机了
    有不少上班族在工作时如果想要随手记录一些工作注意事项、待办工作任务、常用的文字资料等内容,就会发现直接在电脑桌面上记事是非常方便的,能够有效节省工作效率。但是有很......
  • 二、Spring Cloud Alibaba,Nacos
    1、下载nacos官网:https://nacos.io/zh-cn/index.html下载地址:https://github.com/alibaba/nacos/releases选择对应版本:2.1.0https://github.com/alibaba/nacos/releas......
  • windows10-msys2-msvc编译ffmpeg4.4.2
    下载msys2在msys2安装目录下创建文件msys2_ffmpeg.batcall"D:\ProgramFiles\MicrosoftVisualStudio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"setMSY......
  • Windows10 pybind11 opencv 和numpy相互转换 (tcy)
      利用pybind11实现python和C++图像之间的相互调用。将Mat类引入python中。 图像相互转换通过左值引用及智能指针实现。封装了类操作及8个函数(Mat和numpy......