mirror of
https://gitee.com/shikong-sk/springcloud-study
synced 2024-11-14 20:41:17 +08:00
52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
### Nacos
|
|
#### 从 github 上下载对应环境的安装包
|
|
> https://github.com/alibaba/nacos/releases
|
|
|
|
解压后执行
|
|
```shell
|
|
cd nacos/bin
|
|
```
|
|
|
|
##### linux
|
|
```shell
|
|
# 默认为 cluster 集群模式
|
|
# sh startup.sh
|
|
sh startup.sh -m standalone
|
|
```
|
|
|
|
##### windows
|
|
单机模式
|
|
```shell
|
|
# 默认为 cluster 集群模式
|
|
# startup.cmd
|
|
startup.cmd -m standalone
|
|
```
|
|
|
|
##### 默认账号密码为 nacos nacos
|
|
|
|
#### 单机模式下配置 mysql
|
|
先在数据库中创建数据库
|
|
并执行 **conf/mysql-schema.sql** 初始化数据库表
|
|
|
|
编辑 conf/application.properties
|
|
修改 Config Module Related Configurations 部分
|
|
```properties
|
|
spring.sql.init.platform=mysql
|
|
|
|
### Count of DB:
|
|
db.num=1
|
|
|
|
### Connect URL of DB:
|
|
db.url.0=jdbc:mysql://[数据库ip]:[端口]/[数据库名]?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
|
db.user.0=[数据库账号]
|
|
db.password.0=[数据库密码]
|
|
|
|
### Connection pool configuration: hikariCP
|
|
db.pool.config.connectionTimeout=30000
|
|
db.pool.config.validationTimeout=10000
|
|
db.pool.config.maximumPoolSize=20
|
|
db.pool.config.minimumIdle=2
|
|
```
|
|
|
|
|