LSX-blog

Feed Rss

【转载】WINDOWS2008网络负载平衡群集(NLB)完全攻略

03.17.2012, 系统, by .

这篇文章写得非常好,从NLB原理到实验过程都写得非常详细。在此感谢原作者。

1. 什么是群集?

群集是指一组服务器,通过彼此的协同作业,提供一个相同的服务或应用程序,用于提升服务或应用程序的可用性(availability)、可靠性(reliability)和可扩展性(scalability)。当群集内的服务器down掉以后,服务请求会转给其它群集内的节点,以实现24小时不中断的服务

2.Windows server 中的群集类型

Windows server 支持三种类型的群集,分别是NLB、CLB和MSCS。NLB与MSCS内置于windows server中,CLB需要购买Application Center

a) NLB:提供以TCP/IP 为基础的服务与应用程序的网络流量负载均衡,用于提升系统的可用性和可扩展性。常见的应用有Terminal Service、Web、VPN与FTP等。

b)  CLB:提供使用COM+组件的中介层应用程序的动态负载均衡,用于提升系统的可用性和延展性。CLB会依据目前的工作负载来决定由谁来处理服务请求。

c) MSCS:提供后端服务与应用程序的容错移转(failover),主要是提升系统的可用性。常见的应用有SQL Server与Exchange Server等。MSCS是由client来决定由谁来处理服务请求,所有服务器共享一个share storage来储存session状态。当主动服务器挂了,则继续由被动服务器接手。被动服务器会从share storage取出session状态,继续未完成的工作,以达到容错移转的目的

3. NLB的工作原理:

a)  图示:

128946871236

b) 节点A与节点B均有一个外部使用的静态IP地址,创建NLB群集时会产生一个虚拟的IP,该IP与节点的IP在同一个网段内,对外公布的 IP为虚拟的群集IP,而客户机所访问的实际上为节点A或者节点B。

4. WINDOWS2008下的NLB配置:

a)NLB配置的环境要求:

i.  网卡:所有网卡必须与WINDOWS2008兼容,单网卡或多网卡均可配置该服务,推荐使用多网卡。

ii. 网络模式:工作组和域环境均可完成,在2008中最多可以支持32个节点。

iii.  交换机和路由器要求:交换机必须支持VLAN,有些交换机和路由器有可能需要手工设置多播MAC地址。

iv. 通讯协议:绑定到群集的网络适配器只能安装TCP/IP协议,必须静态分配,不支持DHCP。

v.  应用程序的要求:必须是TCP或UDP通讯,而且确定当前应用程序或服务必须支持NLB。

b) 实验拓朴图:

两台windows 2008 entprise edition 双网卡服务器

128946871582

c)实验步骤:

i.搭建网络并测试网络连通性(按图示上的网络配置)

ii.  在两个节点上分别安装WEB服务并设置不同的html文档,方便检测实验效果:

128946888032

128946889058

iii. 安装网络负载平衡管理工具

128946889861

iv. 输入NLBMGR打开NLB管理器—群集—新建—输入当前节点A的主机名:128946890158

v.  点击”连接”后选择用于配置群集的网络接口。

128946924558

vi.  添加群集虚拟IP

128946924736

vii.  设置FQDN,选择群集操作模式(推荐使用双网卡单播模式)

单播:单播模式是指各节点的网络适配器被重新指定了一个虚拟MAC(由02-bf和群集IP 地址组成确保此MAC的唯一性)。由于所有绑定群集的网络适配器的MAC都相同,所以在单网卡的情况下,各节点之间是不能通讯的,这也是推荐双网卡配置的原因之一。为了避免交换机的数据洪水,应该结合VLAN使用。

多播:网络适配器在保留原有的MAC地址不变的同时,还分配了一个各节点共享的多播MAC地址。所以,即使单网卡的节点之间也可以正常通讯,但是大多数路由和交换机对其支持不是太好。

