Mode

    Cluster mode

    1. <beans xmlns="http://www.springframework.org/schema/beans"
    2. xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
    3. xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
    4. xsi:schemaLocation="http://www.springframework.org/schema/beans
    5. http://www.springframework.org/schema/beans/spring-beans.xsd
    6. http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
    7. http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
    8. http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd">
    9. <props>
    10. <prop key="max-retries">3</prop>
    11. </props>
    12. </cluster:repository>
    13. <shardingsphere:data-source id="shardingDatabasesTablesDataSource" data-source-names="demo_ds_0, demo_ds_1" rule-refs="shardingRule" schema-name="sharding_db">
    14. <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" overwrite="true"/>
    15. </shardingsphere:data-source>