Skip to content

Commit 7387780

Browse files
committed
Added Slave to Slave replication info
1 parent 5d15768 commit 7387780

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ zoneSync is a bash script for synchronizing DNS records between masters and slav
1111
1. Ensure all requirements are installed on both master and slave systems.
1212
2. On Master & Slave:
1313
* Create user zonesync: `useradd zonesync && passwd zonesync`
14+
* Modify user zonesync: `usermod -G named zonesync`
1415
* Change to user zonesync: `su - zonesync`
1516
* Generate Public/Private Keys: `ssh-keygen -t rsa -b 4096` (no passphrase)
1617
2. On Master (As user zonesync)
@@ -22,11 +23,13 @@ zoneSync is a bash script for synchronizing DNS records between masters and slav
2223
* Change to user zonesync (if not already logged in as zonesync user): `su - zonesync`
2324
* Get latest version of zoneSync: `git clone https://github.com/truenegative/zonesync.git`
2425
* Open up zonesync/zonesync.sh with vi or nano and change the variables at the beginning to match your slave server IP address and bind configuration.
26+
* Ensure that the SLAVE.IP.ADDRESS is in the allow-transfer and also-notify section of the main named.conf.
2527

2628
2. On Slave:
2729
* Create zonesync folders: `mkdir -p /var/named/zonesync && mkdir -p /var/named/zonesync/slaves` ( (`NOTE`): Use /var/named/chroot/var/named for chroot'd bind installations)
2830
* Set permissions: `chown -R zonesync:named /var/named/zonesync && chmod -R 770 /var/named/zonesync`
29-
* Add zonesync config file to named config: `cat "include \"zonesync/zonesync.SLAVE.IP.ADDRESS.named.conf\";"`
31+
* Add zonesync config file to named config: `cat "include \"zonesync/zonesync.SLAVE.IP.ADDRESS.named.conf\";" >> /etc/named.conf`
32+
3033

3134
3. Verify:
3235
* On Master (as zonesync user) run: `./zonesync.sh` and check for any errors. If you get the message `Successful synchronization to SLAVE.IP.ADDRESS.` move on to the next step.
@@ -37,9 +40,30 @@ zoneSync is a bash script for synchronizing DNS records between masters and slav
3740

3841
5. Enjoy!
3942

43+
### Slave to Slave Replication
44+
1. Edit original Master and add secondary's ip address to the allow-transfer and also-notify sections of named.conf
45+
46+
2. Install zoneSync on first master:
47+
* Change to user zonesync (if not already logged in as zonesync user): `su - zonesync`
48+
* Get latest version of zoneSync: `git clone https://github.com/truenegative/zonesync.git`
49+
* Open up zonesync/zonesync.sh with vi or nano and change the variables at the beginning to match your slave server IP address and bind configuration.
50+
* Ensure that the SLAVE.IP.ADDRESS is in the allow-transfer and also-notify section of the main named.conf.
51+
3. On secondary slave:
52+
* Create zonesync folders: `mkdir -p /var/named/zonesync && mkdir -p /var/named/zonesync/slaves` ( (`NOTE`): Use /var/named/chroot/var/named for chroot'd bind installations)
53+
* Set permissions: `chown -R zonesync:named /var/named/zonesync && chmod -R 770 /var/named/zonesync`
54+
* Add zonesync config file to named config: `cat "include \"zonesync/zonesync.SLAVE.IP.ADDRESS.named.conf\";" >> /etc/named.conf`
55+
4. Verify slave to slave
56+
* On Slave (as zonesync user) run: `./zonesync.sh` and check for any errors. If you get the message `Successful synchronization to SLAVE.IP.ADDRESS.` move on to the next step.
57+
* On Secondary Slave, verify that /var/named/zonesync/zonesync.SLAVE.IP.ADDRESS.named.conf exists and is correct. If everything looks good, restart named: `service named restart`
58+
5. Set up cronjob on Slave to sync to Secondary Slave a few minutes apart from original cronjob
59+
* `7,22,37,52 * * * * /home/zonesync/zonesync/zonesync.sh > /home/zonesync/zonesync/log/zonesync.log`
60+
4061

4162
### Thanks!
4263

4364
Thanks to everyone who I've bugged to get this working over the last few years. You guys know who you are! If you have some ideas for this or would like to see an additional feature added, submit an issue and we'll see what we can do about getting it included.
4465

4566
If you would like to help contribute to this project, feel free to submit pull requests and help out!
67+
68+
69+
#### Last Updated 2015/07/01

0 commit comments

Comments
 (0)