slave dns picking up on the master dns

Discussion in 'General' started by HooGLaNDeR, May 31, 2009.

  1. HooGLaNDeR

    HooGLaNDeR New Member

    Hi all,

    I've set up a master dns, eg 10.0.0.1
    and a slave dns, eg 10.0.0.2

    when installing the slave dns, i've also pointed out the master dns through the expert setup.

    Yet, how does the slave dns replicate from the master dns?

    For some reason it just doesn't pick up on any zone alterations/ new zones :confused:.

    Can anyone help me in the right direction?

    Thanks in advance.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Till is currently working on a first steps guide for ISPConfig 3, so that might clear up a few things. :)
     
  3. HooGLaNDeR

    HooGLaNDeR New Member

    I hope so. The product is very nice. If i can get it to replicate with the slaves it would be perfect.


    //HooGLaNDeR
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The current version does not repliacte the settings, it just manages different dns servers. It is planned to have a mirrot option in the next relaese. Until then you can either point the mydns of the slave server directly to the master database or you use mysql replication without having ispconfig installed on the slave or you do a little modification in the ispconfig code that I described here for a mail setup:

    http://www.howtoforge.de/forum/showpost.php?p=10927&postcount=3

    Basically you edit the file /usr/local/ispconfig/lib/classes/modules.inc.php on the slave server and change the line:

    Code:
    $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 0) ORDER BY datalog_id";
    to

    Code:
    $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = 1 OR server_id = 0) ORDER BY datalog_id";
    So the slave will now replicate every new or updated dns entry from the server with ID 1 (the master server) which is all you need for the replicated dns setup.
     
  5. HooGLaNDeR

    HooGLaNDeR New Member

    Okay, i found it, and i changed it.
    Unfortunately it still doesnt pick up any addings to my dns1.

    How can i troubleshoot to see wheres its going wrong?
     
  6. HooGLaNDeR

    HooGLaNDeR New Member

    Anybody, any idea to fix this?
    I'm clueless :(
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    enable debugging in config.inc.php to check what the system is doing.
     
  8. HooGLaNDeR

    HooGLaNDeR New Member

    Ok, good one. Lemme examine whats going on :)
     
  9. HooGLaNDeR

    HooGLaNDeR New Member

    So, there is a form of communication, yet on the the slave i see nothing happening.


    Just to be sure.

    i create the domain on the master, i create the domain on the slave?
    Or should it also appear on the slave automagicly?


    link to a screenshot

    Or am i doing something totally wrong?
     
    Last edited: Jun 16, 2009
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    If you changed the SQl as I explained in #4, then you dont have to create the domain on the second server.

    If you did not changed sql, you will have to create the domain on the second server.
     
  11. HooGLaNDeR

    HooGLaNDeR New Member

    this is on the slave side :

    I've changed it, as you wrote down.
    It's just that i don't see anything working :(
    Where could i see any alternative debug logs?
     
    Last edited: Jun 16, 2009
  12. Naudski

    Naudski New Member

    I've exactly the same problem. Slave not picking up anything.
    Any comments??

    Regards,
    Naudski
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you use the normal setup or the hack described in this thread?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    There is just one log and you see it already. Check if the changes have been executed on the main server.
     
  15. HooGLaNDeR

    HooGLaNDeR New Member

    On the Master it gets changed. Only the slave doesn't do anything.

    Any other way to check ?
     
  16. HooGLaNDeR

    HooGLaNDeR New Member

    Whatever i do, i dont get the slave updated. Anyone who has sorted this issue?

    I've done a fresh install and followed the howto of this site.
     
  17. HooGLaNDeR

    HooGLaNDeR New Member

    Has anyone ever found a way to resolve this ?
     
  18. Uvigii

    Uvigii New Member

    Last edited: Jan 8, 2010
  19. William K.

    William K. New Member

    I have one Master ISPConfig, one secondary server joining the master, with full services (web, mail, dns), and a ISPConfig without WebUI.
    Master already has dozens of SOA and thousands of records.
    Second is a new/clean server.
    Master is running ISPConfig 3.0.5.4.p5, and second server is 3.0.5.4.p8
    important: second is not a mirror.
    Following suggestions, I found in this thread, wich let's me to this solution:

    First, I don't know why, the table dns_soa in the master ISPConfig, has one column that the newest version of ISPConfig, at the second server, don't have. So please check and add the columns if it's needed, use phpMyAdmin to check/add the missing column.
    Code:
     recursive	smallint(6)
    At the second server, edit:
    Code:
    vim /usr/local/ispconfig/server/lib/classes/modules.inc.php
    Code:
    // line below commented
    // $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']."
    // AND (server_id = ".$conf['server_id']." OR server_id = 0) ORDER BY datalog_id LIMIT 0,1000";
    
    // by TiNX
    $sql = "SELECT * FROM sys_datalog WHERE
                    datalog_id > " . $conf['last_datalog_id'] . "
                    AND (
                            (server_id = ".$conf['server_id']." OR server_id = 0)
                            OR (server_id = 1 AND dbtable like 'dns%')
                            )
                    ORDER BY datalog_id LIMIT 0,1000";
    
    As this is not a mirror server, the changed code now will get all regular changes for itself (server_id), and also, all changes for the master server (id 1) on tables starting with dns_* name. My master server_id is 1, change if it's needed.

    Now, and additional change is needed on another file, at the second server too:
    Code:
    vim /usr/local/ispconfig/server/server.php
    find this line and comment it (there are two similar lines, the second line $tmp_rec is the right, since we're not using mirror):
    Code:
    // $tmp_rec = $app->dbmaster->queryOneRecord("SELECT count(server_id) as number from sys_datalog WHERE datalog_id > " . $conf['last_datalog_id'] . " AND (server_id = " . $conf['server_id'] . " OR server_id = 0)");
    and add this very similar line as the first change made:

    Code:
    $sql = "SELECT count(server_id) as number from sys_datalog WHERE
                    datalog_id > " . $conf['last_datalog_id'] . "
                    AND (
                            (server_id = ".$conf['server_id']." OR server_id = 0)
                            OR (server_id = 1 AND dbtable like 'dns%')
                            )
                    ORDER BY datalog_id LIMIT 0,1000";
                    $tmp_rec = $app->dbmaster->queryOneRecord($sql);
    
    Then, I just changed some value for a DNS SOA, and the SOA record was "REPLACED/INSERTED INTO" the ISPConfig tables at the second server. After a minute or two. I also changed a TTL for a record on the same SOA, and it updates it fine too.
    After a couple of testes, I was able to force a full refresh of DNS records at the Master ISPConfig UI
    Code:
    Tools -> Resync -> [X] Resync DNS records -> Start
    After that I take a look into the master's sys_datalog table and see a lot of updates.
    Just a minute later, all SOAs and Records where available on the second server.
    As I use MyDNS on both servers, after records are on the table, instantly the DNS service will get the records. I guess if you are using bind, you will need to wait a little more to local scripts rebuild the files.

    *Use at your own risk

    Congratulations for all of you developing and supporting ISPConfig. The multi-server setup is very important, maybe in the feature we can see an option "Mirror DNS Only", which will solve this thread forever. ;-)
     
  20. William K.

    William K. New Member

    Additionally,
    as you copy all records from master to slave, the /etc/mydns.conf don't need to have the soa-where neither rr-where lines, so comment those lines:

    Code:
    # soa-where = server_id = 2
    # rr-where = server_id = 2
    
     

Share This Page