-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: papa-hexuan <[email protected]>
- Loading branch information
1 parent
bae81ff
commit 56b2c45
Showing
4 changed files
with
60 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,53 +10,49 @@ | |
|
||
| 名称 | 类型 | 描述 | | ||
| :------------: | :-----------: | :----------------------------: | | ||
| `addr` | string | 连接地址 | | ||
| `password` | string | 密码 | | ||
| `master.addr` | string | 主节点dns连接地址,包含用户名密码 | | ||
| `slaves.addr` | []string | 从节点dns连接地址 包含用户名密码 | | ||
| `db` | int | 默认为0, 一般应用不推荐使用DB分片 | | ||
| `poolSize` | int | 集群内每个节点的最大连接池限制 默认每个CPU10个连接 | | ||
| `maxRetries` | int | 网络相关的错误最大重试次数 默认8次 | | ||
| `minIdleConns` | int | 最小空闲连接数 | | ||
| `dialTimeout` | time.Duration | 拨超时时间 | | ||
| `readTimeout` | time.Duration | 读超时 默认3s | | ||
| `writeTimeout` | time.Duration | 写超时 默认3s | | ||
| `idleTimeout` | int | 连接最大空闲时间,默认60s, 超过该时间,连接会被主动关闭 | | ||
| `debug` | bool | 是否开启debug | | ||
| `poolSize` | int | 每个节点的最大连接池限制 默认200个连接 | | ||
| `maxRetries` | int | 网络相关的错误最大重试次数,默认0次 | | ||
| `minIdleConns` | int | 最小空闲连接数,默认20 | | ||
| `dialTimeout` | time.Duration | 拨超时时间,默认3s | | ||
| `readTimeout` | time.Duration | 读超时,默认1s | | ||
| `writeTimeout` | time.Duration | 写超时,默认1s | | ||
| `idleTimeout` | int | 连接最大空闲时间,默认60s, 超过该时间,连接会被主动关闭 | | ||
| `readOnMaster` | bool | 是否开启主节点读,默认true | | ||
| `debug` | bool | 是否开启debug,默认false | | ||
| `slowThreshold` | bool | 慢日志记录阈值,默认250ms | | ||
| `enableMetric` | bool | 是否开启metric上报,默认true | | ||
| `enableTrace` | bool | 是否开启trace,默认true | | ||
| `enableAccessLog` | bool | 是否开启access记录,默认false | | ||
| .... | | | | ||
|
||
#### 示例 | ||
|
||
```toml | ||
[jupiter.redis.myredis.stub] | ||
addr = "ip:port" | ||
password = "xxxxxxxx" | ||
[jupiter.redis] | ||
[jupiter.redis.test] | ||
[jupiter.redis.test.stub] | ||
dialTimeout="2s" | ||
readTimeout="5s" | ||
idleTimeout="60s" | ||
debug=true | ||
[jupiter.redis.test.stub.master] | ||
addr="redis://username:[email protected]:6379" # password可包含: | ||
[jupiter.redis.test.stub.slaves] | ||
addr=[ | ||
"redis://username:[email protected]:6379",# password可包含: | ||
] | ||
``` | ||
|
||
addr是dns连接包含用户名密码 | ||
- 无密码写法 | ||
`redis://127.0.0.2:6379` | ||
- 无用户名有密码写法 | ||
`redis://:[email protected]:6379` password前的`:`不可缺省 | ||
- 有用户名有密码写法 | ||
`redis://username:[email protected]:6379` | ||
### RedisClusterConfig | ||
|
||
#### 配置项 | ||
|
||
| 名称 | 类型 | 描述 | | ||
| :------------: | :-----------: | :----------------------------: | | ||
| `addrs` | \[\]string | 连接地址 | | ||
| `password` | string | 密码 | | ||
| `db` | int | 默认为0, 一般应用不推荐使用DB分片 | | ||
| `poolSize` | int | 集群内每个节点的最大连接池限制 默认每个CPU10个连接 | | ||
| `maxRetries` | int | 网络相关的错误最大重试次数 默认8次 | | ||
| `minIdleConns` | int | 最小空闲连接数 | | ||
| `dialTimeout` | time.Duration | 拨超时时间 | | ||
| `readTimeout` | time.Duration | 读超时 默认3s | | ||
| `writeTimeout` | time.Duration | 写超时 默认3s | | ||
| `idleTimeout` | int | 连接最大空闲时间,默认60s, 超过该时间,连接会被主动关闭 | | ||
| `debug` | bool | 是否开启debug | | ||
| `idleTimeout` | int | 连接最大空闲时间,默认60s, 超过该时间,连接会被主动关闭 | | ||
| `readOnly` | bool | 集群模式 在从属节点上启用读模式 | | ||
| .... | | | | ||
|
||
#### 示例 | ||
|
||
```toml | ||
[jupiter.redis.myredis.cluster] | ||
addrs =["ip:port","ip:port","ip:port"] | ||
password = "xxxxxxxx" | ||
``` | ||
暂不支持,后面有需要再加 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.