Pacemaker Load-balancing With Clone

Introducing the load-balancing feature with Pacemaker.

Pacemaker allows you to perform load-balancing mecanism thanks to the IPaddr2 resource agent. The point here is to set a virtual IP and make it available in an active/active mode with the help of pacemaker clone.

$ sudo crm configure primitive p_vip ocf:heartbeat:IPaddr2 \

params ip="172.17.1.100" cidr_netmask="24" nic="eth0" clusterip_hash="sourceip-sourceport" \

op start interval="0s" timeout="60s" \

op monitor interval="5s" timeout="20s" \

op stop interval="0s" timeout="60s" \

What about this clusterip_hash parameter? Specify the hashing algorithm used for the Cluster IP functionality. This parameter is optional by default and the default value is sourceip-sourceport. The CLUSTERIP target is used to create simple clusters of nodes answering to the same IP and MAC address in a round robin fashion.

Possible values:

  • sourceip

  • sourceip-sourceport
  • sourceip-sourceport-destport

This will create the following IPTABLES rule:

Chain INPUT (policy ACCEPT 27879 packets, 6604K bytes)

pkts bytes target prot opt in out source destination

0 0 CLUSTERIP all -- eth0 any anywhere 172.17.1.100 CLUSTERIP hashmode=sourceip clustermac=61:0E:45:64:50:A7 total_nodes=2 local_node=2 hash_init=0

The clustermac is automatically generated by the RA. If you want to learn more about the CLUSTERIP target read that link.

Set up your clone:

$ sudo crm configure clone clo_vip p_vip \

meta master-max="2" master-node-max="2" clone-max="2" clone-node-max="1" notify="true" interleave="true"

If you want to learn more about the interleave parameter look at the Hastexo article.

Test it, for this purpose you will need to ping the VIP from several client sources and each pacemaker node where the clone runs, execute the following command:

$ sudo tcpdump -i eth0 ‘icmp[icmptype] = icmp-echoreply‘

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

02:25:23.612684 IP 172.17.1.100 > 172.17.1.7: ICMP echo reply, id 1569, seq 1, length 64

02:25:24.611475 IP 172.17.1.100 > 172.17.1.7: ICMP echo reply, id 1569, seq 2, length 64

02:25:25.610417 IP 172.17.1.100 > 172.17.1.7: ICMP echo reply, id 1569, seq 3, length 64

Sometime this solution could be useful but at the end it doesn’t replace a ‘real’ load-balancer like LVS.

Interleaving in Pacemaker clones

Ever wonder what meta interleave really means in a Pacemaker clone definition? We‘ll explain.

The interleave meta attribute is only valid on Pacemaker clone definitions – and their extended version of sorts, master/slave sets. It‘s not available on primitives and groups. Clones are often used in configurations involving cluster filesystems, such as GFS2 (here‘s an example).

Consider the following example (primitive definitions omitted to keep this short):

clone cl_foo p_foo meta interleave=false

clone cl_bar p_bar meta interleave=false

order o_foo_before_bar inf: cl_foo cl_bar

What this means is for the order constraint to be fulfilled, all instances of cl_foo must start before any instance of cl_bar can. Often, that‘s not what you want.

In contrast, consider this:

clone cl_foo p_foo meta interleave=true

clone cl_bar p_bar meta interleave=true

order o_foo_before_bar inf: cl_foo cl_bar

Here, for each node, as soon as the local instance of cl_foo has started, the corresponding local instance of cl_bar can, too. This is what‘s usually desired – when in doubt, allow interleaving.

One thing that often throws people is that interleaving only works when Pacemaker is configured to run the same number of instances of two clones on the same node. Thus,

clone cl_foo p_foo\

meta interleave=true \

globally-unique=true clone-node-max=2

clone cl_bar p_bar meta interleave=false

order o_foo_before_bar inf: cl_foo cl_bar

... won‘t work, as Pacemaker is allowed to run 2 instances of cl_foo on the same node, but only one of cl_bar (the default for clone-node-max is 1).

Also, globally-unique=true is a requirement for any clone-node-max>1 – which means that interleaving between a globally-unique and a not globally-unique clone is also not supported.

Pacemaker Load-balancing With Clone,布布扣,bubuko.com

