high availability – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Wed, 04 Jan 2023 10:27:55 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 What is High Availability Cluster: A Basic Introduction https://tecadmin.net/high-availability-cluster/ https://tecadmin.net/high-availability-cluster/#respond Wed, 04 Jan 2023 10:27:55 +0000 https://tecadmin.net/?p=33605 A high-availability cluster is a type of computing system that is designed to ensure that critical services and applications remain available to users with minimal downtime. It consists of multiple servers, or nodes, that are configured to work together to provide a single, unified service or application. If one node fails, the other nodes take [...]

The post What is High Availability Cluster: A Basic Introduction appeared first on TecAdmin.

]]>
A high-availability cluster is a type of computing system that is designed to ensure that critical services and applications remain available to users with minimal downtime. It consists of multiple servers, or nodes, that are configured to work together to provide a single, unified service or application. If one node fails, the other nodes take over to ensure that the service or application remains available to users.

There are several different types of high-availability clusters, including active-passive, active-active, and hybrid clusters.

  • An active-passive cluster consists of one active node that handles all requests and one or more passive nodes that are in standby mode. If the active node fails, the passive node(s) take over and become the active node(s). This type of cluster is simple and easy to set up, but it can lead to downtime if the failover process takes too long.
  • An active-active cluster consists of multiple active nodes that handle requests simultaneously. This type of cluster offers improved performance and scalability, but it can be more complex to set up and manage.
  • A hybrid cluster combines elements of both active-passive and active-active clusters. It typically includes one or more active nodes that handle requests and one or more passive nodes that are in standby mode. If an active node fails, the passive node(s) take over and become active, providing failover protection.

High-availability clusters are used in a variety of environments, including mission-critical applications, web servers, and databases. They are an important tool for ensuring the continuous operation of services and applications, as well as protecting against data loss and downtime.

To achieve high availability, clusters often use specialized software and hardware components, such as load balancers, storage area networks (SANs), and redundant power supplies. They may also utilize failover protocols, such as the Heartbeat protocol, to monitor the health of the nodes and initiate a failover if necessary.

In summary, a high-availability cluster is a system that is designed to ensure that critical services and applications remain available to users with minimal downtime. It consists of multiple servers, or nodes, that are configured to work together and provide failover protection in the event of a node failure. High-availability clusters are used in a variety of environments and can be an important tool for ensuring the continuous operation of services and applications.

The post What is High Availability Cluster: A Basic Introduction appeared first on TecAdmin.

]]>
https://tecadmin.net/high-availability-cluster/feed/ 0
How to Setup IP Failover with KeepAlived on Ubuntu & Debian https://tecadmin.net/setup-ip-failover-on-ubuntu-with-keepalived/ https://tecadmin.net/setup-ip-failover-on-ubuntu-with-keepalived/#comments Sun, 05 Feb 2017 09:30:10 +0000 https://tecadmin.net/?p=11148 Keepalived is used for IP failover between two servers. Its facilities for load balancing and high-availability to Linux-based infrastructures. It worked on VRRP (Virtual Router Redundancy Protocol) protocol. In this tutorial, we have configured IP failover between two Linux systems running as a load balancer for load balancing and high-availability infrastructures. You may also intrested [...]

The post How to Setup IP Failover with KeepAlived on Ubuntu & Debian appeared first on TecAdmin.

]]>
Keepalived is used for IP failover between two servers. Its facilities for load balancing and high-availability to Linux-based infrastructures. It worked on VRRP (Virtual Router Redundancy Protocol) protocol. In this tutorial, we have configured IP failover between two Linux systems running as a load balancer for load balancing and high-availability infrastructures.

You may also intrested in our tutorial How to Setup HAProxy on Ubuntu & Linuxmint .

Network Scenario:
  1. LB1 Server: 192.168.10.111 (eth0)
  2. LB2 Server: 192.168.10.112 (eth0)
  3. Virtual IP: 192.168.10.121

