
# 配置项说明
表1配置参数详解 
| 参数名称           | 是否必选 | 参数类型                    | 取值范围                                                                                                                                                                                                                                                                                                    | 描述                                             |
|:---|:---|:---|:---|:---|
| props          | 否    | PropertiesConfiguration | 请参考[PropertiesConfiguration数据结构说明]。                                                                                                                                                                                                                                  | MAS监控配置，配合etcd使用。                              |
| etcd           | 否    | EtcdConfiguration       | 请参考[EtcdConfiguration数据结构说明]。                                                                                                                                                                                                                                     | etcd配置，如配置，则会从远端拉取。                            |
| redis          | 是    | RedisConfiguration      | 请参考[RedisConfiguration数据结构说明]。                                                                                                                                                                                                                                          | RedisServer配置。                                 |
| routeAlgorithm | 是    | string                  | - single-read-write  - local-read-single-write  - double-write   | 路由算法。                                          |
| active         | 是    | string                  | 只能是"dc1"或"dc2"。                                                                                                                                                                                                                                                                                         | 激活的Redis。  |
| chaos          | 否    | InjectionProperties     | 请参考[InjectionProperties数据结构说明](https://support.huaweicloud.com/devg-mas/mas-devg-0071.html#mas-devg-0071__table10717101013349)                                                                                                                                                                          | 故障注入相关配置。                                      |
   
 表2RedisConfiguration数据结构说明 
| 参数名称                            | 是否必选 | 参数类型                             | 取值范围                                                                            | 描述                       |
|:---|:---|:---|:---|:---|
| nearest                         | 否    | string                           | 只能是"dc1"或"dc2"。                                                                 | 指明哪个是近端Redis。            |
| asyncRemoteWrite**.**retryTimes | 否    | int                              | 默认为3。                                                                           | 异步写远端操作重试次数。             |
| connectionPool.enable           | 否    | bool                             | true/false默认true。                                                               | 是否启用连接池。                 |
| asyncRemotePool                 | 否    | AsyncRemotePoolConfiguration     | 请参考[AsyncRemotePoolConfiguration数据结构说明]。        | 异步写线程池配置。                |
| servers                         | 是    | map\[string\]ServerConfiguration | key为dc1/dc2 单个维度请参考[ServerConfiguration数据结构说明]。 | dc1，dc2的RedisServer连接配置。 |
   
 表3AsyncRemotePoolConfiguration数据结构说明 
| 参数名称           | 是否必选 | 参数类型   | 取值范围                | 描述                        |
|:---|:---|:---|:---|:---|
| threadCoreSize | 否    | int    | -                   | 线程池的基本大小。                 |
| persist        | 否    | bool   | true/false 默认false。 | 命令是否持久化，否：速度快；是：速度比非持久化低。 |
| taskQueueSize  | 否    | int    | 默认5。                | 缓冲队列数。                    |
| persistDir     | 否    | string | 默认根目录"/"。           | Redis日志文件目录。              |
   
 表4ServerConfiguration数据结构说明 
| 参数名称     | 是否必选 | 参数类型                              | 取值范围                                                                             | 描述                   |
|:---|:---|:---|:---|:---|
| hosts    | 是    | string                            | -                                                                                | RedisServer地址。       |
| password | 是    | string                            | -                                                                                | RedisServer密码。       |
| type     | 是    | string                            | cluster, master-slave, normal。                                                   | RedisServer类型。       |
| cloud    | 是    | string                            | -                                                                                | RedisServer所属云。      |
| region   | 是    | string                            | -                                                                                | RedisServer所属Region。 |
| azs      | 是    | string                            | -                                                                                | RedisServer所属AZ。     |
| pool     | 否    | ServerConnectionPoolConfiguration | 请参考[ServcerConnectionPoolConfiguration数据结构说明]。 | 连接池配置。               |
   
 表5ServcerConnectionPoolConfiguration数据结构说明 
| 参数名称                          | 是否必选 | 参数类型 | 取值范围 | 描述                                        |
|:---|:---|:---|:---|:---|
| maxTotal                      | 否    | int  | -    | 最大活动对象数。                                  |
| maxIdle                       | 否    | int  | -    | 最大能够保持idle状态的对象数。                         |
| minIdle                       | 否    | int  | -    | 最小能够保持idle状态的对象数。                         |
| maxWaitMillis                 | 否    | int  | -    | 当池内没有返回对象时，最大等待时间。                        |
| timeBetweenEvictionRunsMillis | 否    | int  | -    | 空闲连接检测线程，检测的周期，毫秒数。如果为负值，表示不运行检测线程。默认为-1。 |
   
 表6PropertiesConfiguration数据结构说明 
| 参数名称      | 是否必选 | 参数类型   | 取值范围 | 描述          |
|:---|:---|:---|:---|:---|
| version   | 是    | string | -    | 项目版本号。      |
| appId     | 是    | string | -    | 项目组名称。      |
| monitorId | 是    | string | -    | 监控组名称。      |
| cloud     | 否    | string | -    | 项目部署云组。     |
| region    | 否    | string | -    | 项目部署region。 |
| azs       | 否    | string | -    | 项目部署AZ。     |
   
 表7EtcdConfiguration数据结构说明 
| 参数名称        | 是否必选 | 参数类型   | 取值范围       | 描述         |
|:---|:---|:---|:---|:---|
| address     | 是    | string | -          | Etcd地址。    |
| apiVersion  | 是    | string | v3         | Etcd版本。    |
| username    | 是    | string | -          | Etcd用户名。   |
| password    | 是    | string | -          | Etcd密码。    |
| httpsEnable | 是    | bool   | true/false | 是否启用https。 |
   
