HA
<database-discovery:data-source-rule />
<database-discovery:discovery-type />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
xmlns:database-discovery="http://shardingsphere.apache.org/schema/shardingsphere/database-discovery"
xmlns:readwrite-splitting="http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://shardingsphere.apache.org/schema/shardingsphere/database-discovery
http://shardingsphere.apache.org/schema/shardingsphere/database-discovery/database-discovery.xsd
http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting
http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting/readwrite-splitting.xsd
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd
http://shardingsphere.apache.org/schema/shardingsphere/datasource
http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:33306/primary_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8" />
<property name="username" value="root" />
</bean>
<bean id="ds_1" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:33307/primary_demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<bean id="ds_2" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:33308/primary_demo_ds?useSSL=false"/>
<property name="username" value="root"/>
<property name="password" value=""/>
</bean>
<cluster:repository id="clusterRepository" type="ZooKeeper" namespace="governance" server-lists="localhost:2181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</props>
</cluster:repository>
<readwrite-splitting:dynamic-strategy id="dynamicStrategy" auto-aware-data-source-name="readwrite_ds" />
</readwrite-splitting:data-source-rule>
</readwrite-splitting:rule>
<database-discovery:rule id="mgrDatabaseDiscoveryRule">
<database-discovery:data-source-rule id="readwrite_ds" data-source-names="ds_0,ds_1,ds_2" discovery-heartbeat-name="mgr-heartbeat" discovery-type-name="mgr" />
<database-discovery:discovery-heartbeat id="mgr-heartbeat">
<props>
<prop key="keep-alive-cron" >0/5 * * * * ?</prop>
</props>
</database-discovery:discovery-heartbeat>
</database-discovery:rule>
<database-discovery:discovery-type id="mgr" type="MySQL.MGR">
<props>
<prop key="group-name">558edd3c-02ec-11ea-9bb3-080027e39bd2</prop>
</props>
</database-discovery:discovery-type>
<shardingsphere:data-source id="databaseDiscoveryDataSource" schema-name="database-discovery-db" data-source-names="ds_0, ds_1, ds_2" rule-refs="readWriteSplittingRule, mgrDatabaseDiscoveryRule">
<shardingsphere:mode repository-ref="clusterRepository" type="Cluster" />
</shardingsphere:data-source>
</beans>