Windows 2003上网络负载均衡的实现

以前一直研究的都是基于Linux/FreeBSD下的负载均衡架构,在我另外一篇负载均衡文章里面专门提到过相关的内容,今天无意中看到一篇文章谈到在window 2003 server上实现负载均衡,这还是第一次看到,实现的方式类似Linux的LVS软件方式,之前在Windows 2000和XP中都没有类似的功能,感觉挺有意思,搜集过来大家分享。

[原文如下]

在现行的许多网络应用中,有时一台服务器往往不能满足客户端的要求,此时只能通过增加服务器来解决问题。
  那么,有没有一个办法或者技术来解决此类问题呢?使用Windows 2000或Windows Server 2003中的网络负载平衡群集就可以(本文将介绍Windows Server 2003中的网络负载平衡技术的实现方法)。

  一、网络负载平衡的优点

  1.网络负载平衡允许你将传入的请求传播到最多达32台的服务器上,即可以使用最多32台服务器共同分担对外的网络请求服务。网络负载平衡技术保证即使是在负载很重的情况下它们也能作出快速响应。

  2.网络负载平衡对外只须提供一个IP地址(或域名)。

  3.如果网络负载平衡中的一台或几台服务器不可用时,服务不会中断。网络负载平衡自动检测到服务器不可用时,能够迅速在剩余的服务器中重新指派客户机通讯。此保护措施能够帮助你为关键的业务程序提供不中断的服务。可以根据网络访问量的增多来增加网络负载平衡服务器的数量。

  4.网络负载平衡可在普通的计算机上实现。

  在Windows Server 2003中,网络负载平衡的应用程序包括Internet信息服务(IIS)、ISA Server 2000防火墙与代理服务器、VPN虚拟专用网、终端服务器、Windows Media Services(Windows视频点播、视频广播)等服务。同时,网络负载平衡有助于改善你的服务器性能和可伸缩性,以满足不断增长的基于Internet客户端的需求。

  网络负载平衡可以让客户端用一个逻辑Internet名称和虚拟IP地址(又称群集IP地址)访问群集,同时保留每台计算机各自的名称。

  下面,我们将在两台安装Windows Server 2003的普通计算机上,介绍网络负载平衡的实现及应用。

这两台计算机中,一台计算机名称为w2003-1,IP地址为202.206.197.190,另一台名为w2003-2,IP地址为202.206.197.191。

  规划网络负载平衡群集使用的IP地址为202.206.197.195,规划网络负载平衡群集完整的计算机名称为cluster.heinfo.edu.cn。你需要在heinfo.edu.cn域中注册此主机名称并将地址设置为202.206.197.195。如果你没有DNS,可以在需要访问网络负载平衡的客户机(包括网络负载平衡主机)上编辑%systemroot%system32driversetc目录下的hosts文件,添加一条信息“202.206.197.195 cluster.heinfo.edu.cn”,即可解决DNS域名解析的问题。

  当正式应用时,客户机只需要使用cluster.heinfo.edu.cn或IP地址202.206.197.195来访问服务器,网络服务平衡会根据每台服务器的负载情况自动选择202.206.197.190或者202.206.197.191对外提供服务。

  网络负载平衡的实现过程如下:

  在实现网络负载平衡的每一台计算机上,只能安装TCP/IP协议,不要安装任何其他的协议(如IPX协议或者NetBEUI协议),在网络属性中,“网络负载平衡”也不能被选择,这可以从“网络连接属性”中查看。

  ①先进入第一台计算机,以管理员身份登录,从“管理工具”中运行“网络负载平衡管理器”,用鼠标右键单击“网络负载平衡群集”,从出现的菜单中选择“新建群集”,进入“群集参数”界面(图1)。

win2003_lvs1
图1

  在“IP地址”后面输入规划的群集参数地址202.206.197.195,在子网掩码处使用默认值,在“完整Internet名称”后面输入cluster.heinfo.edu.cn(也可以是其他的名称,但输入的DNS名称必须与输入的IP地址相符)。

  如果允许远程控制,请选中“允许远程控制”,并在“远程密码”和“确认密码”处输入可以进行远程控制的密码。
②点击“下一步”按钮,进入群集IP地址页面后再进入“端口规则”界面,点击“下一步”按钮,进入“连接”界面(图2)。