IGMP多播:IGMP多播(只有在选中多播时,才可以选择此项),在继承多播的优点之外,NLB每隔60秒发送一次IGMP信息,使多播数据包只能发送到这个正确的交换机端口,避免了交换机数据洪水的产生。

128946927262

viii.  配置端口规则后确定并等待聚合完成:

128946932388

群集IP地址:指定规则所针对的群集IP

端口范围:默认为所有,可以指定群集监听的端口范围(如从80到80,表示只针对web服务实现负载均衡)

协议:指定群集所服务的协议类型

筛选模式:a:多个主机:

     无相似性: 客户端的服务请求会平均分配到群集内的每一部服务器。假设NLB群集内有2部服务器。当接到客户端的请求时,NLB会将第1个请求交由第1部服务器来处理,第2个请求交由第2部服务器来处理,第3个请求交由第1部服务器来处理,…依此类推。因为所有客户端联机会平均分配到每一部服务器,因此可以达到最佳的负载平衡。如果需要执行交易处理,为了能够共享session状态,则必须将session状态集中储存在state或database server中,这种方式适用于大部分的应用程序。

     单一相似性:客户机的服务请求会固定分配到群集内的某一部服务器。当接到客户机的请求时,NLB会根据客户机的IP来决定交由哪一部服务器来处理,也就是一部服务器只会处理来自某些IP的请求。因为一个IP的服务请求只会固定由一个服务器来处理,因此没有 session状态共享的问题,但可能会导致负载不平衡。这种方式适用于联机需支持 SSL 集多重联机的通讯协议 ( 例如FTP与PPTP等)

      网络(类C):根据IP的Class C屏蔽来决定交由哪一部服务器来处理,也就是一部服务器只会处理来自某些网段C的请求。这种方式可确保使用多重 Proxy 的客户端能导向到相同的服务器。

    b.单一主机:若选择此选项,该端口范围内的所有请求都将由一台主机来进行处理,此选项将配合后面的主机优先级来进行主机判定。

    c. 禁用此端口范围:一般这个选项会在端口例外中进行设置,也就是说,当我们指定了一个比较大的范围端口时,其中有一个或几个端口我们不需要 客户端用户访问到,这时我们将利用这个规则来进行设定,防止用户访问此端口请求。  

ix. 聚合完成后在第二个节点上连接到已经创建好的群集

128946932579

x. 将第二个节点加入到现存群集

128946934397

xi.  聚合完成后通过群集ip可访问WEB站点

128946934530

xii.  断开节点A的网络连接后,自动切换到节点B

128946959316

     至此所有操作完成,特别注意:在生产环境中使用除非你确定你们公司的路由器支持多播模式,否则请最好使用双网卡单播模式,并在路由上对ARP表做手动设置,否则可能会出现跨网段无法访问群集ip的错误。

