Master Slave
Master Slave
Master Slave
Quote; MyDNS is a free DNS server for UNIX. Master and slave setup is done using MySQL.
http://mydns.bboy.net
For the below tutorial MyDNS server resides at 192.168.0.101 and slave at 192.168.0.102
Master 192.168.0.101
centos$ vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
old_passwords=1
log-bin = mysql-bin
binlog-do-db=mydns
server-id=1
[mysql.server]
user=mysql
basedir=/var/lib
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
2. Restart MySQL
3. Login to MySQL and grant slave privileges, remember the following data needed for slave configuration
MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS= 79
mysql> +------------------+----------+--------------+------------------+
mysql> +------------------+----------+--------------+------------------+
mysql> +------------------+----------+--------------+------------------+
mysql> exit
centos$ cd /home/username
Slave 192.168.0.102
mysql> exit
centos$ vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
old_passwords=1
server-id=2
master-user=slave_user
master-password=slave_password
master-connect-retry=60
replicate-do-db=mydns
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
8. Reload MySQL
centos$ cd /home/username
make sure to use correct date for the following - MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS= 79
mysql> exit
11. Download MyDNS, install the RPM and configure to turn it on at startup
centos$ cd /usr/src
12. Edit mydns.conf, change username and password and add the following lines to the end of the file.
allow-axfr = yes
allow-tcp = yes
centos$ vi /etc/mydns.conf
13. Turn on MyDNS and change the sequence of the startup scripts
centos$ cd /etc/rc.d/rc4.d
centos$ cd /etc/rc.d/rc5.d