0215lvs基础
Cluster集群提高性能的两种途径:
scale on升级硬件
scale out增加多台服务器
LB-Load Balance负载均衡集群
HA-High Availability高可用集群 (共享存储,nfs|raid设备可以提供)
HP-High Performance高性能集群
Director
Dispatcher
分发器
四层交换(IP:port) LVS
张文嵩设计
七层交换(squid,proxy)
ipables/netfilter
LVS:Linux Virtual Server
ipvsadm/ipvs
LVS-NAT network address translation
LVS-DR direct routing
LVS-TUN IP tunneling
LVS-NAT
RIP网关指向DIP
要求DIP-VIP同一网段
VIP用默认端口,其他IP端口随意
LVS-DR
要求DIP-VIP同一网段
LVS-RUN
不要求DIP-VIP同一网段
RIP一定不能用私有地址
Director只处理进来的数据
只有支持隧道的系统才可以作为real server
LVS 十种转发算法
Fixed scheduling methords:静态
Round-robin (RR)轮调
Weighted round-robin (WRR)加权,分配权重
Destination hashing (DH)目标散列
Source hashing (SH)
Dynamic scheduling methords:动态
Least-connection (LC) active乘以256+inactive
Weigted least-connection (WLC) (active乘以256+inactive)/权重
Shortest expecteddelay(SED) 【(active+1)乘以256】/权重
Never queue (NQ)
Locality-based least-connection (LBLC) 动态的DH
Locality-based least-connection with(LBLCR)
怎样实现脚本写的服务开机启动?
#/bin/bash
#
case $1 in
start)
ipvsadm -A -t 192.168.0.10:80 -s wlc
ipvsadm -a -t 192.168.0.10:80 -r 192.168.1.7 -m -w 2
ipvsadm -a -t 192.168.0.10:80 -r 192.168.1.8 -m -w 5
;;
stop)
ipvsadm -C ;;
status)
ipvsadm -Ln ;;
esac
-s, --scheduler scheduling-method
-m--->NET
-g--->DR
-i--->TUN
-g,--gatewaying
-i,--ipip
-m,--masquerading
ipvsadm -S >> /etc/sys
开源软件
heartbeat,keepalived,ultramonkey,openais/corosync
RHCS:redhat cluster suite , (openais/corosync)
pacemaker作为资源管理器
方法:
heartbeat v1
/etc/init.d/httpd
cluster filesystem ()
ocfs2,gfs2
故障转移域
quorum
heartbeat
页:
[1]