Skip to content

Commit

Permalink
使用说明
Browse files Browse the repository at this point in the history
  • Loading branch information
wonb168 authored Feb 21, 2023
1 parent caf5c19 commit e41c960
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ pg_dump导出主、备库的结构(不含数据)成dump sql文件。
## 同步数据
能并行的gp迁移方案只有gpfdist(封装后为gpload)和gpcopy,gpcopy更优。
同时gpcopy的json配置文件可以写sql,这样可以控制sql的where条件实现增量copy。未配置的默认全量。

## 使用方法
目前只有1个gpsync.py文件和1个config.toml文件。调用时只需传入源和目标库的连接信息及数据库名。以gpadmin最高权限运行,方便运行多个库即授权。
```
if __name__=='__main__':
dbname='mdmaster_platform'#'mdmaster_bsgj_dev551_product_dev'
dbinfo={"host":"192.168.200.207", "port":2345, "usr":"gpadmin", "pwd":"密码"}
dbinfo2={"host":"192.168.200.73", "port":2345, "usr":"gpadmin", "pwd":"密码"}
print('begint to sync schema...')
sync_schema(dbinfo,dbinfo2,dbname)
print('begint to sync data...')
copy_data(dbinfo,dbinfo2,dbname)
```

0 comments on commit e41c960

Please sign in to comment.