Advertisement
Guest User

Untitled

a guest
Aug 4th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. # multi source replication
  2.  
  3. ## limiting
  4.  
  5. * slave server is must be enabled some parameter
  6.  
  7. ```
  8. --master-info-repository=TABLE --relay-log-info-repository=TABLE
  9. ```
  10.  
  11. ## settings
  12.  
  13. Add parameter my.cnf.
  14.  
  15. ```
  16. master-info-repository=TABLE
  17. relay-log-info-repository=TABLE
  18. ```
  19.  
  20. Determinate channel by change master to statement.
  21.  
  22. ```
  23. CHANGE MASTER TO
  24. MASTER_HOST='192.168.33.20',
  25. MASTER_PORT=3306,
  26. MASTER_LOG_FILE='pxc1-bin.000001',
  27. MASTER_LOG_POS=846
  28. FOR CHANNEL 'pxc1';
  29. ```
  30.  
  31. for gtid based
  32.  
  33. ```
  34. CHANGE MASTER TO
  35. MASTER_HOST='192.168.33.20',
  36. MASTER_PORT=3306,
  37. MASTER_AUTO_POSITION=1
  38. FOR CHANNEL 'pxc1';
  39. ```
  40.  
  41. ## start replication
  42.  
  43. ```
  44. start slave user='rep' password='password' FOR CHANNEL 'pxc1';
  45. ```
  46.  
  47.  
  48. ## stop replication
  49.  
  50. ```
  51. stop slave FOR CHANNEL 'pxc1';
  52. ```
  53.  
  54. ## test multisource replication time slise version database create by pxc
  55.  
  56. ```
  57. CHANGE MASTER TO
  58. MASTER_HOST='192.168.33.20',
  59. MASTER_PORT=3306,
  60. MASTER_LOG_FILE='pxc1-bin.000001',
  61. MASTER_LOG_POS=846 ,
  62. MASTER_DELAY=30
  63. FOR CHANNEL 'pxc1';
  64.  
  65. CHANGE MASTER TO
  66. MASTER_HOST='192.168.33.20',
  67. MASTER_PORT=3306,
  68. MASTER_LOG_FILE='pxc1-bin.000001',
  69. MASTER_LOG_POS=846 ,
  70. MASTER_DELAY=60
  71. FOR CHANNEL 'pxc2';
  72.  
  73. CHANGE MASTER TO
  74. MASTER_HOST='192.168.33.20',
  75. MASTER_PORT=3306,
  76. MASTER_LOG_FILE='pxc1-bin.000001',
  77. MASTER_LOG_POS=846 ,
  78. MASTER_DELAY=90
  79. FOR CHANNEL 'pxc3';
  80.  
  81. ```
  82.  
  83. use case 1. master is gtid based multi master.
  84. Failover can be done by stopping the slave when the node goes down and starting the slave.
  85.  
  86. use case 2. each master node replicate use defferent time master_delay. Could have time slies version table.
  87.  
  88. note : I can not do that for now.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement