New cluster - haproxy,keepalived, dns made easy?

Comments

12 comments

  • Avatar
    bob bob

    Maybe someone can assist me here?

    or refer me to a document about it.....i know its a stupid question but will appreciate some help here.

  • Avatar
    Sebastian Insausti

    Hi,

    Keepalived allows you to configure a virtual IP within a group of servers. This virtual IP is assigned to an active server. If this server fails, the IP is automatically migrated to the secondary server, allowing it to continue working with the same IP in a transparent way for your systems. You can avoid using this, but if your load balancer fails, all your system will be down, so keepalived is recommended for an HA environment with 2 load balancers at least.

    You can refer the following links for HA environments:

    https://severalnines.com/blog/become-clustercontrol-dba-making-your-db-components-ha-load-balancers

    https://severalnines.com/resources/tutorials/mysql-replication-high-availability-tutorial

    https://severalnines.com/resources/tutorials/mysql-load-balancing-haproxy-tutorial 

    https://severalnines.com/blog/become-mysql-dba-blog-series-database-high-availability

     

  • Avatar
    bob bob

    Can i just use DNS for HA ?

  • Avatar
    Sebastian Insausti

    Hi,

    The DNS is not recommended for HA.

    If you have the same record resolving differents IP address you can't check if some of the destinations are not responding, so if one of the nodes are down, you will sending traffic anyway.

    For this is recommended to use a Load Balancer. With this, if one node is down, the load balancer won't send traffic to him until it will online again.

  • Avatar
    bob bob

    Please bare with me here....the part i am struggling to understand is the floating IP address.

    is it something i need to ask my ISP for?

     

    I can set up 2 load balancers, and let DNS made easy do the failover between them...will that work?

     

  • Avatar
    Sebastian Insausti

    Hi,

    In general, the virtual IP is a private IP address, so you don't need to ask this to your ISP, but it depends on your infrastructure.

    I can't help you with the DNS made easy implementation because of I'm not sure how it works, but you can implement keepalived with ClusterControl to add HA for your load balancer servers.

  • Avatar
    bob bob

    I currently have 1 server with 25 sites

    and another 3 servers for the database cluster hosted at 3 different countries (through digital ocean)

  • Avatar
    Ashraf Sharif

    Hi,

    ClusterControl's Keepalived deployment only works with bare-metal infrastructure (where you have the freedom to choose your routable floating IP address). For cloud infrastructure the steps are vary depending on the cloud provider. With Digital Ocean, you need to use Floating IP Assignment Script as shown in this guide:

    https://www.digitalocean.com/community/tutorials/how-to-set-up-highly-available-web-servers-with-keepalived-and-floating-ips-on-ubuntu-14-04

    Regards,
    Ashraf

  • Avatar
    Alyson Whitaker

    I know this was posted 6 months ago - but adding to this question.  Should HAProxy instances be setup on separate servers or on the database servers?  What about keepalived? Separate server also?

  • Avatar
    Sebastian Insausti

    Hi Alyson,

    The HAProxy should be installed in a separate Server/VM or in the Application Server, depending on the requirement. This is to balance the traffic from the application server or from the users to the correct server/servers.

    Regarding the Keepalived, this service should be installed in the same HAProxy server if you want to deploy two HAProxy for HA. Keepalived will use a Virtual IP Address configured in the active HAProxy node. If this node fails, keepalived will migrate the Virtual IP Address to the second HAProxy to keep working in a transparent way for the application. 

    The Application should use the Virtual IP address to make it works.

    If you don't want to deploy two HAProxy instances, the keepalived is not necessary because it doesn't have a second HAProxy to migrate the virtual IP address.

    Regards,

    Sebastian.

  • Avatar
    Alyson Whitaker

    Thank you.  When building out HAProxy server - should it have two network interfaces? one for load balancer and one for the keepalived virtual IP?

  • Avatar
    Sebastian Insausti

    Hi Alyson,

    No. You don't need two network interfaces. Keepalived will add the virtual IP Address as a secondary IP in the same network interface.

    Regards,

    Sebastian.

Please sign in to leave a comment.

Powered by Zendesk