1,下载
https://github.com/alibaba/nacos/releases
2,解压
3,将nacos的内置库(derby),修改为我们自己的 mysql
3.1 创建一个数据库
3.2 连接数据库
3.3 执行mysql 脚本,在nacos的conf 目录下 mysql-schema.sql
执行完成 12张表
3.4 接着需要改nacos配置文件 文件/conf/application.properties
#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
### Deprecated configuration property, it is recommended to use `spring.sql.init.platform` replaced.
pring.datasource.platform=mysql
spring.sql.init.platform=mysql### Count of DB:
db.num=1### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root
保存并关闭
4,修改模式
编辑/bin/startup.cmd,单击右键编辑哦
set MODE="standalone"
5,启动
双击 bin/startup.cmd
成功!!!
6,启用鉴权
官方文档:https://nacos.io/zh-cn/docs/v2/guide/user/auth.html
具体配置:
修改配置文件:/conf/application.properties
### The auth system to use, currently only 'nacos' and 'ldap' is supported:
nacos.core.auth.system.type=nacos### If turn on auth system:
nacos.core.auth.system.type=nacos
nacos.core.auth.enabled=true### 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=false### 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=### worked when nacos.core.auth.system.type=nacos
### The token expiration in seconds:
nacos.core.auth.plugin.nacos.token.cache.enable=false
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
### The default token (Base64 String):
nacos.core.auth.plugin.nacos.token.secret.key=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg=
### The two properties is the white list for auth and used by identity the request from other server.
nacos.core.auth.server.identity.key=serverIdentity
nacos.core.auth.server.identity.value=security
获取控制台最新地址,登录
输入用户名/密码:nacos/nacos