时间: 2024-10-18 08:52:00

Pacemaker Load-balancing With Clone的相关文章

Load Balancing 折半枚举大法好啊

Load Balancing 给出每个学生的学分.   将学生按学分分成四组,使得sigma (sumi-n/4)最小.         算法:   折半枚举 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <algorithm> 6 #include <string> 7 #include <

How Node.js Multiprocess Load Balancing Works

As of version 0.6.0 of node, load multiple process load balancing is available for node. The concept of forking and child processes isn't new to me. Yet, it wasn't obvious to me how this was implemented at first. It's quite easy to use however: var c

LVS Load Balancing Linux Virtual Server

简介:Linux虚拟服务器(Linux Virtual Server. LVS),是一个由章文松开发的自由软件.利用KVS可以实现高可用的.可伸缩缩的Web, Mail, Cache和Medial等网络股务..井在此基 础上开发支持庞大用户数的,可伸缩的,高可用的电子商务应用.LVS1998年发展到现在,已经变得比较成熟,目前广泛应用在各种网络服务和电了商务应用 中.LVS具有很好的伸缩缩性.可靠性和管埋性,通过LVS要实现的最终目标是:利用linux 操作系统和LVS集群软件实现一个高可用.高

linux集群系列(1) --- LVS之load balancing(NET、DR、TUN)

 一.简介     1.1.  负载均衡集群:LB (load balancing) 负载均衡集群为企业需求提供了更实用的系统.如名称所暗示的,该系统使负载可以在计算机集群中尽可能平均地分摊处理.该负载可能是需要均衡的应用程序处理负载或网络流量负载.这样的系统非常适合于运行同一组应用程序的大量用户.每个节点都可以处理一部分负载,并且可以在节点之间动态分配负载,以实现平衡.对于网络流量也是如此.通常,网络服务器应用程序接受了太多入网流量,以致无法迅速处理,这就需要将流量发送给在其它节点上运行的网络

How Network Load Balancing Technology Works--reference

http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balancing Terms and Definitions Network Load Balancing Architecture Network Load Balancing Protocols Application Compatibility with Network Load Balancing

Network Load Balancing Technical Overview--reference

http://technet.microsoft.com/en-us/library/bb742455.aspx Abstract Network Load Balancing, a clustering technology included in the Microsoft Windows 2000 Advanced Server and Datacenter Server operating systems, enhances the scalability and availabilit

【架构】How To Use HAProxy to Set Up MySQL Load Balancing

How To Use HAProxy to Set Up MySQL Load Balancing Dec  2, 2013 MySQL, Scaling, Server Optimization Ubuntu, Debian Prelude HAProxy is an open source software which can load balance HTTP and TCP servers. In the previous article on HAProxy we configured

Windows Server 2008配置Network Load Balancing(服务群集)

最近配置SharePoint 2013 WFE 时,客户提到要让多台WFE能load balance,于是研究了下Network Load Balancing. 当把一台服务器(包括Web服务器.FTP服务器或者流媒体服务器等等)放入网络中之后,随着客户端数量的不断增加,人们往往需要功能更强大.处理速度更快的服务器.为了解决这个问题,如果将原有的服务器替换成功能更强大.处理速度更快的服务器显然并不是值得称道的办法.但是如果能把新服务器添加到原有服务器的处理能力基础上而不是替换它,这种方案毫无疑问

Nginx Installation、Configuration、Rreverse Proxy、Load Balancing Learning

目录 1. Nginx简介 2. Nginx安装部署 3. Nginx安全配置 4. Nginx反向代理实践 5. Nginx负载均衡实践 1. Nginx简介 0x1: Nginx的基本特性 Nginx("engine x")是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器Nginx可以在大多数Unix like OS上编译运行,并有Windows移植版.它的的源代码使用2-clause BSD-like licenseNginx是一个很强大的高

hdu 2850 Load Balancing (优先队列 + 贪心)

题目大意: 怎么分配n个任务到m个服务器上使得负载尽量平衡. 思路: 将任务从大到小排序,依次放入负载最小的那个服务器中. 因为是spj 的缘故,所以可以使用这个贪心. 比如数据 6 2 7 5 3 3 3 3 就会得到错误答案. #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <queue> using namespac