【转载】WINDOWS2008网络负载平衡群集(NLB)完全攻略 有 666 条回应

  1. I’m really enjoying the theme/design of your website.
    Do you ever run into any browser compatibility issues?
    A handful of my blog readers have complained about my site not working
    correctly in Explorer but looks great in Chrome. Do you have any solutions to help fix this issue?

    回复
  2. I loved as much as you will receive carried out right here.

    The sketch is tasteful, your authored material stylish.
    nonetheless, you command get bought an shakiness over that you wish be delivering the following.
    unwell unquestionably come more formerly again since exactly the same
    nearly very often inside case you shield this hike.

    回复
  3. This is the perfect webpage for anybody who really wants to find out about this topic.
    You realize so much its almost hard to argue with you (not that
    I really will need to…HaHa). You definitely put a brand new spin on a topic that has
    been discussed for decades. Great stuff, just excellent!

    回复
  4. Hi there, after reading this remarkable post i am
    also happy to share my experience here with friends.

    回复
  5. Hmm is anyone else encountering problems with the images on this blog loading?
    I’m trying to figure out if its a problem on my end or if it’s
    the blog. Any suggestions would be greatly appreciated.

    回复
  6. You ccan definitely see your skills in thee work
    you write. The sector hopes for more passionate writers such
    as you who aren’t afraid to mention how they believe.
    Always follow your heart.
    web site betting odds

    回复
  7. Your method of explaining the whole thing in this article is really good, every one be capable of without difficulty be aware of it, Thanks a lot.

    回复
  8. Hi there to all, the contents present at this web page
    are really remarkable for people experience, well, keep up the nice work fellows.

    回复
  9. Fastidious replies in return of this issue with solid arguments and describing the whole thing
    concerning that.

    回复
  10. Post writing is also a excitement, if you know after that
    you can write or else it is difficult to write.

    回复
  11. This is really attention-grabbing, You are an overly skilled blogger.

    I’ve joined your rss feed and look ahead
    to in the hunt for extra of your great post. Also, I’ve shared
    your site in my social networks

    回复
  12. JP11:20
    BIG SEXY LIVE CHAT FOR
    Hip-hop is going more

    回复
  13. Hello There. I discovered your blog using msn. This is a very well written article.
    I’ll make sure to bookmark it and come back to learn more of your helpful information. Thank you for the
    post. I will certainly comeback.

    回复
  14. I got this site from my friend who told me concerning this web site and now this time I am browsing this site and reading
    very informative posts at this place.

    回复
  15. I think the admin of this site is actually working hard in support
    of his web site, since here every data is quality based information.

    回复
  16. Hey there I am so happy I found your blog page, I really
    found you by error, while I was browsing on Askjeeve for something else, Anyways I am here now and would just like
    to say many thanks for a remarkable post and a all
    round interesting blog (I also love the theme/design), I don’t have time to go through
    it all at the moment but I have book-marked it and also added in your
    RSS feeds, so when I have time I will be back to read more, Please do keep
    up the excellent jo.

    回复
  17. Hi there superb blog! Does running a blog like this take a lot of work?
    I have very little expertise in computer programming but I was hoping to start my own blog soon.
    Anyways, should you have any suggestions or tips for new blog owners
    please share. I understand this is off subject however I just had to
    ask. Thanks!

    回复
  18. Do you mind if I quote a few of your articles as long as I provide credit
    and sources back to your weblog? My website is in the exact same niche as yours and my visitors would really benefit from some
    of the information you present here. Please let me know if this
    alright with you. Regards!

    回复
  19. สุดยอดไปอีกค้ะเจ๊ #เจ๊บิว สายเปย์

    回复
  20. Le yoga nous information dans notre relation à la spiruline et à la création des produits.

    回复
  21. whoah this blog is magnificent i really like studying your
    posts. Keep up the good work! You understand,
    lots of persons are looking round for this info, you can help them greatly.

    回复
  22. I do accept as true with all the ideas you have presented for your post.

    They are really convincing and can definitely work. Still, the posts are
    too quick for newbies. May you please extend them
    a bit from next time? Thank you for the post.

    回复
  23. Oh my goodness! Awesome article dude! Thanks, However I am having difficulties with your RSS.
    I don’t understand the reason why I am unable to join it.
    Is there anyone else having the same RSS issues? Anybody who knows
    the solution cann you kindly respond?Thanks!!
    Poker online games poker ruless (icr-amu.cnrs.fr) poker online for real
    money

    回复
  24. Hi there superb blog! Does running a blog like this require a lot of work?
    I’ve absolutely no knowledge of computer programming however I had been hoping
    to start my own blog in the near future. Anyhow, should you have any ideas
    or tips for new blog owners please share. I know this is off
    subject but I just had to ask. Thanks!

    回复
  25. You actually make it seem so easy along with your presentation however I find this matter to
    be actually one thing that I believe I might by no means understand.
    It seems too complicated and extremely huge for
    me. I’m having a look forward on your subsequent publish, I will attempt to get the grasp of it!

    回复
  26. Magnificent beat ! I would like to apprentice whilst you amend your website, how could i subscribe for a weblog website?
    The account aided me a appropriate deal. I were a little bit familiar of this your broadcast provided brilliant
    clear idea.

    回复
  27. Woah! I’m really enjoying the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between usability and visual appeal.

    I must say you have done a fantastic job with this.

    In addition, the blog loads extremely fast for me
    on Chrome. Outstanding Blog!

    回复
  28. I know this web site gives quality dependent articles
    and extra stuff, is there any other website which offers such things in quality?

    回复
  29. Agen Judi Tembak Ikan Online Terpercaya Indonesia.

    Minimal deposit 15ribu Rupiah dan dapatkan Bonus member baru 100%.
    Komisi Mingguan Tertinggi. Proses pembayaran dan withdraw
    cepat.
    Menerima deposit melalui 6 bank besar di indonesia
    yaitu Bca,Mandiri,Bri,Bni,Cimb dan Danamon.

    回复
  30. Hmm it seems like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still new
    to the whole thing. Do you have any helpful hints for newbie blog writers?

    I’d genuinely appreciate it.

    回复
  31. This post is truly a fastidious one it helps new web users, who are
    wishing in favor of blogging.

    回复
  32. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

    You obviously know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something enlightening to
    read?

    回复
  33. Thanks for the auspicious writeup. It in fact used to be a amusement account it.
    Look complicated to far added agreeable from you!
    However, how can we communicate?

    回复
  34. Hi there, just became aware of your blog through Google, and found that it is really informative.
    I’m gonna watch out for brussels. I’ll appreciate if you continue this in future.
    Numerous people will be benefited from your writing.
    Cheers!

    回复
  35. you’re in point of fact a excellent webmaster. The website loading velocity is incredible.
    It kind of feels that you are doing any distinctive trick.
    Moreover, The contdnts are masterpiece.you have performed a magnificent job on thhis subject!

    webpage parimacht

    回复
  36. She’s in Naija…idk if that’s a strip club she’s at- ala the girls are twerking, some totally nude.
    Let me explain privately cos wow

    回复
  37. I think that what you said was actually very logical.
    However, what about this? suppose you were to write a killer post title?

    I mean, I don’t wish to tell you how to run your blog,
    however suppose you added something that grabbed a person’s attention? I mean 【转载】WINDOWS2008网络负载平衡群集(NLB)完全攻略 – LSX-blog is a little plain. You could look at Yahoo’s home page and note how they create news titles
    to get people to open the links. You might add
    a related video or a related picture or two to get people excited about everything’ve written. Just my opinion, it would bring your posts a little
    livelier.

    回复
  38. After exploring a handful of the articles on your blog,
    I seriously appreciate your technique of writing a blog. I added it
    to my bookmark site list and will be checking back
    soon. Take a look at my web site as well and tell me what you think.

    回复
  39. Oh my goodness! Incredible article dude! Thank you, However I am
    having difficulties with your RSS. I don’t understand the reason why
    I cannot join it. Is there anybody getting similar RSS problems?
    Anyone that knows the answer will you kindly respond?
    Thanx!!

    回复
  40. we have products that can help with deabeties athritis
    asma deprestion,and lots more so have a look no oblegation 80 day trial and 60 day money
    back garaouty

    回复
  41. Amazing! Its in fact awesome piece of writing, I have got much clear idea about
    from this piece of writing.

    回复
  42. I am really grateful to the holder of this website who has
    shared this enormous paragraph at at this time.

    回复
  43. Howdy just wanted to give you a quick heads up and let
    you know a few of the images aren’t loading correctly.

    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and both show the
    same results.

    回复
  44. Fastidious respond in return of this query with solid arguments and telling the whole thing on the topic of that.

    回复
  45. My brother suggested I might like this web site.
    He was entirely right. This post actually made my day. You can not imagine just how much
    time I had spent for this info! Thanks!

    回复
  46. I visited many websites but the audio quality
    for audio songs present at this web page is in fact superb.

    回复
  47. Hiya! Quick question that’s entirely off topic. Do you know
    how to make your site mobile friendly? My web site looks weird
    when browsing from my iphone. I’m trying
    to find a template or plugin that might be able to
    correct this issue. If you have any recommendations, please
    share. Cheers!

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注