提交 a9fc9195 编写于 作者: M menghaoranss

update orchestration configuration manual of sharding-jdbc

上级 2640d517
......@@ -233,11 +233,11 @@ spring.shardingsphere.sharding.tables.t_order_item.key-generator.column=order_it
spring.shardingsphere.sharding.binding-tables=t_order,t_order_item
spring.shardingsphere.sharding.broadcast-tables=t_config
spring.shardingsphere.orchestration.name=spring_boot_ds_sharding
spring.shardingsphere.orchestration.overwrite=true
spring.shardingsphere.orchestration.registry.type=zookeeper
spring.shardingsphere.orchestration.registry.namespace=orchestration-spring-boot-sharding-test
spring.shardingsphere.orchestration.registry.server-lists=localhost:2181
spring.shardingsphere.orchestration.spring_boot_ds_sharding.orchestration-type=registry_center,config_center
spring.shardingsphere.orchestration.spring_boot_ds_sharding.instance-type=zookeeper
spring.shardingsphere.orchestration.spring_boot_ds_sharding.server-lists=localhost:2181
spring.shardingsphere.orchestration.spring_boot_ds_sharding.namespace=orchestration-spring-boot-sharding-test
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.overwrite=true
```
### JNDI
......@@ -365,15 +365,14 @@ spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.en
```properties
#省略数据源、数据分片、读写分离和数据脱敏配置
spring.shardingsphere.orchestration.name= #治理实例名称
spring.shardingsphere.orchestration.overwrite= #本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准
spring.shardingsphere.orchestration.registry.type= #配置中心类型。如:zookeeper
spring.shardingsphere.orchestration.registry.server-lists= #连接注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181
spring.shardingsphere.orchestration.registry.namespace= #注册中心的命名空间
spring.shardingsphere.orchestration.registry.digest= #连接注册中心的权限令牌。缺省为不需要权限验证
spring.shardingsphere.orchestration.registry.operation-timeout-milliseconds= #操作超时的毫秒数,默认500毫秒
spring.shardingsphere.orchestration.registry.max-retries= #连接失败后的最大重试次数,默认3次
spring.shardingsphere.orchestration.registry.retry-interval-milliseconds= #重试间隔毫秒数,默认500毫秒
spring.shardingsphere.orchestration.registry.time-to-live-seconds= #临时节点存活秒数,默认60秒
spring.shardingsphere.orchestration.registry.props= #配置中心其它属性
spring.shardingsphere.orchestration.spring_boot_ds_sharding.orchestration-type= #配置/注册中心的类型,例如config_center/registry_center
spring.shardingsphere.orchestration.spring_boot_ds_sharding.instance-type= #配置/注册中心类型。如:zookeeper
spring.shardingsphere.orchestration.spring_boot_ds_sharding.server-lists= #连接配置/注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181
spring.shardingsphere.orchestration.spring_boot_ds_sharding.namespace= #配置/注册中心的命名空间
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.overwrite=true #本地配置是否覆盖配置中心配置。如果可覆盖,每次启动都以本地配置为准
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.digest= #连接配置/注册中心的权限令牌。缺省为不需要权限验证
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.operation-timeout-milliseconds= #操作超时的毫秒数,默认500毫秒
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.max-retries= #连接失败后的最大重试次数,默认3次
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.retry-interval-milliseconds= #重试间隔毫秒数,默认500毫秒
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.time-to-live-seconds= #临时节点存活秒数,默认60秒
```
......@@ -232,11 +232,11 @@ spring.shardingsphere.sharding.tables.t_order_item.key-generator.column=order_it
spring.shardingsphere.sharding.binding-tables=t_order,t_order_item
spring.shardingsphere.sharding.broadcast-tables=t_config
spring.shardingsphere.orchestration.name=spring_boot_ds_sharding
spring.shardingsphere.orchestration.overwrite=true
spring.shardingsphere.orchestration.registry.type=zookeeper
spring.shardingsphere.orchestration.registry.namespace=orchestration-spring-boot-sharding-test
spring.shardingsphere.orchestration.registry.server-lists=localhost:2181
spring.shardingsphere.orchestration.spring_boot_ds_sharding.orchestration-type=registry_center,config_center
spring.shardingsphere.orchestration.spring_boot_ds_sharding.instance-type=zookeeper
spring.shardingsphere.orchestration.spring_boot_ds_sharding.server-lists=localhost:2181
spring.shardingsphere.orchestration.spring_boot_ds_sharding.namespace=orchestration-spring-boot-sharding-test
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.overwrite=true
```
### JNDI
......@@ -365,15 +365,14 @@ spring.shardingsphere.encrypt.tables.<table-name>.columns.<logic-column-name>.en
```properties
#Omit data source, data sharding, read-write split and data masking configurations
spring.shardingsphere.orchestration.name= #Orchestration instance name
spring.shardingsphere.orchestration.overwrite= #Whether to overwrite local configurations with registry center configurations; if it can, each initialization should refer to local configurations
spring.shardingsphere.orchestration.registry.type= #Registry center type. Example:zookeeper
spring.shardingsphere.orchestration.registry.server-lists= #The list of servers that connect to registry center, including IP and port number; use commas to separate
spring.shardingsphere.orchestration.registry.namespace= #Registry center namespace
spring.shardingsphere.orchestration.registry.digest= #The token that connects to the registry center; default means there is no need for authentication
spring.shardingsphere.orchestration.registry.operation-timeout-milliseconds= #The millisecond number for operation timeout; default value: 500 milliseconds
spring.shardingsphere.orchestration.registry.max-retries= #Maximum retry time after failing; default value: 3 times
spring.shardingsphere.orchestration.registry.retry-interval-milliseconds= #Interval time to retry; default value: 500 milliseconds
spring.shardingsphere.orchestration.registry.time-to-live-seconds= #Living time of temporary nodes; default value: 60 seconds
spring.shardingsphere.orchestration.registry.props= #Customize registry center props.
spring.shardingsphere.orchestration.spring_boot_ds_sharding.orchestration-type= The type of orchestration center: config_center or registry_center
spring.shardingsphere.orchestration.spring_boot_ds_sharding.instance-type= #Center type. Example:zookeeper#Registry center type. Example:zookeeper
spring.shardingsphere.orchestration.spring_boot_ds_sharding.server-lists= #The list of servers that connect to registry center, including IP and port number; use commas to separate
spring.shardingsphere.orchestration.spring_boot_ds_sharding.namespace= #Center namespace
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.overwrite= #Whether to overwrite local configurations with config center configurations; if it can, each initialization should refer to local configurations
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.digest= #The token that connects to the center; default means there is no need for authentication
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.operation-timeout-milliseconds= #The millisecond number for operation timeout; default value: 500 milliseconds
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.max-retries= #Maximum retry time after failing; default value: 3 times
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.retry-interval-milliseconds= #Interval time to retry; default value: 500 milliseconds
spring.shardingsphere.orchestration.spring_boot_ds_sharding.props.time-to-live-seconds= #Living time of temporary nodes; default value: 60 seconds
```
......@@ -440,8 +440,15 @@ weight = 4
http://www.springframework.org/schema/beans/spring-beans.xsd
http://shardingsphere.apache.org/schema/shardingsphere/orchestration
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd">
<orchestration:registry-center id="regCenter" type="zookeeper" server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo" operation-timeout-milliseconds="1000"
max-retries="3" />
<util:properties id="instance-props">
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</util:properties>
<orchestraion:instance id="regCenter" orchestration-type="registry_center,config_center" instance-type="zookeeper" server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo"
props-ref="instance-props" />
<orchestraion:sharding-data-source id="shardingDatabasesTablesDataSource" data-source-ref="realShardingDatabasesTablesDataSource" instance-ref="regCenter" overwrite="true" />
<orchestraion:master-slave-data-source id="masterSlaveDataSource" data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter" overwrite="true" />
<orchestraion:encrypt-data-source id="encryptDataSource" data-source-ref="realEncryptDataSource" instance-ref="regCenter" overwrite="true" />
</beans>
```
......@@ -685,8 +692,8 @@ weight = 4
| ------------------- | ----- | ------------------------------------------------------------------------ |
| id | 属性 | ID |
| data-source-ref (?) | 属性 | 被治理的数据库id |
| registry-center-ref | 属性 | 注册中心id |
| overwrite | 属性 | 本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
| instance-ref | 属性 | 配置/注册中心id |
| overwrite | 属性 | 本地配置是否覆盖配置中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
### 读写分离 + 治理
......@@ -698,8 +705,8 @@ weight = 4
| ------------------- | ----- | ---------------------------------------------------------------------- |
| id | 属性 | ID |
| data-source-ref (?) | 属性 | 被治理的数据库id |
| registry-center-ref | 属性 | 注册中心id |
| overwrite | 属性 | 本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
| instance-ref | 属性 | 配置/注册中心id |
| overwrite | 属性 | 本地配置是否覆盖配置中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
### 数据脱敏 + 治理
......@@ -711,22 +718,23 @@ weight = 4
| ------------------- | ----- | ---------------------------------------------------------------------- |
| id | 属性 | ID |
| data-source-ref (?) | 属性 | 被治理的数据库id |
| registry-center-ref | 属性 | 注册中心id |
| overwrite | 属性 | 本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
| instance-ref | 属性 | 配置/注册中心id |
| overwrite | 属性 | 本地配置是否覆盖配置中心配置。如果可覆盖,每次启动都以本地配置为准。缺省为不覆盖 |
### 治理注册中心
### 治理配置/注册中心
命名空间:http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
#### \<orchestration:registry-center />
#### \<orchestration:instance />
| *名称* | *类型* | *说明* |
| ----------------------------------- | ----- | ------------------------------------------------------------------------------------------|
| id | 属性 | 注册中心的Spring Bean Id |
| type | 属性 | 注册中心类型。如:zookeeper |
| server-lists | 属性 | 连接注册中心服务器的列表,包括IP地址和端口号,多个地址用逗号分隔。如: host1:2181,host2:2181 |
| namespace (?) | 属性 | 注册中心的命名空间 |
| digest (?) | 属性 | 连接注册中心的权限令牌。缺省为不需要权限验证 |
| id | 属性 | 配置/注册中心的Spring Bean Id |
| instance-type | 属性 | 配置/注册中心类型。如:zookeeper |
| orchestration-type | 属性 | 配置/注册中心的类型,例如config_center/registry_center |
| server-lists | 属性 | 连接配置/注册中心服务器的列表,包括IP地址和端口号,多个地址用逗号分隔。如: host1:2181,host2:2181 |
| namespace (?) | 属性 | 配置/注册中心的命名空间 |
| digest (?) | 属性 | 连接配置/注册中心的权限令牌。缺省为不需要权限验证 |
| operation-timeout-milliseconds (?) | 属性 | 操作超时的毫秒数,默认500毫秒 |
| max-retries (?) | 属性 | 连接失败后的最大重试次数,默认3次 |
| retry-interval-milliseconds (?) | 属性 | 重试间隔毫秒数,默认500毫秒 |
......
......@@ -447,10 +447,15 @@ example: [shardingsphere-example](https://github.com/apache/incubator-shardingsp
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/sharding/sharding.xsd
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/masterslave
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/masterslave/master-slave.xsd">
<reg:registry-center id="regCenter" type="zookeeper" server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo" overwtite="false" />
<sharding:data-source id="shardingMasterSlaveDataSource" registry-center-ref="regCenter" />
<master-slave:data-source id="masterSlaveDataSource" registry-center-ref="regCenter" />
<util:properties id="instance-props">
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</util:properties>
<orchestraion:instance id="regCenter" orchestration-type="registry_center,config_center" instance-type="zookeeper" server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo"
props-ref="instance-props" />
<orchestraion:sharding-data-source id="shardingDatabasesTablesDataSource" data-source-ref="realShardingDatabasesTablesDataSource" instance-ref="regCenter" overwrite="true" />
<orchestraion:master-slave-data-source id="masterSlaveDataSource" data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter" overwrite="true" />
<orchestraion:encrypt-data-source id="encryptDataSource" data-source-ref="realEncryptDataSource" instance-ref="regCenter" overwrite="true" />
</beans>
```
......@@ -699,9 +704,9 @@ Namespace: http://shardingsphere.apache.org/schema/shardingsphere/orchestration/
| *Name* | *Type* | *Explanation* |
| ------------------- | --------- | ------------------------------------------------------------ |
| id | Attribute | ID |
| data-source-ref (?) | Attribute | Orchestrated database id |
| registry-center-ref | Attribute | Registry center id |
| overwrite | Attribute | Whether to overwrite local configurations with registry center configurations; if it can, each initialization should refer to local configurations; default means not to overwrite |
| data-source-ref (?) | Attribute | The id of data source to be orchestrated |
| instance-ref | Attribute | The id of config/registry center |
| overwrite | Attribute | Use local configuration to overwrite config center or not; default means not to overwrite |
### Read-Write Split + Orchestration
......@@ -713,8 +718,8 @@ Namespace: http://shardingsphere.apache.org/schema/shardingsphere/orchestration/
| ------------------- | --------- | ----------------------------------------------------------- |
| id | Attribute | ID |
| data-source-ref (?) | Attribute | The id of data source to be orchestrated |
| registry-center-ref | Attribute | The id of registry center |
| overwrite | Attribute | Use local configuration to overwrite registry center or not |
| instance-ref | Attribute | The id of config/registry center |
| overwrite | Attribute | Use local configuration to overwrite config center or not; default means not to overwrite |
### Data Masking + Orchestration
......@@ -726,23 +731,23 @@ Namespace: http://shardingsphere.apache.org/schema/shardingsphere/orchestration/
| ------------------- | --------- | ----------------------------------------------------------- |
| id | Attribute | ID |
| data-source-ref (?) | Attribute | The id of data source to be orchestrated |
| registry-center-ref | Attribute | The id of registry center |
| overwrite | Attribute | Use local configuration to overwrite registry center or not |
| instance-ref | Attribute | The id of config/registry center |
| overwrite | Attribute | Use local configuration to overwrite config/registry center or not; default means not to overwrite |
### Orchestration registry center
### Orchestration config/registry center
Namespace: http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
#### \<orchestration:registry-center />
#### \<orchestration:instance />
| *Name* | *Type* | *Description* |
| ---------------------------------- | --------- | ------------------------------------------------------------------------------- |
| id | Attribute | Spring Bean Id of registry center |
| type | Attribute | Registry center type. Example:zookeeper |
| server-lists | Attribute | Registry servers list, multiple split as comma. Example: host1:2181,host2:2181 |
| namespace (?) | Attribute | Namespace of registry |
| digest (?) | Attribute | Digest for registry. Default is not need digest |
| instance-type | Attribute | Center type. Example:zookeeper |
| orchestration-type | Attribute | The type of orchestration center: config_center or registry_center |
| server-lists | Attribute | Center servers list, multiple split as comma. Example: host1:2181,host2:2181 |
| namespace (?) | Attribute | Namespace of center |
| digest (?) | Attribute | Digest for center. Default is not need digest |
| operation-timeout-milliseconds (?) | Attribute | Operation timeout time in milliseconds, default value is 500 seconds |
| max-retries (?) | Attribute | Max number of times to retry, default value is 3 |
| retry-interval-milliseconds (?) | Attribute | Time interval in milliseconds on each retry, default value is 500 milliseconds |
......
......@@ -282,12 +282,13 @@ props:
#省略数据分片、读写分离和数据脱敏配置
orchestration:
name: orchestration_ds
overwrite: true
registry:
type: zookeeper
namespace: orchestration
serverLists: localhost:2181
orchestration_ds:
orchestrationType: registry_center,config_center
instanceType: zookeeper
serverLists: localhost:2181
namespace: orchestration
props:
overwrite: true
```
## 配置项说明
......@@ -408,17 +409,18 @@ masterSlaveRule: #省略读写分离规则配置
encryptRule: #省略数据脱敏规则配置
orchestration:
name: #治理实例名称
overwrite: #本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准
registry: #注册中心配置
type: #配置中心类型。如:zookeeper
serverLists: #连接注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181
namespace: #注册中心的命名空间
digest: #连接注册中心的权限令牌。缺省为不需要权限验证
operationTimeoutMilliseconds: #操作超时的毫秒数,默认500毫秒
maxRetries: #连接失败后的最大重试次数,默认3次
retryIntervalMilliseconds: #重试间隔毫秒数,默认500毫秒
timeToLiveSeconds: #临时节点存活秒数,默认60秒
orchestration_ds: #治理实例名称
orchestrationType: #配置/注册中心的类型,例如config_center/registry_center
instanceType: #配置/注册中心类型。如:zookeeper
serverLists: #连接配置/注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181
namespace: #配置/注册中心的命名空间
props: #其它配置
overwrite: #本地配置是否覆盖配置中心配置。如果可覆盖,每次启动都以本地配置为准
digest: #连接注册中心的权限令牌。缺省为不需要权限验证
operationTimeoutMilliseconds: #操作超时的毫秒数,默认500毫秒
maxRetries: #连接失败后的最大重试次数,默认3次
retryIntervalMilliseconds: #重试间隔毫秒数,默认500毫秒
timeToLiveSeconds: #临时节点存活秒数,默认60秒
```
## Yaml语法说明
......
......@@ -283,11 +283,13 @@ props:
#Omit data sharding, read-write split and encrypt configurations
orchestration:
name: orchestration_ds
overwrite: true
registry:
namespace: orchestration
serverLists: localhost:2181
orchestration_ds:
orchestrationType: registry_center,config_center
instanceType: zookeeper
serverLists: localhost:2181
namespace: orchestration
props:
overwrite: true
```
## Configuration Item Explanation
......@@ -412,17 +414,18 @@ masterSlaveRule: #Omit read-write split rule configurations
encryptRule: #Omit encrypt rule configurations
orchestration:
name: #Orchestration instance name
overwrite: #Whether to overwrite local configurations with registry center configurations; if it can, each initialization should refer to local configurations
registry: #Registry center configuration
type: #Registry center type. Example:zookeeper
serverLists: #The list of servers that connect to registry center, including IP and port number; use commas to seperate addresses, such as: host1:2181,host2:2181
namespace: #Registry center namespace
digest: #The token that connects to the registry center; default means there is no need for authentication
operationTimeoutMilliseconds: #Default value: 500 milliseconds
maxRetries: #Maximum retry time after failing; default value: 3 times
retryIntervalMilliseconds: #Interval time to retry; default value: 500 milliseconds
timeToLiveSeconds: #Living time of temporary nodes; default value: 60 seconds
orchestration_ds: #Orchestration instance name
orchestrationType: #The type of orchestration center: config_center or registry_center
instanceType: #Center type. Example:zookeeper
serverLists: #The list of servers that connect to registry center, including IP and port number; use commas to seperate addresses, such as: host1:2181,host2:2181
namespace: #Center namespace
props: #Other properties
overwrite: #Whether to overwrite local configurations with config center configurations; if it can, each initialization should refer to local configurations
digest: #The token that connects to the center; default means there is no need for authentication
operationTimeoutMilliseconds: #Default value: 500 milliseconds
maxRetries: #Maximum retry time after failing; default value: 3 times
retryIntervalMilliseconds: #Interval time to retry; default value: 500 milliseconds
timeToLiveSeconds: #Living time of temporary nodes; default value: 60 seconds
```
## Yaml Syntax Explanation
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册