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)完全攻略 有 1,440 条回应

  1. You’ve made some really good points there.

    I checked on the net for more information about the issue and found most people will go along with your views on this site.

    回复
  2. the wifi in my house isnt working its 1am i am trying to watch porn i might genuinely start crying i need wifi or
    i will die

    回复
  3. Since the admin of this web site is working, no doubt very shortly it will be renowned, due to its quality contents.

    回复
  4. I just like the helpful information you supply
    in your articles. I’ll bookmark your blog and test again right here frequently.
    I am moderately sure I will be informed a lot of new stuff right here!
    Best of luck for the following!

    回复
  5. Pretty! This has been an incredibly wonderful post.

    Thanks for supplying this info.

    回复
  6. I read this article completely concerning the difference of
    latest and previous technologies, it’s awesome article.

    回复
  7. It is not my first time to pay a visit this site, i am visiting this web page
    dailly and take nice data from here everyday.

    回复
  8. Link exchange is nothing else except it is just placing
    the other person’s website link on your page at suitable place and
    other person will also do similar for you.

    回复
  9. Admiring the time and effort you put into your site and in depth information you present.
    It’s nice to come across a blog every once in a while that isn’t the same unwanted rehashed material.
    Fantastic read! I’ve saved your site and I’m adding your RSS feeds to my
    Google account.

    回复
  10. Thank you a lot for sharing this with all of us you actually know what you’re
    talking approximately! Bookmarked. Kindly additionally consult with my website =).
    We could have a hyperlink change contract among us

    回复
  11. Hi there, I think your website might be having internet browser compatibility issues.
    When I take a look at your site in Safari, it looks fine
    however, if opening in IE, it has some overlapping issues.
    I merely wanted to give you a quick heads up! Other than that,
    excellent site!

    回复
  12. With havin so much content do you ever run into any issues of plagorism
    or copyright infringement? My website has a lot of unique content
    I’ve either authored myself or outsourced but it seems a lot
    of it is popping it up all over the internet without my authorization. Do
    you know any solutions to help prevent content from being stolen?
    I’d really appreciate it.

    回复
  13. Great website. A lot of helpful info here.
    I’m sending it to several pals ans also sharing in delicious.
    And certainly, thank you on your sweat!

    回复
  14. I am not sure where you are getting your information, but great topic.
    I needs to spend some time learning more or understanding
    more. Thanks for wonderful information I was looking for this info for my
    mission.

    回复
  15. Have you ever thought about adding a little bit more than just your articles?
    I mean, what you say is important and all. Nevertheless just imagine if you added some great
    images or video clips to give your posts more, “pop”!
    Your content is excellent but with pics and video clips, this blog
    could definitely be one of the greatest in its field.

    Excellent blog!

    回复
  16. I conceive other website proprietors should take this site as an model,
    very clean and fantastic user genial layout.

    回复
  17. Hey! Someone in my Myspace group shared this website with us so I came to give it a look.

    I’m definitely loving the information. I’m bookmarking and
    will be tweeting this to my followers! Exceptional blog and
    fantastic design and style.

    回复
  18. I like reading through an article that will make men and women think.
    Also, thank you for allowing for me to comment!

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

    You definitely know what youre talking about, why throw away your intelligence on just posting videos to
    your weblog when you could be giving us something enlightening to
    read?

    回复
  20. We are a group of volunteers and opening a new scheme in our community.
    Your web site offered us with valuable information to
    work on. You’ve done a formidable job and our whole community will be
    thankful to you.

    回复
  21. I was suggested this website by my cousin. I am not sure whether
    this post is written by him as nobody else know such detailed about my trouble.
    You are amazing! Thanks!

    回复
  22. Thanks , I’ve recently been searching for info approximately this topic for
    a long time and yours is the best I have discovered till now.
    But, what concerning the conclusion? Are you certain in regards to the supply?

    回复
  23. Great article! We will be linking to this great article on our site. Keep up the good writing.

    回复
  24. I’m truly enjoying the design aand layout of your website.
    It’s a very easy on the eyers which makes iit much moore pleasant for me to come
    here and visit more often. Didd you hire out a developer to create
    yor theme? Great work!

    回复
  25. It’s remarkable to pay a quick visit this website and reading the views of all mates regarding this paragraph, while I am also eager of getting know-how.

    回复
  26. What’s Happening i’m new to this, I stumbled upon this I have
    discovered It absolutely useful and it has helped me out loads.
    I am hoping to give a contribution & assist different users like its
    aided me. Good job.

    回复
  27. Great blog! Is your theme custom made or did you download it from
    somewhere? A theme like yours with a few simple tweeks would really make my blog jump
    out. Please let me know where you got your
    theme. With thanks

    回复
  28. It also was common for these teens to use the apps to connect with friends and
    find new gay, bisexual and queer friends and boyfriends, which
    sheds new light on who uses adult male hookup apps and why.
    One of my good friends who was a teacher said that Chelsea was her favorite
    pupil, polite, courteous and intellectual. Teenage boys who used the apps were more likely seek
    out important sexual health services, such as HIV testing, the study
    found. And it’s not illegal to seek asylum. However, unlike other so-called free sex cams, we
    don’t request your credit card or MasterCard details and even an e-mail address.
    However, young men who have sex with men are far more likely than other groups to be infected with
    HIV, and the study found that most boys who had had sex with partners they met
    on the apps didn’t always use condoms. It is the first known study to document that gay and
    bisexual teenage boys use sex and dating apps designed for adult men to
    find male partners. These features might be appealing to gay and bisexual adolescent
    boys who are not as open about their sexual identity, who have a smaller
    pool of potential partners compared to their heterosexual peers and who
    are navigating dating and sex with same-gender partners for the first
    time.

    回复
  29. Very soon this site will be famous amid all blogging and site-building visitors, due
    to it’s good posts

    回复
  30. Thank you for the auspicious writeup. It in fact was a
    entertainment account it. Look complicated to more introduced agreeable
    from you! However, how can we keep up a correspondence?

    回复
  31. Hi, i think that i saw you visited my weblog thus i came to “return the favor”.I am attempting to find things
    to improve my web site!I suppose its ok to use some of your ideas!!

    回复
  32. Hello to all, how is everything, I think every one is getting
    more from this web site, and your views are pleasant for new viewers.

    回复
  33. WOW just what I was searching for. Came here by searching
    for NLB

    回复
  34. Wonderful blog! Do you have any hints for aspiring writers?

    I’m hoping to start my own website soon but I’m a little lost on everything.
    Would you suggest starting with a free platform like WordPress or go
    for a paid option? There are so many choices out there
    that I’m completely overwhelmed .. Any suggestions?
    Bless you!

    回复
  35. Best view i have seen for long time !

    回复
  36. If you’re finding the Christmas season hard and you need to chat
    then our friends at @macmillancancer are there for you.

    Or if you want to talk to other young adults living with & beyond cancer, join our online community:

    CancerCommunity …

    回复
  37. Wow! In the end I got a web site from where I know how to genuinely take useful data regarding my
    study and knowledge.

    回复
  38. It’s perfect time to make some plans for the future and it is time to
    be happy. I’ve read this post and if I could I want to suggest you few interesting things or suggestions.
    Maybe you can write next articles referring to this article.
    I desire to read more things about it!

    回复
  39. Thanks for any other informative blog. Where else could
    I am getting that kind of info written in such a perfect means?
    I have a venture that I’m just now operating on, and I’ve been on the look out for such information.

    回复

pure kona red coffee k cups进行回复 取消回复

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