blob: 98153a1e6c5a1ca60c4c58d9794cf085b81e409c [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/user-manual/shardingsphere-proxy/migration/</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/migration/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>运行部署</title>
<link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/migration/build/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/migration/build/</guid>
<description>背景信息 对于使用单数据库运行的系统来说,如何安全简单地将数据迁移至水平分片的数据库上,一直以来都是一个迫切的需求。
前提条件 Proxy 采用纯 JAVA 开发,JDK 建议 1.8 或以上版本。 数据迁移使用集群模式,目前支持 ZooKeeper 作为注册中心。 操作步骤 获取 ShardingSphere-Proxy。详情请参见 proxy 启动手册。
修改配置文件 conf/server.yaml,详情请参见模式配置。
目前 mode 必须是 Cluster,需要提前启动对应的注册中心。
配置示例:
mode: type: Cluster repository: type: ZooKeeper props: namespace: governance_ds server-lists: localhost:2181 retryIntervalMilliseconds: 500 timeToLiveSeconds: 60 maxRetries: 3 operationTimeoutMilliseconds: 500 引入 JDBC 驱动。 proxy 已包含 PostgreSQL JDBC 驱动。
如果后端连接以下数据库,请下载相应 JDBC 驱动 jar 包,并将其放入 ${shardingsphere-proxy}/ext-lib 目录。
数据库 JDBC 驱动 参考 MySQL mysql-connector-java-5.</description>
</item>
<item>
<title>使用手册</title>
<link>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/migration/usage/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/migration/usage/</guid>
<description>MySQL 使用手册 环境要求 支持的 MySQL 版本:5.1.15 ~ 8.0.x。
权限要求 源端开启 binlog MySQL 5.7 my.cnf 示例配置:
[mysqld] server-id=1 log-bin=mysql-bin binlog-format=row binlog-row-image=full max_connections=600 执行以下命令,确认是否有开启 binlog:
show variables like &#39;%log_bin%&#39;; show variables like &#39;%binlog%&#39;; 如以下显示,则说明 binlog 已开启
+-----------------------------------------+---------------------------------------+ | Variable_name | Value | +-----------------------------------------+---------------------------------------+ | log_bin | ON | | binlog_format | ROW | | binlog_row_image | FULL | +-----------------------------------------+---------------------------------------+ 赋予源端 MySQL 账号 replication 相关权限。 执行以下命令,查看该用户是否有迁移权限:
SHOW GRANTS FOR &#39;migration_user&#39;; 示例结果:</description>
</item>
</channel>
</rss>