win2003_lvs2
图2

  ③在“连接”界面的“主机”栏中输入当前计算机的名称w2003-1,然后点击“连接”按钮,将在“对配置一个新的群集可用的接口”框中显示出连接的计算机的网卡及IP地址。选择与群集IP地址同一网段的地址(用于对外提供网络应用的网卡),然后点击“下一步”按钮,进入设置“主机参数”界面,点击“完成”按钮,系统将自动开始网络负载平衡群集的配置。几分钟后,网络负载平衡群集配置完成。

  ④打开第二台计算机,并以管理员的身份登录进入。

  注意:在网络负载平衡中的每个节点上,管理员账号的用户名和密码最好一致。

  ⑤然后,在第一台计算机上,用鼠标右键单击新创建的群集,从出现的菜单中选择“添加主机到群集”。将出现“连接”界面,在“主机”中输入第二台计算机的计算机名称,点击“连接”按钮,将会在“对配置群集可用的接口”下面显示出连接的计算机上的网络配置。选择202.206.197.191的网卡,进入主机参数界面,点击“完成”按钮,即可返回网络负载平衡管理器(图3)。

win2003_lvs3
图3

  ⑥关闭网络负载平衡管理器后再进入网络负载平衡管理器。用鼠标右键单击“网络负载平衡群集”,从出现的菜单中选择“连接到现存的”,将会弹出“连接”界面。

  输入第一台计算机的名称,点击“连接”按钮,在“群集”下面将列出群集的IP地址,选择此IP地址,并点击“完成”按钮,连接群集即可完成。

  以后,如果这两台服务器不能满足需求,可以按以上步骤添加第3台、第4台计算机到网络负载平衡中以满足要求。
三、用IIS服务验证网络负载平衡

  网络负载平衡配置好后,为了实现某项具体的服务,需要在网络负载平衡的计算机上安装相应的服务。例如:为了实现IIS网站的负载平衡,需要在相应的网络负载平衡的计算机上安装IIS服务。

  安装网络负载平衡的应用程序时,不需要特别的方法,只需要在配置好网络负载平衡的计算机上安装相应的服务即可。但是为了让每个用户在通过网络负载平衡访问到不同的计算机时,能够访问到一致的数据,需要在网络负载平衡的每台计算机上保持数据的一致性。举例来说:实现了两个节点的IIS的网络负载平衡,为了保证两个网站内容的一致性,除了这两个IIS服务器的配置相同外,相应的网站数据必须一致。

  为了检验网络负载平衡,我们可以通过IIS来进行验证,其他的一些应用如终端服务、Windows Media服务与IIS的应用相类似。

  在网络负载平衡的每一台计算机上安装IIS服务,方法如下:

  在“添加/删除程序”中,点击“添加Windows组件”,进入Windows组件向导,双击“应用程序服务器”,进入“应用程序服务器”(图4)。

