Master ServersThe following steps configure the master servers, and are performed on both master servers. First of all, a configuration file is created on each server. Warning |
---|
CAUTION - if you make modifications to the configuration: |
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/mymysql/mysql.cnfconf.d/jtel-master.cnf
# Custom MySQL settings for a specific SQL master server
#
# WARNING: This file is specific to the master server
[mysqld]
#
# Replication Options
#
# Specific options for MASTER role
#
server_id = 1
binlog_format = ROW
expire_logs_days = 1
max_binlog_size = 100M
log_bin = binlog
auto_increment_increment = 2
auto_increment_offset = 1
log_slave_updates
relay_log = mysqld-relay-bin
relay_log_index = mysqld-relay-bin.index
relay_log_info_file = relay-log.info
EOFF |
|
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/mysql/mymysql.cnfconf.d/jtel-master.cnf
# Custom MySQL settings for a specific SQL master server
#
# WARNING: This file is specific to the master server
[mysqld]
#
# Replication Options
#
# Specific options for MASTER role
#
server_id = 2
binlog_format = ROW
expire_logs_days = 1
max_binlog_size = 100M
log_bin = binlog
auto_increment_increment = 2
auto_increment_offset = 2
log_slave_updates
relay_log = mysqld-relay-bin
relay_log_index = mysqld-relay-bin.index
relay_log_info_file = relay-log.info
EOFF |
|
Replication UserNext, a replication user is created, which is used to connect to the master servers. Status |
---|
colour | Red |
---|
title | Caution Password |
---|
|
Translations Ignore |
---|
Code Block |
---|
mysql -u root -p<password> -v -e"CREATE USER 'repl'@'%' IDENTIFIED BY '<password>'"
mysql -u root -p<password> -v -e"GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'"
mysql -u root -p<password> -v -e"FLUSH PRIVILEGES" |
|
Slave ServersThe following steps configure the slave servers, and are performed on both slave servers. First of all, a configuration file is created on each server. Warning |
---|
CAUTION - if you make modifications to the configuration: - The server_id must be unique per server.
|
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/mysql/mymysql.cnfconf.d/jtel-slave.cnf
# Custom MySQL settings for a specific SQL slave server
#
# WARNING: This file is specific to the slave server
[mysqld]
# Specific options for SLAVE role
#
server_id = 101
relay_log = mysqld-relay-bin
relay_log_index = mysqld-relay-bin.index
relay_log_info_file = relay-log.info
skip-log-bin
EOFF |
|
Translations Ignore |
---|
Code Block |
---|
| cat <<EOFF > /etc/mymysql/mysql.cnfconf.d/jtel-slave.cnf
# Custom MySQL settings for a specific SQL slave server
#
# WARNING: This file is specific to the slave server
[mysqld]
# Specific options for SLAVE role
#
server_id = 102
relay_log = mysqld-relay-bin
relay_log_index = mysqld-relay-bin.index
relay_log_info_file = relay-log.info
skip-log-bin
EOFF |
|
Restart MySQL ServersNext, all 4 mysql servers are restarted, to reload the configuration. Translations Ignore |
---|
Code Block |
---|
| systemctl restart mysqld.servicemysql |
|
|