keepalived-vrrp-network

I hope you get a better understanding of the setup with the above structure. Let’s move to the configuration IP failover setup between LB1 and LB2 servers.

Step 1 – Install Required Packages

First of all, Use the following command to install required packages to configure Keepalived on the server.

sudo apt-get update
sudo apt-get install linux-headers-$(uname -r)

Step 2 – Install Keepalived

Keepalived packages are available under default apt repositories. So just use a command to install it on both servers.

sudo apt-get install keepalived

Step 3 – Setup Keepalived on LB1.

Now create or edit Keepalived configuration /etc/keepalived/keepalived.conf file on LB1 and add the following settings. Update all red highlighted values with your network and system configuration.

vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived

global_defs {
   notification_email {
     sysadmin@mydomain.com
     support@mydomain.com
   }
   notification_email_from lb1@mydomain.com
   smtp_server localhost
   smtp_connect_timeout 30
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 101
    priority 101
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.10.121
    }
}

Step 4 – Setup KeepAlived on LB2.

Also, create or edit Keepalived configuration file /etc/keepalived/keepalived.conf on LB2 and add the following configuration. While making changes in the LB2 configuration file, make sure to set priority values to lower than LB1. For example below configuration is showing 100 priority value than LB1 has it 101.

vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived

global_defs {
   notification_email {
     sysadmin@mydomain.com
     support@mydomain.com
   }
   notification_email_from lb2@mydomain.com
   smtp_server localhost
   smtp_connect_timeout 30
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 101
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.10.121
    }
}
1. Priority value will be higher on Master server, It doesn’t matter what you used in state. If your state is MASTER but your priority is lower than the router with BACKUP, you will lose the MASTER state.
2. virtual_router_id should be same on both LB1 and LB2 servers.
3. By default single vrrp_instance support up to 20 virtual_ipaddress. In order to add more addresses you need to add more vrrp_instance

Step 5 – Start KeepAlived Service

Start keepalived service using the following command and also configure to autostart on system boot.

sudo service keepalived start

Step 6 – Check Virtual IPs

By default virtual IP will be assigned to the master server, In the case of master gets down, it will automatically assign to the slave server. Use the following command to show assigned virtual IP on the interface.

ip addr show eth0

Sample output

2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b9:b0:de brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.111/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.10.121/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::11ab:eb3b:dbce:a119/64 scope link
       valid_lft forever preferred_lft forever

Step 7 – Verify IP Failover Setup

  1. Shutdown master server (LB1) and check if ips are automatically assigned to slave server.
ip addr show eth0
  1. Now start LB1 and stop slave server (LB2). IPs will automatically assigned to master server.
ip addr show eth0
  1. Watch log files to insure its working
tailf /var/log/syslog

Sample Output

Feb  7 17:24:51 tecadmin Keepalived_healthcheckers[23177]: Registering Kernel netlink reflector
Feb  7 17:24:51 tecadmin Keepalived_healthcheckers[23177]: Registering Kernel netlink command channel
Feb  7 17:24:51 tecadmin Keepalived_healthcheckers[23177]: Opening file '/etc/keepalived/keepalived.conf'.
Feb  7 17:24:51 tecadmin Keepalived_healthcheckers[23177]: Configuration is using : 11104 Bytes
Feb  7 17:24:51 tecadmin Keepalived_healthcheckers[23177]: Using LinkWatch kernel netlink reflector...
Feb  7 17:24:52 tecadmin Keepalived_vrrp[23178]: VRRP_Instance(VI_1) Transition to MASTER STATE
Feb  7 17:24:53 tecadmin Keepalived_vrrp[23178]: VRRP_Instance(VI_1) Entering MASTER STATE
Feb  7 17:24:53 tecadmin avahi-daemon[562]: Registering new address record for 192.168.10.121 on eth0.IPv4.

The post How to Setup IP Failover with KeepAlived on Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/setup-ip-failover-on-ubuntu-with-keepalived/feed/ 9