| <?xml version="1.0" encoding="utf-8" standalone="yes"?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>Governance on ShardingSphere</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/</link> |
| <description>Recent content in Governance on ShardingSphere</description> |
| <generator>Hugo -- gohugo.io</generator> |
| <language>en-us</language> |
| |
| <atom:link href="https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/index.xml" rel="self" type="application/rss+xml" /> |
| |
| |
| <item> |
| <title>Use Java API</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/java-api/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/java-api/</guid> |
| <description>Import Maven Dependency &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-governance&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using ZooKeeper --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-zookeeper-curator&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using Etcd --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-etcd&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Configure Rule Using ZooKeeper as config center and registry center for example. |
| // Omit configure data sources and rule configurations // ... // Configure registry center GovernanceCenterConfiguration configuration = new GovernanceCenterConfiguration(&#34;Zookeeper&#34;, &#34;localhost:2181&#34;, new Properties()); // Configure governance Map&lt;String, CenterConfiguration&gt; configurationMap = new HashMap&lt;String, CenterConfiguration&gt;(); configurationMap.</description> |
| </item> |
| |
| <item> |
| <title>Use YAML</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/yaml/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/yaml/</guid> |
| <description>Import Maven Dependency &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-governance&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using ZooKeeper --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-zookeeper-curator&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using Etcd --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-etcd&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Configure Rule Using ZooKeeper as config center and registry center for example. |
| governance: name: governance_ds registryCenter: type: Zookeeper serverLists: localhost:2181 overwrite: true // Create GovernanceShardingSphereDataSource DataSource dataSource = YamlGovernanceShardingSphereDataSourceFactory.createDataSource(yamlFile); Use GovernanceShardingSphereDataSource The GovernanceShardingSphereDataSource created by YamlGovernanceShardingSphereDataSourceFactory implements the standard JDBC DataSource interface.</description> |
| </item> |
| |
| <item> |
| <title>Use Spring Boot Starter</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/spring-boot-starter/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/spring-boot-starter/</guid> |
| <description>Import Maven Dependency &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-governance-spring-boot-starter&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using ZooKeeper --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-zookeeper-curator&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using Etcd --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-etcd&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Configure Rule spring.shardingsphere.governance.name=governance-spring-boot-shardingsphere-test spring.shardingsphere.governance.registry-center.type=Zookeeper spring.shardingsphere.governance.registry-center.server-lists=localhost:2181 spring.shardingsphere.governance.overwrite=true Use GovernanceShardingSphereDataSource in Spring GovernanceShardingSphereDataSource can be used directly by injection; or configure GovernanceShardingSphereDataSource in ORM frameworks such as JPA or MyBatis. |
| @Resource private DataSource dataSource; </description> |
| </item> |
| |
| <item> |
| <title>Use Spring Namespace</title> |
| <link>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace/</guid> |
| <description>Import Maven Dependency &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-governance-spring-namespace&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using ZooKeeper --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-zookeeper-curator&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;!-- import if using Etcd --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-governance-repository-etcd&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; Configure Rule &lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&gt; &lt;beans xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; xmlns:governance=&#34;http://shardingsphere.apache.org/schema/shardingsphere/governance&#34; xmlns=&#34;http://www.springframework.org/schema/beans&#34; xsi:schemaLocation=&#34;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://shardingsphere.apache.org/schema/shardingsphere/governance http://shardingsphere.apache.org/schema/shardingsphere/governance/governance.xsd&#34;&gt; &lt;util:properties id=&#34;instance-properties&#34;&gt; &lt;prop key=&#34;max-retries&#34;&gt;3&lt;/prop&gt; &lt;prop key=&#34;operation-timeout-milliseconds&#34;&gt;3000&lt;/prop&gt; &lt;/util:properties&gt; &lt;governance:reg-center id=&#34;regCenter&#34; type=&#34;Zookeeper&#34; server-lists=&#34;localhost:2181&#34; /&gt; &lt;governance:data-source id=&#34;shardingDatabasesTablesDataSource&#34; data-source-names=&#34;demo_ds_0, demo_ds_1&#34; reg-center-ref=&#34;regCenter&#34; config-center-ref=&#34;configCenter&#34; rule-refs=&#34;shardingRule&#34; overwrite=&#34;true&#34; /&gt; &lt;governance:data-source id=&#34;encryptDataSource&#34; data-source-names=&#34;demo_ds&#34; reg-center-ref=&#34;regCenter&#34; config-center-ref=&#34;configCenter&#34; rule-refs=&#34;encryptRule&#34; overwrite=&#34;true&#34; &gt; &lt;props&gt; &lt;prop key=&#34;query-with-cipher-column&#34;&gt;true&lt;/prop&gt; &lt;/props&gt; &lt;/governance:data-source&gt; &lt;/beans&gt; Use GovernanceShardingSphereDataSource in Spring GovernanceShardingSphereDataSource can be used directly by injection; or configure GovernanceShardingSphereDataSource in ORM frameworks such as JPA or MyBatis.</description> |
| </item> |
| |
| </channel> |
| </rss> |