4 Servers Required First2 dir respectively is Dirmaster Dirslave2 RS run Nginx test service respectivelyDir192.168.186.129192.168.186.135Rs192.168.186.130192.168.186.132
First Build LVS-DR ServiceA.dir above installation Ipvsadm
Yum Install IpvsadmB. Changing the Ipvsadm configuration filevim/etc/usr/local/sbin/lvs_dr.sh#! /bin/bashecho 1 >/proc/sys/net/ipv4/ip_forward #dir服务器行开启路由转发功能Ipv=/sbin/ipvsadmvip=192.168.186.110rs1=192.168.186.1
Although the previous LVS have been configured successfully and load balanced, we found that when a real server stopped the Nginx process, the Director would still forward the request to the past, which caused some requests to be abnormal. So there needs to be a mechanism to detect the state of real server, which is keepalived. In addition to detecting the RS State, it can also detect the state of the standby director, that is, keepalived can implement the HA cluster function, of course, also ne
LVS + Keepalived DR Mode
Installation and deployment of LVS + KeepalivedFront-end master scheduling: IP address> 10.252.3.10Frontend scheduling backup: IP> 10.252.3.11VIP: 10.252.3.12RealServer: 10.252.3.15RealServer: 10.252.3.161: Install keepalivedipvsadm together with the master and slave nodes.Yum installkeepalived ipvsadm-yNote: You can use ipvsadm-Ln to view the LVS scheduling status.========================================================== ===
Linux system (5) DR mode of LVS cluster, lvsdrPreface
The DR mode is one of the three load balancing modes in the lvs cluster. in the previous article, I wrote about the establishment and Principles of the NAT mode. Why do we need the DR mode and IP tunneling mode?
First, let's look at three figures. LVS/NAT mode:
LVS/IP tunneling mode, such:
LVS/
Dr Model configuration InstructionsPreviously mentioned in the DR Model LVs and application servers have only one network card, but through the network card alias to configure multiple IPs, on the LVS above the alias configuration dip, on the application server through the alias to set the VIP.The packets coming out of the network must be CIP+VIP, so it should be forwarded to the LVS, not the application se
LVS-DR Demo:Test environment:os:rhel6.4Director:vip:192.168.10.120 DIP:192.168.10.111 rs1:rip:192.168.10.115 vip:192.168.10.120 rs2:rip:192.168.10.116 vip:192.168.10.120PS:LVS-DR There are two scenarios for whether RIP and VIP are in the same network segment, but both RIP and dip must be in the same network segment, which shows that Vip,dip,rip are all within the same physical networ
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/50/wKioL1VGQBfwCnoTAAHTHrrfBdg088.jpg "title=" Dr (2). PNG "width=" "height=" 365 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:365px; "alt=" Wkiol1vgqbfwcnotaahthrrfbdg088.jpg "/>Example of a configuration script for the Dr Type, director and Realserver:Director script:#!/bin/bash##lvsscriptforvs/
request
Sed:shortest expect delay shortest expected delay(active+1) *256/weight
Nq:never Queue never queue
for the first time on an SED basis each server sends a request at any
time
lblc:locality-based LC based on local minimum connectionConsider the number of cache connections, but the same request is sent as much as possible to the same cache server, which is equivalent to a dynamic DH
LBLCR:LBLC with Replication scheduling cache copy FeatureLBLC will
Linux kernel earlier than 2.4.23 needs to be re-compiled and patched to use LVS, after LVS directly made into the kernel using grep-i-C5ipvs/boot/config-'uname-R', you can view the operating system of ipvsadm in the user space/ipvs working in the kernel space...
Implementation of LVS in linuxLinux kernel earlier than 2.4.23 needs to re-compile and patch the kernel to use LVS, and then the LVS directly runs in the kernelUse grep-I-C 5 ipvs/boot/config-'uname-R' to viewIpvsadm works in the user sp
DR (The scheduler changes the destination MAC address of the requested packet to the MAC address of the real server and returns to the client without going through the scheduler)Each real server must have a public IPConfiguration Requirements Three MachinesEach NIC is configured with a public IPLVS/DR ConfigurationThree machines:Director (eth0192.168.1.123, VIP eth0:0: 192.168.1.128)Real Server1 (eth0 rip:1
LVS-DR mode:The client requests the resource on the server, sends the request message, requests the message arrives the LVS scheduler, the dispatcher splits the message header, views the target IP of the request to be itself, then chooses a real server server randomly according to the request target port and according to the scheduling algorithm, At this point in the request packet header in the sub-package layer frame, that is, the MAC address, the s
LVS topic: NAT and Dr Model for Web load Balancing
Objective:
in the previous article we talked about the basic concepts of LVS and the experimental principles and processes of the corresponding model, this article we mainly use lvs provide load balancing for Web services
NAT implements the experimental topology650) this.width=650; "src=" Http://www.178linux.com/ueditor/php/upload/image/20160405/1459866820924273.png "title
LVS-NAT LVS-DR model of Load Balancing
LVS is short for Linux Virtual Server. It is a Virtual Server cluster system that can define one or more backend servers. Worker s in the INPUT kernel.
LVS Scheduling Methods: 10Static Method: only scheduling based on the algorithm itselfRr: Round RobinWrr: Weighted RR Weight Round RobinSh: source hashing supports session binding Based on ip address anti-balancingDh: destination hashing is not used much according
As we all know, LVS cluster type has NAT, Dr and Tun, today wrote this article is mainly to see the Marco Video, and then through the form of blog to review their own remember how much, write bad, welcome to spray!DR: The cluster node and director must be in the same physical network;RIP can use the public network address, to achieve convenient remote management and monitoring;The Director is only responsib
Tags: case font nbsp linux iptables ignore style img ReadyLVS-DR model implements HTTP Load Balancing cluster, VIP and Dip/rip are not on the same network.No nonsense principle, a bunch of online piles. Directly on the topology and configuration scripts.The network topology is as follows:1.DR configuration script:1#!/bin/Bash2 #3 # dr Configuration Script4 5vip='
Tags: mysq. sh bootproto lvs-dr mode echo index role Pad TunLvs:linux Virtual ServerWhat is a cluster:A group of computing groups connected by a high-speed network, with a single system of modular-Style management? Centralize many servers together to provide the same serviceThe client looks like there's only one server? Can be achieved at a lower cost in the performance, reliability,Relatively high profitability in terms of flexibility? Task schedulin
Environment Introduction
Operating System: CentOS6.5 _ x64 miniLoad Balancing mode: DR (direct routing)Brief description of LVS and Keepalived:LVS is short for Linux Virtual Server, which is a Virtual Server cluster system. The cluster technology and Linux operating system are used to implement a high-performance and high-availability server with good scalability, reliability and management.The LVS cluster uses IP Server Load balancer technology and
Linux Virtual Server (LVS) was created by Zhangwensong during a PhD in national Defense Technology UniversityThe use of LVS enables highly available, scalable web, Mail, cache, and media networking services that are integrated into the Linux kernel.1. What is a cluster?Use a group of servers to provide the same service2. What is the purpose of using a cluster?Increase reliability, reduce costs, improve scalability, improve performance3. Cluster classification?HPC High Performance computing clust
Unlike NAT mode, The DR's Load Balancer Scheduler works on the data link layer in the Network Seven layer protocol, which is the second tier. It forwards the packet to the actual application server by modifying the destination MAC address of the packet, and Most importantly, the response packet of the actual server is returned directly to the client without having to go through the load scheduler1 , LVS , DR Introductionlvs Yes linux Virtual Server
The dr/bdr of OSPF is to elect in the same MA network (e.g. Ethernet), not all routers in a regionFollow the topology diagram above for an example:View OSPF on R8 two x dr/bdrR8#show IP OSR8#show IP OSPF NER8#show IP OSPF NeighborNeighbor ID Pri State Dead time Address Interface7.7.7.7 1 full/dr 00:00:32 120.0.0.7 FASTETHERNET0/110.10.10.10 1 full/bdr 00:00:32 12
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.