Test LVS and Keepalived load balancing on the UbuntuOSxen Virtual Machine

Source: Internet
Author: User
Test the network topology of lvs and keepalived load balancing on the UbuntuOSxen Virtual Machine: Virtual Machine manager and xen Virtual Machine instance: Step 1: Install LVS and keepalived: Install the LVS and keepalived software on the ctor server, respectively, run $ sudoapt-getinstallipvsadm to install keepalived. Run the following command: $ su.

Test lvs and keepalived load balancing on the Ubuntu OS xen Virtual Machine


Network Topology:

Virtual Machine manager and xen Virtual Machine instance:

Step 1:InstallLVSAndKeepalived:InDirectorOn the server, installLVSAndKeepalivedSoftware, use the command:

$ Sudo apt-get install ipvsadm

InstallationKeepalived, Run the following command:

$ Sudo apt-get installkeepalived

Step 2: ConfigurationKeepalived: After installation/Etc/keepalivedDirectoryKeepalived. confFile, write the configuration file as follows:

# Global Configuration

Global_defs {

Lvs_id director1

}

# VRRP Configuration

Vrrp_instance LVS {

State MASTER

Interface eth0

Virtual_router_id 51

Priority150

Advert_int 1

Authentication {

Auth_type PASS

Auth_pass 123456

}

Virtual_ipaddress {

192.168.122.38

}

# Virtual ServerConfiguration-for WWW service

Virtual_server 192.168.122.3880 {

Delay_loop 1

Lb_algo rr

Lb_kind DR

Persistence_timeout 60

Protocol TCP

# Real Server 1 configuration

Real_server 192.168.122.36 80 {

Weight 3

TCP_CHECK {

Connection_timeout 10

Nb_get_retry 3

Delay_before_retry 3

}

Real_server 192.168.122.37 80 {

Weight 1

TCP_CHECK {

Connection_timeout 10

Nb_get_retry 3

Delay_before_retry 3

}

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.