免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: yuhongchun
打印 上一主题 下一主题

[讨论]论DRBD+Heartbeat+MySQL在生产环境下的可实施性(获奖名单已公布-2012-7-13) [复制链接]

论坛徽章:
0
41 [报告]
发表于 2012-06-05 10:12 |只看该作者
本帖最后由 root_wxt 于 2012-06-05 10:15 编辑

既然drbd设备的速度下降到40M/s,改用10G的网络环境应该会得到提升,可惜没有10G的网络环境,无法测试,所以很自然的想到了bonding,于是我在vbox1和vbox2的Dom0主机上各增加一块千兆网卡,采用active-backup模式,效果很好,随机关闭eth0或eth1系统不间断运行,此模式表现良好,提高可靠性可以采用此模式,但我想倍增网络带宽,可惜的是采用其它几种模式都不能达到增加带宽的目的,速度不是等于active-bakup,就是低于它(模式4要交换机支持,未测试)。很晕,bonding高手,现身说个法?以下是基本安装记录:
图乱了,图大家可以参考:http://wiki.xen.org/wiki/Xen_Networking
Xen Networking with bonding for Debian Squeeze setting

              PRT0 PRT1                       PRT2 PRT3
                |   |                           |   |
+--------------+---+---------------------------+---+--------------+
|              |   |                           |   |              |
|            eth0 eth1                       eth2 eth3            |
|              |   |                           |   |              |
|              +-+-+                           +-+-+              |
|                |                               |                |
| +--------------+--------------+ +--------------+--------------+ |
| |              |              | |              |              | |
| |            bond0            | |            bond1            | |
| |                             | |                             | |
| | xenbr0       vif1.0  vif1.1 | |  vif2.0  vif2.1      xenbr1 | |
| |                |       \    | |    /       |                | |
| +---^------------+---------\--+ +--/---------+------------^---+ |
|     |            |           \   /           |            |     |
|     |     +------+-------------X-------------+------+     |     |
|     |     |      |           /   \           |      |     |     |
|     |     | +----+---------/--+ +--\---------+----+ |     |     |
|     |     | |    |       /    | |    \       |    | |     |     |
|     |     | |  eth0    eth1   | |   eth0   eth1   | |     |     |
|     |     | |    |       |    | |    |       |    | |     |     |
|   +-+-+   | |  +-+-+   +-+-+  | |  +-+-+   +-+-+  | |   +-+-+   |
|   |   |   | |  |   |   |   |  | |  |   |   |   |  | |   |   |   |
|  www ssh  | | www ssh ftp pop | | www ssh ftp pop | |  ftp pop  |
|           | |                 | |                 | |           |
|  Domain0  | |     Domain1     | |     Domain2     | |  Domain0  |
+-----------+ +-----------------+ +-----------------+ +-----------+
# apt-get install ifenslave-2.6

配置网卡
bonding采用active-backup模式
修改/etc/network/interfaces
auto bond0
iface bond0 inet static
        address 192.168.1.15
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bond-mode active-backup
        bond_miimon 100
        bond_downdelay 200
        bond_updelay 200
        slaves eth0 eth1
auto xenbr0
iface xenbr0 inet static
        bridge_ports bond0
        address 192.168.1.15
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 61.177.7.1
# service networking restart
配置/etc/xen/xend-config.sxp
注释掉(network-script network-bridge),不允许系统自动桥接,否则系统会冲突
PV DomU的网卡配置
vif = ['vifname=mail,ip=192.168.1.21,bridge=xenbr0']

以下是bonding的几种模式,一并列出来,供参考
mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)  

One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn’t require special switch support

mode=2 (balance-xor)  

Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance.

mode=3 (broadcast)  

Transmits everything on all slave interfaces. Provides fault tolerance.

mode=4 (802.3ad)  

This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave.

mode=5 (balance-tlb)  

Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support

mode=6 (balance-alb)  

Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open.

论坛徽章:
0
42 [报告]
发表于 2012-06-05 10:32 |只看该作者
回复 36# xiaogui_vip


    个人觉得将备机部署一个应用利用起来,或者使用工具使mysq读写分离也是可行的,就是维护人员多了点项目

论坛徽章:
0
43 [报告]
发表于 2012-06-05 10:44 |只看该作者
最近也在上mysql的HA:
我就准备用heartbeat+slave来完成,不做DRBD!感觉DRBD有点麻烦!!
两台有服务器(hba卡+suse 10 sp2)---光交机---san存储来实现---再外加一台slave来完成!!!!

论坛徽章:
0
44 [报告]
发表于 2012-06-05 10:47 |只看该作者
zhuningwll 发表于 2012-06-05 10:44
最近也在上mysql的HA:
我就准备用heartbeat+slave来完成,不做DRBD!感觉DRBD有点麻烦!!
两台有服务器(hba ...

环境太好了,我要是有这个环境,不吃不睡,开足马力测试,呵呵呵

论坛徽章:
0
45 [报告]
发表于 2012-06-05 11:02 |只看该作者
root_wxt 发表于 2012-06-05 10:47
环境太好了,我要是有这个环境,不吃不睡,开足马力测试,呵呵呵

设备已经在采购中,6月底开始正式上线测试!现在用两台普通的台式机测试过,暂没有有问题!

论坛徽章:
0
46 [报告]
发表于 2012-06-05 11:07 |只看该作者
zhuningwll 发表于 2012-06-05 11:02
设备已经在采购中,6月底开始正式上线测试!现在用两台普通的台式机测试过,暂没有有问题!

测试系统的布署日记能否share出来 ?:wink:

论坛徽章:
0
47 [报告]
发表于 2012-06-05 11:13 |只看该作者
root_wxt 发表于 2012-06-05 11:07
测试系统的布署日记能否share出来 ?

你是说架构!?

论坛徽章:
0
48 [报告]
发表于 2012-06-05 11:34 |只看该作者
zhuningwll 发表于 2012-06-05 11:13
你是说架构!?

越详细越好,呵呵

论坛徽章:
0
49 [报告]
发表于 2012-06-05 12:13 |只看该作者
root_wxt 发表于 2012-06-05 11:34
越详细越好,呵呵

我的架构中一共会运行三个服务apache  samba  mysql都是通过suse 10 sp2中自带的heartbeat来实现HA,其中物理的连接方式为:
1.两台服务器通过hba卡来连接(目前用单hba卡,今后可能会用双hba卡来实现更可靠的ha)---光纤交机机(两台光纤交换机)---连接san存储(双控制器),服务器共有4块网卡,2块做bonding,2块来做心跳(减少脑裂)
2.将服务器一台设置成apache+samba的master,另一台设置成为mysql的master。当中任何一台服务器down机后,通过heartbeat来实现HA!
3.所过用到的存储在系统中设置成为lvm
4.外挂第三台服务器,通过rsync来镜像apache+samba的数据,通过主--从来同步mysql的数据!

计划是这样的!!!!

论坛徽章:
0
50 [报告]
发表于 2012-06-05 12:24 |只看该作者
zhuningwll 发表于 2012-06-05 12:13
我的架构中一共会运行三个服务apache  samba  mysql都是通过suse 10 sp2中自带的heartbeat来实现HA,其中物 ...

真奢华啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP