使用Bucardo從PostgreSQL同步數(shù)據(jù)到MongoDB
Bucardo 是一個PostgreSQL的異步同步工具,它支持任意方式的主從同步,multi-master或者multi-slave等。而最近Bucardo的一個版本中將數(shù)據(jù)同步到其他存儲系統(tǒng)。比如下面這個同步到MongoDB的例子,其使用也非常簡單,下面是截取的部分代碼,更具體的安裝測試全教程請點下面來源。
來源地址:MongoDB replication from Postgres using Bucardo
.....
$- bucardo add sync mongotest herd=therd dbs=tgroup ping=false
- Added sync "mongotest"
- $ bucardo start
- Checking for existing processes
- Starting Bucardo
- $ pgbench -t 10000 btest1
- starting vacuum...end.
- transaction type: TPC-B (sort of)
- number of transactions actually processed: 10000/10000
- ...
- tps = 503.300595 (excluding connections establishing)
- $ pgbench -t 10000 btest2
- number of transactions actually processed: 10000/10000
- ...
- tps = 408.059368 (excluding connections establishing)
- $ bucardo kick mongotest
- .....
復制代碼 |