Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


powerdns_master-slave_replication_with_mysql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
powerdns_master-slave_replication_with_mysql [2015/04/10 18:27] – [Backup master and import to slave] adminpowerdns_master-slave_replication_with_mysql [2021/10/09 15:14] (current) – external edit 127.0.0.1
Line 1: Line 1:
 {{tag>[mysql replication security powerdns]}} {{tag>[mysql replication security powerdns]}}
-~~TOC~~ 
  
 =====Encrypt MariaDB replication traffic===== =====Encrypt MariaDB replication traffic=====
Line 85: Line 84:
  
 ====Slave configuration==== ====Slave configuration====
-  * Edit /etc/my.cnf:<code>[mysqld]+  * Edit /etc/my.cnf on the **slave**:<code>[mysqld]
 log_bin = mysql-bin log_bin = mysql-bin
 server_id = 20 server_id = 20
Line 92: Line 91:
 read_only = 1</code> read_only = 1</code>
  
 +====Enable replication====
 +  * Import the backup on the **slave**:<code>MariaDB [(none)]> source /tmp/master_backup.sql</code>
 +  * Configure replication:<code>CHANGE MASTER TO
 +Master_Host='ns1.polaire.nl',
 +Master_User='replicator',
 +Master_Password='yourpassword',
 +Master_SSL=1,
 +Master_SSL_CA = '/etc/pki/tls/certs/mariadb/ca.pem',
 +Master_SSL_CERT = '/etc/pki/tls/certs/mariadb/slave-public.pem',
 +Master_SSL_KEY = '/etc/pki/tls/certs/mariadb/slave-private.pem',
 +Master_SSL_Verify_Server_Cert = 1;
 +Query OK, 0 rows affected (0.08 sec)</code>
 +  * Start slave:<code>MariaDB [(none)]> slave start;
 +Query OK, 0 rows affected (0.00 sec)
 +
 +MariaDB [(none)]> show slave status \G</code>
powerdns_master-slave_replication_with_mysql.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1