HA for 2 ISPConfig servers (DNS)

Discussion in 'Installation/Configuration' started by electronico_nc, Sep 12, 2014.

  1. Hi all,

    I feel ashamed, but I have to ask for your lights (as my head is mixed-up with all infos collected to achieve this).

    The aim : Making a complete ISPConfig HA cluster with 2 identical servers (located in same datacenter), servers are actually running Ubuntu 12.04.
    If server#1 fails, all ISPConfig services (DNS, websites, databases, emails, FTP users) are taken by server#2.
    (I haven't deeply thought to what should happen when server#1 is back, but I'd imagine it should take all services back as soon as everything is OK)

    The servers are hosted by SoYouStart, IP FailOver is active but there is actually no API available to manage them.

    Datas (/var/www /var/vmail) can match on both servers (using DRDB or GlusterFS).
    Databases can match by a MySQL replication.
    I have troubles to understand how to pass automatically DNS from one server to the other one ...

    Domains are defined by our local TLD manager with 2 Name Servers (can be IP or ns.domain.tld) and cannot be changed without human intervention (Captcha required).

    Thanks in advance for your thoughts.

    Nicolas
     
  2. Would an intermediate DNS manager that can be managed through an API be the solution (like Gandi) ?

    So all domains would be declared by local (national) TLD server : ns1.myhost.tld ns2.myhost.tld
    myhost.tld managed by Gandi (that has an API to change the IP assigned to ns1.myhost.tld ns2.myhost.tld)

    ?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Al config data is mirrored by ispconfig automatically. DNS is pure config data, no payload or files involved, so everything related to dns is mirroed by ispconfig automatically out of the box, no third party software required.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You might want to take a look at the ispconfig cluster guides, they ddescrbe a complete setup with mirroring of all available ispconfig services.
     
  5. Thanks Till for your answers.

    Would you mind to send an URL or page in ISPConfig manual about theses guides ?

    I have the previous manual version
    Might be time to take the last one ?

    Thanks again.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The guide is available online (on ispconfig.org documentation page):

    http://www.howtoforge.com/installin...tabase-cluster-on-debian-6.0-with-ispconfig-3

    But if you like to

    The guide is for debian 6, but the basic setup is the same for all linux distributions and newer debian versions.

    The principle is:

    1) /var/www and /var/vmail have to be some king of synced shared drive (like cluster filesystem, nfs server, NAS, SAN or synced with unison or any other 2way sync.

    2) the databases of the websites have to be synced with a mysql replication, percona or other technology that allows master/master sync. The ispconfig mysql database is smething different as ecah node needs its own one. Therefor we name them in the cluster setup dbispconfig1, dbispconfig2 etc. to ensure that mysql does not replicate data beween the ispconfig instances which would cause ispconfig to loose track on whats configured already on which node.

    3) The config of both servers is synced by ispconfig internally. just ensure that you do the settings like connect webid to userid as describe din the guide to ensure that files on both servers are owned by the same user.
     
  7. Thanks Till for taking time to write all these details,

    What is disturbing me is the DNS resolution.

    Let's speak about "real" case, both servers have an IP FailOver added (so 2 different IP pointed to the same server to fit our national TLD registar requirment) (on server they are eth0, eth0:0)
    server1.host.tld = 94.23.218.10, 188.165.235.10
    server2.host.tld = 94.23.218.11, 188.165.235.11

    As you said, all datas/services are synced between servers.

    We manage 3 domains, so our hosted domains are (at national TLD server):
    domain1.tld = ns1.host.tld, ns2.host.tld
    domain2.tld = ns1.host.tld, ns2.host.tld
    domain3.tld = ns1.host.tld, ns2.host.tld

    In a single server setup (what I use actually):
    ns1.host.tld = 94.23.218.10 (server1 main IP)
    ns2.host.tld = 188.165.235.10 (server1 second IP)

    If server1.host.tld (it owns ns1.host.tld and ns2.host.tld) goes down, what can tell end-users who want to connect that server2.host.tld is now their destination ?

    Are tools like PowerDNS involved in this case ?

    Thanks (again).
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    DNS works differently from then other services like http. A DNS client always tries all dns servers of a domain. So in case that server 1 fails, the dns server on server 2 is contacted autoamtaically by the client. There is no need to switch something over and as ispconfig ensures that both servers can reply to all dns questions, the system is alwaysin sync.

    No, they rea not required.
     
  9. Thanks Till,
    Seems I was trying to re-invent the wheel ...
    I'll let you know in the next 2 days how it has gone.
    Many thanks again.
     
  10. Well, setup has been done with Ubuntu 14.04 (instead of 12.04 as previousely told).
    So I used a mix of Ubuntu 14.04 perfect server and http://www.howtoforge.com/installing-a-web-email-and-mysql-database-cluster-on-debian-6.0-with-ispconfig-3.

    Installed ISPConfig on the 2nd server too.
    Checked 2nd server in the "is mirror of" 1st one, and "Connect Linux userid to webid".

    DNS databases are well replicated, that's where it hurts me:
    For a new hosted domain, if I choose a A entry for 'www', I need to apply an IP to it, let's say server1.
    So if 1st server is choosen and it goes off-line, www.newdomain.tld is no more reachable...

    Here are the SQL answers on servers:
    Server1:
    Code:
    SHOW MASTER STATUS;
    +------------------+----------+--------------+------------------+
    | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
    +------------------+----------+--------------+------------------+
    | mysql-bin.000006 | 42646970 |              |                  |
    +------------------+----------+--------------+------------------+
    1 row in set (0.00 sec)
    Code:
    SHOW SLAVE STATUS \G
    *************************** 1. row ***************************
                   Slave_IO_State: Waiting for master to send event
                      Master_Host: server2_IP
                      Master_User: slaveuser
                      Master_Port: 3306
                    Connect_Retry: 60
                  Master_Log_File: mysql-bin.000006
              Read_Master_Log_Pos: 742065
                   Relay_Log_File: mysqld-relay-bin.000015
                    Relay_Log_Pos: 742211
            Relay_Master_Log_File: mysql-bin.000006
                 Slave_IO_Running: Yes
                Slave_SQL_Running: Yes
                  Replicate_Do_DB: 
              Replicate_Ignore_DB: 
               Replicate_Do_Table: 
           Replicate_Ignore_Table: 
          Replicate_Wild_Do_Table: 
      Replicate_Wild_Ignore_Table: 
                       Last_Errno: 0
                       Last_Error: 
                     Skip_Counter: 0
              Exec_Master_Log_Pos: 742065
                  Relay_Log_Space: 742411
                  Until_Condition: None
                   Until_Log_File: 
                    Until_Log_Pos: 0
               Master_SSL_Allowed: No
               Master_SSL_CA_File: 
               Master_SSL_CA_Path: 
                  Master_SSL_Cert: 
                Master_SSL_Cipher: 
                   Master_SSL_Key: 
            Seconds_Behind_Master: 0
    Master_SSL_Verify_Server_Cert: No
                    Last_IO_Errno: 0
                    Last_IO_Error: 
                   Last_SQL_Errno: 0
                   Last_SQL_Error: 
      Replicate_Ignore_Server_Ids: 
                 Master_Server_Id: 2
    1 row in set (0.00 sec)
    Server2:
    Code:
    SHOW MASTER STATUS; 
    +------------------+----------+--------------+------------------+
    | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
    +------------------+----------+--------------+------------------+
    | mysql-bin.000006 |   742065 |              |                  |
    +------------------+----------+--------------+------------------+
    1 row in set (0.00 sec)
    Code:
    SHOW SLAVE STATUS \G
    *************************** 1. row ***************************
                   Slave_IO_State: Waiting for master to send event
                      Master_Host: server1_IP
                      Master_User: slaveuser
                      Master_Port: 3306
                    Connect_Retry: 60
                  Master_Log_File: mysql-bin.000006
              Read_Master_Log_Pos: 42646970
                   Relay_Log_File: mysqld-relay-bin.000013
                    Relay_Log_Pos: 41922472
            Relay_Master_Log_File: mysql-bin.000006
                 Slave_IO_Running: Yes
                Slave_SQL_Running: Yes
                  Replicate_Do_DB: 
              Replicate_Ignore_DB: 
               Replicate_Do_Table: 
           Replicate_Ignore_Table: 
          Replicate_Wild_Do_Table: 
      Replicate_Wild_Ignore_Table: 
                       Last_Errno: 0
                       Last_Error: 
                     Skip_Counter: 0
              Exec_Master_Log_Pos: 42646970
                  Relay_Log_Space: 42647376
                  Until_Condition: None
                   Until_Log_File: 
                    Until_Log_Pos: 0
               Master_SSL_Allowed: No
               Master_SSL_CA_File: 
               Master_SSL_CA_Path: 
                  Master_SSL_Cert: 
                Master_SSL_Cipher: 
                   Master_SSL_Key: 
            Seconds_Behind_Master: 0
    Master_SSL_Verify_Server_Cert: No
                    Last_IO_Errno: 0
                    Last_IO_Error: 
                   Last_SQL_Errno: 0
                   Last_SQL_Error: 
      Replicate_Ignore_Server_Ids: 
                 Master_Server_Id: 1
    1 row in set (0.00 sec)
    Server1 has well been setup with database 'dbispconfig1', server2 with 'dbispconfig2'.

    Did I do something wrong ?
    Or do I just need to write a script that updates server2 DNS entries if server1 fails ?

    Thanks again for your time.
    Nicolas
     
    Last edited: Sep 17, 2014
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The ispconfig setup ensures that you can use both servers, either as hot standby or even simultaniously for load balancing.

    How you do that is out of the scope of the ispconfig setup as this has to be done "in front" of this setup. There are several options avilable e.g. a shared IP that get switched over to the other server or a loadbalancer soft- or hardware in front of the servers or you change the IP address in DNS. But the dns solution si not optimal as not all caching nameservers will respect a short ttl, so it may take some time until a dns switch takes place.
     
  12. Thanks Till,
    I have now a clearer vision of the ISPConfig setup.
    For sure a switching FailOver IP it what should be used in this case.
    (just stuck with a non-existant API for this by SoYouStart for now)
    Writing a daemon that will update DNS entries if server1 is what I first think to.
    Thanks again for your time (and please excuse the border-line way used to contact you).
    Nicolas
     

Share This Page