Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /etc/mysql/conf.d/mysqld_custom.cnf
- [mysqld]
- bind-address = 0.0.0.0
- innodb_file_per_table = 1
- skip-name-resolve
- --------------------------------------
- /etc/mysql/conf.d/mysqld_replica.cnf
- srv1
- [mysqld]
- server-id = 1
- replicate-same-server-id = 0
- auto-increment-increment = 2
- auto-increment-offset = 1
- log-bin = /var/log/mysql/log-bin.log
- expire_logs_days = 1
- replicate-ignore-db = information_schema
- sync_binlog = 1
- innodb_flush_log_at_trx_commit = 1
- sync_relay_log = 1
- sync_relay_log_info = 1
- sync_master_info = 1
- srv1
- [mysqld]
- server-id = 2
- replicate-same-server-id = 0
- auto-increment-increment = 2
- auto-increment-offset = 2
- log-bin = /var/log/mysql/log-bin.log
- expire_logs_days = 1
- replicate-ignore-db = information_schema
- sync_binlog = 1
- innodb_flush_log_at_trx_commit = 1
- sync_relay_log = 1
- sync_relay_log_info = 1
- sync_master_info = 1
- CREATE USER 'replica'@'%' IDENTIFIED BY 'SET_PASS';
- GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%';
- mysqldump --quick --lock-all-tables --all-databases --flush-logs --master-data=2 --flush-privileges --hex-blob --routines -p > all.sql
- 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