win2003_lvs4
图4

  选中ASP.NET、Internet信息服务及应用网络COM+访问后,即可开始安装IIS服务。

  安装之后,进入第一台计算机的inetpubwwwroot目录,新建一个文本文件,输入以下内容:

  
  This win2003-1
  

  然后将它保存为default.htm文件。这个网页在IE中将显示如下内容:

  This w2003-1

  在第二台计算机的inetpubwwwroot目录,新建一个文本文件,并输入下面的内容:

  
  This win2003-2
  

  这个网页在IE浏览器中将显示“This w2003-2”,随后将这个文件以default.htm名称保存。

  然后,在其他计算机上的IE浏览器中键入http//cluster.heinfo.edu.cn,将会显示为“This win2003-1”或“This win2003-2”,根据网络的负载,网络负载平衡会自动转发到第一台计算机或第二台计算机。为了验证效果,你可以在浏览的时候,拔掉第一台计算机的网线或拔掉第二台机器的网线,将会发现浏览到的将是不同内容。当然,我们只是测试的时候,为了验证网络负载平衡的效果,两个网站的内容不一致,而在正式应用的时候,网络负载平衡群集的每个节点计算机的内容将是一致的,这样,不管使用那一个节点响应,都保证访问的内容是一致的。

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
One Response
  1. POO says:

    seen

    签名:My Blog
    ————————–
    http://spaces.msn.com/jiangyouxiaozi/

  2. Hi, I desire to subscribe for this webpage to get hottest updates, thus
    where can i do it please help out.

  3. Good day! I could have sworn I’ve visited this website before but after going
    through some of the posts I realized it’s new to me. Nonetheless, I’m definitely
    happy I stumbled upon it and I’ll be bookmarking it and checking back
    often!

  4. Howdy I am so delighted I found your blog page, I really found
    you by accident, while I was browsing on Bing for something else, Regardless
    I am here now and would just like to say thanks for a incredible post and
    a all round interesting blog (I also love the theme/design),
    I don’t have time to browse it all at the minute but I have saved it and also included
    your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb job.

  5. Please let me know if you’re looking for a article author for your weblog.
    You have some really good posts and I feel I would be a good asset.
    If you ever want to take some of the load off, I’d absolutely love to write some content for your
    blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Many thanks!

  6. Thanks for one’s marvelous posting! I quite enjoyed reading it, you might be
    a great author.I will make certain to bookmark
    your blog and definitely will come back from now on. I want to encourage you
    to ultimately continue your great posts, have a nice day!

  7. We absolutely love your blog and find most
    of your post’s to be just what I’m looking
    for. Does one offer guest writers to write content for yourself?

    I wouldn’t mind composing a post or elaborating on most of the subjects you write about here.
    Again, awesome website!

  8. Hi there mates, its enormous article regarding teachingand completely defined, keep it up all the time.

  9. After checking out a number of the blog posts on your site, I truly like your way of blogging.
    I saved it to my bookmark site list and will be checking back
    soon. Please check out my web site as well and tell me how you feel.

  10. Hello! I know this is somewhat off topic but I was wondering which blog platform are you using for
    this website? I’m getting sick and tired of WordPress because
    I’ve had issues with hackers and I’m looking at alternatives
    for another platform. I would be great if you could point me in the direction of
    a good platform.

  11. Hello every one, here every person is sharing these kinds of know-how, thus it’s good
    to read this web site, and I used to pay a visit this
    weblog everyday.

  12. Hi, after reading this remarkable article i am also glad
    to share my familiarity here with colleagues.

  13. Touche. Sound arguments. Keep up the great effort.

  14. natalielise says:

    Hey there! I’ve been reading your blog for a long time now
    and finally got the courage to go ahead and give you a shout out from Huffman Tx!
    Just wanted to mention keep up the great job! natalielise pof

  15. Charlespek says:

    Wow loads of great facts!
    drugs online
    online canadian pharmacy
    canadian pharmacy viagra
    online pharmacy
    pain meds online without doctor prescription – https://www.safeonlinecanadian.com/

    canadian drugs without prescription Vicy 0_a6a13

  16. Larrysquab says:

    Regards, I appreciate it!
    canadian mail order pharmacies
    canada pharmaceuticals online
    canadian online pharmacies
    canadian pharmacies online
    canadian pharmacies – https://www.canadianonlinepharmacytrust.com/

    canadian pharmacy king Hele 8e3c348

  17. Greetings I am so grateful I found your website, I really found you by error,
    while I was looking on Google for something else, Regardless I
    am here now and would just like to say thanks a lot for a
    tremendous post and a all round interesting blog (I also love the theme/design), I don’t have time to read
    through it all at the minute but I have book-marked it and also
    included your RSS feeds, so when I have time I will be back to
    read more, Please do keep up the excellent work.

  18. you are truly a excellent webmaster. The site loading velocity is amazing.
    It kind of feels that you are doing any unique trick.
    Moreover, The contents are masterwork. you have performed a magnificent activity in this topic!

  19. magnificent post, very informative. I’m wondering why the opposite experts of this
    sector do not realize this. You must continue your writing.
    I’m sure, you have a great readers’ base already!

  20. Pretty great post. I just stumbled upon your weblog and wished to say that I
    have truly loved surfing around your blog posts.
    In any case I’ll be subscribing in your feed and I hope you write once more very soon!

  21. When someone writes an paragraph he/she retains the thought of a user in his/her mind that how a user can know it.
    So that’s why this piece of writing is amazing.
    Thanks!

  22. yeezy shoes says:

    I together with my buddies happened to be following the best thoughts from your web blog and so instantly I had an awful suspicion I had not thanked the site owner for those secrets. The ladies ended up as a consequence joyful to study them and have in effect absolutely been tapping into these things. Many thanks for actually being simply thoughtful and also for considering such great subject matter most people are really eager to discover. My very own sincere apologies for not expressing appreciation to you earlier.

  23. I wanted to compose a quick remark so as to thank you for those wonderful pointers you are sharing here. My time intensive internet research has at the end of the day been paid with pleasant information to write about with my co-workers. I would repeat that we visitors are very fortunate to live in a magnificent place with very many awesome individuals with very beneficial secrets. I feel somewhat happy to have discovered your entire web site and look forward to so many more fun times reading here. Thank you once again for everything.

  24. jordan 11 says:

    I simply needed to thank you so much again. I do not know the things I would’ve accomplished in the absence of these creative ideas shown by you directly on that problem. It was before a very depressing case in my view, however , considering a new specialised form you resolved that forced me to weep over contentment. I am grateful for this service as well as have high hopes you recognize what a great job you are always accomplishing educating the mediocre ones by way of your webpage. I am certain you have never met any of us.

  25. Thank you so much for giving everyone an extremely splendid possiblity to read in detail from this blog. It really is so beneficial and as well , stuffed with fun for me personally and my office colleagues to search your site at minimum three times in one week to see the new guides you have. And of course, I am at all times pleased with the sensational pointers you give. Selected two tips on this page are undoubtedly the most beneficial we have all ever had.

  26. I needed to write you the little bit of observation so as to give thanks yet again on the precious concepts you have featured at this time. It is really remarkably open-handed of people like you in giving easily just what many individuals would have supplied for an ebook to help make some profit on their own, notably since you might have tried it in case you decided. The principles in addition acted to provide a good way to fully grasp some people have the same dream the same as mine to figure out somewhat more with reference to this condition. I believe there are lots of more pleasant periods in the future for folks who view your website.

  27. I’ve been browsing online more than three hours as of late, yet I never
    found any interesting article like yours. It’s
    lovely worth sufficient for me. In my opinion, if all webmasters and bloggers made excellent content material as you probably did, the web will probably be a lot more useful than ever before.

  28. Pingback: nike air max
  29. Pingback: yeezy boost 350
  30. CharlieVem says:

    With thanks, Valuable stuff.

    does cialis work for ed
    cialis online
    quanto custa 1 comprimido de cialis
    cialis tablets

  31. Pingback: jordan shoes
  32. Pingback: jordan retro
  33. Pingback: ultra boost 3.0
  34. Pingback: nike air max
  35. Pingback: cheap jordans
  36. Pingback: jordan shoes
  37. Pingback: yeezy shoes
  38. continuously i used to read smaller posts which as well
    clear their motive, and that is also happening with this
    paragraph which I am reading here.

  39. Pingback: jordan shoes
  40. Pingback: air max 2018
  41. Pingback: yeezy boost 350
  42. Pingback: fila shoes
  43. Pingback: adidas zx flux
  44. I blog quite often and I genuinely thank you for your content.
    This article has really peaked my interest.
    I’m going to take a note of your blog and keep checking
    for new details about once a week. I opted in for your Feed as well.

  45. Pingback: cheap jordans
  46. Pingback: jordan shoes
  47. Pingback: coach outlet
  48. Pingback: birkin bag
  49. Pingback: canada goose
  50. Pingback: jordan shoes
  51. Ahaa, its good dialogue concerning this piece of writing
    at this place at this web site, I have read all that, so
    at this time me also commenting here.

  52. Pingback: yeezy 700
  53. Why people still use to read news papers when in this technological world everything is
    available on net?

  54. Pingback: nike air max 97
  55. Pingback: nhl jerseys
  56. Very soon this site will be famous among all blogging
    users, due to it’s good articles

  57. Pingback: yeezy boost 350
  58. whoah this blog is excellent i really like studying your posts.
    Keep up the great work! You know, many persons are hunting round for
    this information, you can aid them greatly.

  59. You made some good points there. I checked on the web
    for more information about the issue and found most people will go
    along with your views on this website.

  60. Pingback: yeezy shoes
  61. vdsnwaica says:

    how long does it take for trazodone to make you sleepy [url=http://trazodoneud.com/]trazodone 50 mg tablet[/url] trazodone 100 mg trazodone for dogs trazodone 100mg

  62. Pingback: supreme outlet
  63. tinyurl.com says:

    I’m not that much of a internet reader to be honest but your sites really nice,
    keep it up! I’ll go ahead and bookmark your site to come back later.
    Many thanks

  64. Pingback: curry shoes
  65. Pingback: hermes online
  66. Pingback: moncler
  67. hemctyday says:

    order viagra online [url=http://emmapharmsr.com/]where to buy viagra online[/url] buy viagra online viagra online prescription free viagra prescription online

  68. Superb website you have here but I was curious about if you knew of any community forums that cover the same topics talked about here?
    I’d really love to be a part of group where I can get advice from other experienced
    people that share the same interest. If you have any suggestions,
    please let me know. Thanks!

  69. Pingback: balenciaga
  70. Pingback: hermes belt
  71. Pingback: adidas nmd r1
  72. Pingback: jordan shoes
  73. Pingback: calvin klein
  74. ps4 games says:

    Thanks a lot for sharing this with all folks you really recognise
    what you’re talking approximately! Bookmarked. Kindly also seek advice from my web site =).
    We could have a hyperlink trade agreement among us

  75. ghgjtyday says:

    canadian pharmacy cialis [url=https://canadianpharmacyonlinejycx.com/]п»їcanadian pharmacy[/url] canada pharmacy online online canadian pharmacy canadian pharmacy viagra

  76. If you desire to grow your experience just keep visiting this web site and be updated with the newest news update posted here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image