[注意],当前的测试环境仅仅是一台服务器.

部署测试的tungten版本是2.1.2-xxxx;

Requirements:

mysql配置

单机使用tungsten 同步mysql数据到mongodb_mysql

To change the Tungsten user to use the new password format complete the following steps

mysql>​​set session old_passwords=0;​

设置二进制日志格式=row;

单机使用tungsten 同步mysql数据到mongodb_服务器_02

主mysql端服务器执行命令:

./tools/tungsten-installer --master-slave -a \

  --datasource-type=mysql \

  --master-host=127.0.0.1  \

  --datasource-user=tungsten  \

  --datasource-password=321  \

  --datasource-log-directory=/var/lib/mysql \

  --service-name=byRuiy \

  --home-directory=/root/deploy/mysql \

  --cluster-hosts=127.0.0.1 \

  --thl-port=12500 \

  --rmi-port=11500 \

  --mysql-use-bytes-for-string=false \

  --svc-extractor-filters=colnames,pkey \

  --svc-parallelization-type=none \

  --start-and-report

单机使用tungsten 同步mysql数据到mongodb_mongodb_03

从mongodb服务器端执行语句:

tools/tungsten-installer --master-slave -a \

  --datasource-type=mongodb \

  --master-host=127.0.0.1  \

  --service-name=byRuiy \

  --home-directory=/root/deploy/mongodb \

  --cluster-hosts=127.0.0.1 \

  --master-thl-port=12500 \

  --thl-port=12600 \

  --rmi-port=11600 \

  --skip-validation-check=InstallerMasterSlaveCheck \

  --svc-parallelization-type=none \

  --start-and-report

单机使用tungsten 同步mysql数据到mongodb_服务器_04


部署完成后查看效果:

mongo提示符端

单机使用tungsten 同步mysql数据到mongodb_服务器_05

mysql命令行提示符端

单机使用tungsten 同步mysql数据到mongodb_mysql_06

单机使用tungsten 同步mysql数据到mongodb_服务器_07

单机使用tungsten 同步mysql数据到mongodb_服务器_08

 单机使用tungsten 同步mysql数据到mongodb_mysql_09

单机使用tungsten 同步mysql数据到mongodb_服务器_10

单机使用tungsten 同步mysql数据到mongodb_mongodb_11

 将tungstenReplicator 安装为系统服务(tungsten服务进程维护控制)详细见 另一篇post