Web, Email & MySQL Database Cluster : server2 doesn't handle DNS

Discussion in 'General' started by electronico_nc, Aug 30, 2018.

  1. Hi all,

    Well I've setup (4 years ago) a configuration similar to this one : https://www.howtoforge.com/tutorial...abase-cluster-on-debian-8.4-with-ispconfig-3/
    (except that I was using unison instead of Dovecot to sync emails)

    Databases, emails and sites were all well synched on server2.
    server1 turned out to be offline.

    Bad thing is that all DNS zones were assigned to server1 in ISPConfig (on server2), ie :
    Client Server Zone NS Email
    client1 server1.domain.tld zone1.tld ns1.zone1.tld. [email protected]
    client2 server1.domain.tld zone2.tld ns1.zone2.tld. [email protected]

    So I was able to change the DNS values, but they were assigned to server1 (offline).
    There is no DNS inputs for server2.domain.tld

    Is that a normal case ?
    I had to manually edit every bind zone file to make DNS working (and stopping ISPConfig cronjob that would revert changes)
    Thanks a lot for your time.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member

    If I follow you correctly, you had your database, email, sites and DNS mirrored in a cluster setup, but you were expecting DNS record to be different on the two servers? I think your setup was working correctly, IE. both servers normally have identical DNS; what you were missing is a means for connections to go to server2 when server1 is offline. There are various ways to make that happen, and updating DNS with server2's address is one option, though it of course isn't live failover. Other options would be to share the live IP address and handover on failure with eg. ha, or use an external failover/load balancer to forward connections to the live box (eg. haproxy could prefer server1 but fail over to server2).
     
    ahrasis likes this.
  3. Hi,
    Thanks for your answer !
    I know that a failover IP would be the best way (but in this case the 2 servers are not hired by the same companies, so I can't share an IP between them).
    What hurts me is that (now that server1 is offline) when I connect to server2 ISPConfig GUI, DNS :
    All listed zones are assigned to server1.domain.tld and there isn't any other option (server2.domain.tld) in the 'server' dropdown list.
    I thought I could simply assign all zones to server2 and update the DNS entries (via the API).
     
  4. Jesse Norell

    Jesse Norell Well-Known Member

    Try skipping the "assign all zones to server2" and just update the DNS entries with server2's address - depending on your setup, that might work (I have not done a clustered setup like this, fwiw).
     
  5. That is what I have done, but changes are NOT applied to server2 ....
    Basically nearly all DNS sites input (A) were pointing to server1 IP.
    When server1 has gone offline, I ran the API script I wrote to update all DNS sites entries to server2 IP.
    But server2 bind files are NOT modified.
     
  6. In a cluster setup, each server has its own database :
    server1 -> dbispconfig1
    server2 -> dbispconfig2
    in this case : server2 has only access to dbispconfig1 database (server1 one, that if offline)
    I'm in a hurry to make this setup working again, I'll keep you informed
     
  7. ahrasis

    ahrasis Well-Known Member

    Are you trying to fix A record (the ip address) replicated in server 2 to server 2 ip?

    A script to search and replace plus a dns resync afterwards seems the only way to do so.
     
  8. Hi,
    Yes, that's what my script is doing.
    Bad thing is that server2 only has access (from Ispconfig GUI) to server1 database.
     
  9. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    If you run a mirror-setup, the slave-servers are always excluded from the server-list.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Just as a short explanation for this: They are excluded because the records are mirrored to them automatically, so it makes no sense to list mirror slaves in server list.
     
  11. ahrasis

    ahrasis Well-Known Member

    Good if you already have the script ready for that. I hope you can share the script and/or its how to.

    No sure about the ISPConfig Control Panel access, but I think server1 mainly accesses dbispconfig1 and server2 mainly accesses dbispconfig2, and they are both available in both servers (automatically resynced and updated if both are working); so you may just need to enable ISPConfig control panel (GUI) from server2 in case server1 cannot be accessed?
     
  12. Thanks Florian and Till for your answers.
    Yes that's a mirror-setup (server2 is mirror of server1).
    Server1 is offline.
    Server2 can only access server1 database.
    So it is impossible to make any change via Ispconfig GUI on server2 ...
    Is it a normal case ?
     
  13. It requires a bit time reading the API doc, I'll post it later (on phone right now) .
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. The second server will continue to work but you can not change things in the config until master is up again.
     
  15. OK Till, thanks for for explanation.
    And what about master server can't be up again ?
    Is there any possible master-master solution ?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    You must rebuild your master server if you want to be able to manage the system again. Or you must reconfigure the slave to be a single system if you don't want to use server mirroring anymore.
     
    ahrasis likes this.
  17. In this particular case (Master won't be online) :
    Will a simple untick 'is a mirror of' on slave live server suit ?
    (thanks again for your helpfull replies, I think these details should be mentionned in the how-to)
     
  18. ahrasis

    ahrasis Well-Known Member

    May be in the future you could try this dns settings with your mirrorred dns server:
     
  19. ahrasis, thanks for your inputs,
    I'll try
    (but sincerely future setup won't be 'mirror' as it doesn't suit my HA dreams)
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    If you want to have the admin interface highly available as well and not just the hosted services, then you must use a database cluster for the master database which ensures that the master database is always reachable from all slaves.
     

Share This Page