tungsten-replicator 实现mysql 与mysql同步

来源:互联网 发布:java 调用linux shell 编辑:程序博客网 时间:2024/04/29 18:10

1,centos 5.3  安装tungsten 需要ruby ,java

 

  1. [root@localhost ~]# java -version 
  2. java version "1.6.0_25" 
  3. Java(TM) SE Runtime Environment (build 1.6.0_25-b06) 
  4. Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing) 

 2,还需要ssh 自动登录

    配置方法:http://asuper.blog.51cto.com/1622151/1102050

 

3,下载http://code.google.com/p/tungsten-replicator/downloads/list

  本人按装 tungsten-replicator-2.0.6-src.tar.gz

    master上面创建mysql账号:

  CREATE USER 'tungsten'@'%' IDENTIFIED BY '123456';

  GRANT ALL ON *.* TO 'tungsten'@'%'  WITH GRANT OPTION

 

 

  解压后,再master或slave任意一台机器上,执行即可

 

 

  1. [root@localhost tungsten-replicator-2.0.6]# ./tools/tungsten-installer --master-slave  \ 
  2. >   --master-host=192.168.52.128  \ 
  3. >   --datasource-user=tungsten  \ 
  4. >   --datasource-password=123456  \ 
  5. >   --service-name=logos \ 
  6. >   --home-directory=/data/tungsten-replicator-2.0.6 \ 
  7. >   --cluster-hosts=192.168.52.128,192.168.52.133 \ 
  8. >   --start-and-report 
  9. WARN  >> 192.168.52.128 >> 32-bit architecture not recommended for DBMS nodes 
  10. WARN  >> 192.168.52.128 >> THL schema tungsten_logos already exists at tungsten@192.168.52.128:3306 (WITH PASSWORD
  11. WARN  >> 192.168.52.128 >> The value of max_allowed_packet is too small for tungsten@192.168.52.128:3306 (WITH PASSWORD
  12. WARN  >> 192.168.52.133 >> 32-bit architecture not recommended for DBMS nodes 
  13. WARN  >> 192.168.52.133 >> THL schema tungsten_logos already exists at tungsten@192.168.52.133:3306 (WITH PASSWORD
  14. WARN  >> 192.168.52.133 >> The value of max_allowed_packet is too small for tungsten@192.168.52.133:3306 (WITH PASSWORD
  15. INFO  >> 192_168_52_128 >> Getting services list 
  16. INFO  >> 192_168_52_128 >> .... 
  17. Processing services command... 
  18. NAME              VALUE 
  19. ----              ----- 
  20. appliedLastSeqno: 3 
  21. appliedLatency  : 1.356590497686E9 
  22. role            : master 
  23. serviceName     : logos 
  24. serviceType     : local 
  25. started         : true 
  26. state           : ONLINE 
  27. Finished services command... 
  28. INFO  >> 192_168_52_133 >> Getting services list 
  29. INFO  >> 192_168_52_133 >> .. 
  30. Processing services command... 
  31. NAME              VALUE 
  32. ----              ----- 
  33. appliedLastSeqno: 3 
  34. appliedLatency  : 1.356647435914E9 
  35. role            : slave 
  36. serviceName     : logos 
  37. serviceType     : local 
  38. started         : true 
  39. state           : ONLINE 
  40. Finished services command... 

 

0 0
原创粉丝点击