Advertisement
Guest User

Untitled

a guest
Jul 16th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /etc/mysql/conf.d/mysqld_custom.cnf
  2.  
  3. [mysqld]
  4. bind-address = 0.0.0.0
  5. innodb_file_per_table = 1
  6. skip-name-resolve
  7.  
  8. --------------------------------------
  9.  
  10. /etc/mysql/conf.d/mysqld_replica.cnf
  11.  
  12. srv1
  13.  
  14. [mysqld]
  15. server-id = 1
  16. replicate-same-server-id = 0
  17. auto-increment-increment = 2
  18. auto-increment-offset = 1
  19. log-bin = /var/log/mysql/log-bin.log
  20. expire_logs_days = 1
  21. replicate-ignore-db = information_schema
  22. sync_binlog = 1
  23. innodb_flush_log_at_trx_commit = 1
  24. sync_relay_log = 1
  25. sync_relay_log_info = 1
  26. sync_master_info = 1
  27.  
  28.  
  29. srv1
  30.  
  31. [mysqld]
  32. server-id = 2
  33. replicate-same-server-id = 0
  34. auto-increment-increment = 2
  35. auto-increment-offset = 2
  36. log-bin = /var/log/mysql/log-bin.log
  37. expire_logs_days = 1
  38. replicate-ignore-db = information_schema
  39. sync_binlog = 1
  40. innodb_flush_log_at_trx_commit = 1
  41. sync_relay_log = 1
  42. sync_relay_log_info = 1
  43. sync_master_info = 1
  44.  
  45.  
  46.  
  47. CREATE USER 'replica'@'%' IDENTIFIED BY 'SET_PASS';
  48. GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%';
  49.  
  50.  
  51. mysqldump --quick --lock-all-tables --all-databases --flush-logs --master-data=2 --flush-privileges --hex-blob --routines -p > all.sql
  52.  
  53.  
  54. change master to MASTER_HOST='primary.com', MASTER_USER='replica', MASTER_PASSWORD='SET_PASS', MASTER_PORT=3306, MASTER_LOG_FILE='log-bin.000003', MASTER_LOG_POS=107, MASTER_CONNECT_RETRY=10;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement