How can i make load balancing with BIND 9?

Discussion in 'Server Operation' started by xdanx, Nov 9, 2008.

  1. xdanx

    xdanx New Member

    Hello,
    I'm having a frustrating issue here, and i cant find a viable solution after searched howtos for a month...

    My setup is as follows : i have 2 server, with 2 different public IP addresses. I'm running BIND on both of them, and i did setup them according the http://www.howtoforge.com/traditional_dns_howto as follows: 1 slave and 1 master.
    I dont want to make load balancing between them, and also i want to make a "failover" situation. I dont know if this is the corret term. Basicly, if one server is down [ having no internet connection] i want to redirect all users who access my website to the other server who is already mirroring the content. And i want to do this with BIND, because i dont have the resources to use a hearthbeat server.
    I found that i can use SRV options, to make a load balancing and a failover situation. and my setup looks like this : [ the domain and ips are changed ]
    Code:
    [the SOA thing ]..
    
    $TTL 28800
    @ IN NS ns1.example.org.
    @ IN NS ns2.example.org.
    example.org.      A 192.168.0.1
    ns1             A 192.168.0.1
    ns2             A 172.16.10.1
    
    $TTL 84
    _http._tcp.www.example.org.        IN SRV 0 1 80 www.example.org.
                                       IN SRV 1 1 80 www2.example.org.
    
    www.example.org.          IN A 192.168.0.1
    www2.example.org.         IN A 172.16.10.1
    
    The problem is if i stop apache / bind on 192.168.0.1, and i flush dns records on my computer, when i try to access http://www.example.org i get Connection timed out , but no redirection.

    Knowing this, can you give me any ideea, or a link to a resource i can consult ? Everywhere i go, it says the same thing : use SRV records and it works 100%. But in my case, it doesn't.

    Also, I am interested in any possibility to do what i want to do. I can modify the nameservers pointing to my servers in the Root NS.

    Thx a lot for reading,
    Dan
     
  2. falko

    falko Super Moderator ISPConfig Developer

    DNS is a bad solution for HA setups because DNS records are almost always cached, so you can never be sure what answer a client gets for a DNS query (even if it's working for you).
     
  3. xdanx

    xdanx New Member

    But what if i set the TTL for let's say 60s? I made a research on google NSs, they have set TTL for 84s, and they are using round robin DNS, with 4 ips.
    And speaking of this, isn't round robin a form a load balancing ? I'd use that method if it wasn't 1 problem : the round robin thingy cannot control whether the server is "dead" or online..
    Supposing we don't get cached, is there any method i can make what i want ?

    Thx,
    Dan
     
  4. falko

    falko Super Moderator ISPConfig Developer

    That doesn't help you if other name servers don't care about the TTL and use a caching mechanism. There are lots of caching nameservers out there.
     
  5. xdanx

    xdanx New Member

    Ok then. Thx a lot for your help. I think i'll just try to find another solution.
     

Share This Page