Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


PowerDNS Bind Slave
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

PowerDNS Bind Slave

FRCoreyFRCorey Member
edited April 2013 in General

Has anyone setup a PowerDNS mysql master and a BIND slave? Ever since one secondary had to be rebuilt we have had issues with the slaves having correct info, powerDNS blames Mysql, but replication looks like it's working just fine. So I wanted to try setting up a bind backend that's a slave, but I dont see any guides for that.

Comments

  • well you should also use powerdns but with bind style backend.
    Here is my slave which uses bind backend:/its also master for some zones but thats another story/

    "_etc_powerdns_pdns.conf:"

    # launch Which backends to launch and order to query them in launch=bind bind-config=/etc/powerdns/bind/named.conf bind-check-interval=600
    __

    "part of named.conf: /just the zones in bind format/"

    zone "domain1.etc" { type master; file "/var/named/domain1.etc.db"; masters { masterip1;masterip2; }; allow-transfer { axfr1;axfr2;axfr3;axfr4; }; }; zone "losho.tk" { type slave; file "/var/named/d"; masters { masterip1;masterip2; }; allow-transfer { axfr1;axfr2;axfr3;axfr4; }; };

  • So does it AXFR it from the PDNS master and create those extra zones, trying to figure out how you kickstart this to get going. Though I did get ahold of a DBA to straighten me out on how SolusVM does things and how to repair everything.

    If you ever find records missing on slaves, login into mysql on the master and the slaves and issue the following.

    use powerdns;
    select * from records;

    If the numbers do not match then you are out of sync. What happened to me was I unwittingly rebuilt the secondary from scratch and did not know to copy the data from the master over (n00b replication mistake, and I think it's stupid slaves cant tell if it has all the database) and it was just copying over everything after it was setup. So updating domains in SolusVM never fixed the issue, you had to do a delete of a zone and re-enter it so it became a new entry in the DB and sync over to the secondaries. Irritating!

    so to fix go to the master

    flush tables with read lock;

    open second session and do the db dump with msyqldump

    mysqldump --master-data -u root -p powerdns > powerdns.sql

    you can now unlock tables with

    unlock tables;

    scp file over to secondary

    stop secondary mysql process

    then

    start mysql with -skip slave option

    mysqld_safe --skip-slave-start

    Then import the copied database

    mysql -u root -p powerdns < powerdns.sql

    stop mysqld_safe

    start mysqld normally.

    loging into mysql and enter

    show slave status \G

    And it should match the binlog position etc and slave show show running IO and all that.

  • well im not using mysql replication..

  • @fixidixi after that mess I'd prefer not to, but how do you tell the slave to talk to the master to axfr the zones in or is it manual?

  • I'm using a custom bash script that runs and the end of the zone creation on the master to add the bind style zone "headers" on the slave (which are located in _etc_powerdns_bind_named.conf )
    Then a notification is sent about the zone change and then powerdns requests an axfr for that zone and creates the real zone file where its told to do so (in the example here: /var/named/domain1.etc.db)

  • We using percona mysql instead the normal mysql replication. The setup is easier than the normal mysql/solusvm setup and you can use all nameservers as a master. Install mysql master/master setup from a percona howto, add the mysql db and it works fine.

  • danodano Member

    I have done very similar to the above, when I have had a secondary powerdns server that needed to be rebuilt -- essentially taking a snap of the masters current position in the mysql db and using that as the starting point for the slave. I also use Percona for the powerdns setup I have, and have had issues with it coming up and not replicating at first, but restarting the slave via mysql cli or the mysql server itself has usually seemed to clear it up, and adding records and verifying it's actually working afterwards is a good thing to do. In the last few years of running this setup, I have had an incident or two where a secondary wasn't updating, or seemed to be "slow" to update, as reported by end users. I finally decided that I should monitor the position of the mylog files to ensure that they were seeing the same version, and if not, to alert me.

  • gbshousegbshouse Member, Host Rep
    edited April 2013

    We are using Percona together with master-slave replication and few custom monitoring tools and everything works like a charm. You can check Percona Toolkit for few nice tools.

Sign In or Register to comment.