blob: 6c91ecdffecfd2847c4acbdcce288a77e58250e5 [file] [log] [blame]
<?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/quick-start/</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/quick-start/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>ShardingSphere-JDBC</title>
<link>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-jdbc-quick-start/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-jdbc-quick-start/</guid>
<description>1. 引入 maven 依赖 &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.shardingsphere&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;shardingsphere-jdbc-core&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;${latest.release.version}&amp;lt;/version&amp;gt; &amp;lt;/dependency&amp;gt; 注意:请将 ${latest.release.version} 更改为实际的版本号。
2. 规则配置 ShardingSphere-JDBC 可以通过 Java,YAML,Spring 命名空间和 Spring Boot Starter 这 4 种方式进行配置,开发者可根据场景选择适合的配置方式。 详情请参见配置手册。
3. 创建数据源 通过 ShardingSphereDataSourceFactory 工厂和规则配置对象获取 ShardingSphereDataSource。 该对象实现自 JDBC 的标准 DataSource 接口,可用于原生 JDBC 开发,或使用 JPA, MyBatis 等 ORM 类库。
DataSource dataSource = ShardingSphereDataSourceFactory.createDataSource(dataSourceMap, configurations, properties); </description>
</item>
<item>
<title>ShardingSphere-Proxy</title>
<link>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/</guid>
<description>1. 规则配置 编辑%SHARDINGSPHERE_PROXY_HOME%/conf/config-xxx.yaml。详情请参见配置手册。
编辑%SHARDINGSPHERE_PROXY_HOME%/conf/server.yaml。详情请参见配置手册。
%SHARDINGSPHERE_PROXY_HOME% 为 Proxy 解压后的路径,例:/Users/ss/shardingsphere-proxy-bin/
2. 引入依赖 如果后端连接 PostgreSQL 数据库,不需要引入额外依赖。
如果后端连接 MySQL 数据库,请下载 mysql-connector-java-5.1.47.jar,并将其放入 %SHARDINGSPHERE_PROXY_HOME%/lib 目录。
3. 启动服务 使用默认配置项 sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh 默认启动端口为 3307,默认配置文件目录为:%SHARDINGSPHERE_PROXY_HOME%/conf/。
自定义端口和配置文件目录 sh %SHARDINGSPHERE_PROXY_HOME%/bin/start.sh ${proxy_port} ${proxy_conf_directory} 4. 使用ShardingSphere-Proxy 执行 MySQL 或 PostgreSQL的客户端命令直接操作 ShardingSphere-Proxy 即可。以 MySQL 举例:
mysql -u${proxy_username} -p${proxy_password} -h${proxy_host} -P${proxy_port} </description>
</item>
<item>
<title>ShardingSphere-Scaling(Alpha)</title>
<link>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-scaling-quick-start/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-scaling-quick-start/</guid>
<description>1. 规则配置 编辑%SHARDINGSPHERE_SCALING_HOME%/conf/server.yaml。详情请参见使用手册。
%SHARDINGSPHERE_PROXY_HOME% 为 Scaling 解压后的路径,例:/Users/ss/shardingsphere-scaling-bin/
2. 引入依赖 如果后端连接 PostgreSQL 数据库,不需要引入额外依赖。
如果后端连接 MySQL 数据库,请下载 mysql-connector-java-5.1.47.jar,并将其放入 %SHARDINGSPHERE_SCALING_HOME%/lib 目录。
3. 启动服务 sh %SHARDINGSPHERE_SCALING_HOME%/bin/start.sh 4. 任务管理 通过相应的 HTTP 接口管理迁移任务。
详情参见使用手册。</description>
</item>
</channel>
</rss>