| <?xml version="1.0" encoding="utf-8" standalone="yes"?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>使用手册 on ShardingSphere</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/</link> |
| <description>Recent content in 使用手册 on ShardingSphere</description> |
| <generator>Hugo -- gohugo.io</generator> |
| <language>en-us</language> |
| |
| <atom:link href="https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/index.xml" rel="self" type="application/rss+xml" /> |
| |
| |
| <item> |
| <title>Proxy 启动</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/startup/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/startup/</guid> |
| <description>启动步骤 下载 ShardingSphere-Proxy 的最新发行版。 如果使用 docker,可以执行 docker pull shardingsphere/shardingsphere-proxy 获取镜像。详细信息请参考Docker镜像。 解压缩后修改 conf/server.yaml和以 config- 前缀开头的文件,如:conf/config-xxx.yaml 文件,进行分片规则、读写分离规则配置。配置方式请参考配置手册。 Linux 操作系统请运行 bin/start.sh,Windows 操作系统请运行 bin/start.bat 启动 ShardingSphere-Proxy。如需配置启动端口、配置文件位置,可参考快速入门。 使用 PostgreSQL 使用任何 PostgreSQL 的客户端连接。如: psql -U root -h 127.0.0.1 -p 3307 使用 MySQL 将 MySQL 的 JDBC 驱动程序复制至目录 ext-lib/。 使用任何 MySQL 的客户端连接。如: mysql -u root -h 127.0.0.1 -P 3307 使用自定义分片算法 当用户需要使用自定义的分片算法类时,无法再通过简单的行表达式在 YAML 文件进行配置。可通过以下方式配置使用自定义分片算法。 |
| 实现 ShardingAlgorithm 接口定义的算法实现类。 将上述 Java 文件打包成 jar 包。 将上述 jar 包拷贝至 ShardingSphere-Proxy 解压后的 conf/lib-ext 目录。 将上述自定义算法实现类的 Java 文件引用配置在 YAML 文件中,具体可参考配置规则。 注意事项 ShardingSphere-Proxy 默认使用 3307 端口,可以通过启动脚本追加参数作为启动端口号。如: bin/start.</description> |
| </item> |
| |
| <item> |
| <title>分布式治理</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/governance/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/governance/</guid> |
| <description>ShardingSphere-Proxy 支持使用 SPI 方式接入分布式治理,实现配置和元数据统一管理以及实例熔断和从库禁用等功能。 |
| Zookeeper ShardingSphere-Proxy 默认提供了 Zookeeper 解决方案,实现了注册中心功能。 配置规则同 ShardingSphere-JDBC YAML 保持一致。 |
| 其他第三方组件 详情请参考支持的第三方组件。 |
| 使用 SPI 方式实现相关逻辑编码,并将生成的 jar 包复制至 ShardingSphere-Proxy 的 lib 目录。 按照配置规则进行配置,即可使用。 </description> |
| </item> |
| |
| <item> |
| <title>分布式事务</title> |
| <link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/transaction/</link> |
| <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> |
| |
| <guid>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/usage/transaction/</guid> |
| <description>ShardingSphere-Proxy 接入的分布式事务 API 同 ShardingSphere-JDBC 保持一致,支持 LOCAL,XA,BASE 类型的事务。 |
| XA 事务 ShardingSphere-Proxy 原生支持 XA 事务,默认的事务管理器为 Atomikos。 可以通过在 ShardingSphere-Proxy 的 conf 目录中添加 jta.properties 来定制化 Atomikos 配置项。 具体的配置规则请参考 Atomikos 的官方文档。 |
| 使用 Narayana事务管理器,需要参考以下步骤。 |
| 将 Narayana 所需 jar 拷贝至 /lib 目录。参考如下: &lt;propeties&gt; &lt;narayana.version&gt;5.9.1.Final&lt;/narayana.version&gt; &lt;jboss-transaction-spi.version&gt;7.6.0.Final&lt;/jboss-transaction-spi.version&gt; &lt;jboss-logging.version&gt;3.2.1.Final&lt;/jboss-logging.version&gt; &lt;/propeties&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-transaction-xa-narayana&lt;/artifactId&gt; &lt;version&gt;${shardingsphere.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss.narayana.jta&lt;/groupId&gt; &lt;artifactId&gt;jta&lt;/artifactId&gt; &lt;version&gt;${narayana.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss.narayana.jts&lt;/groupId&gt; &lt;artifactId&gt;narayana-jts-integration&lt;/artifactId&gt; &lt;version&gt;${narayana.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.jboss&lt;/groupId&gt; &lt;artifactId&gt;jboss-transaction-spi&lt;/artifactId&gt; &lt;version&gt;${jboss-transaction-spi.version}&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.</description> |
| </item> |
| |
| </channel> |
| </rss> |