对负载平衡器启用粘性会话 [英] Enabling sticky sessions on a load balancer

查看:340
本文介绍了对负载平衡器启用粘性会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这一个任何建议将不胜AP preciated,我一直在研究整个上午我还在抓我的头。我在一个新的公司开始在几个星期前,在那里我是唯一的.NET开发人员的开发最初是由外包公司做,我一直要求研究。
我现有系统的知识是极其有限的,但是从我可以收集的情况如下:

Any advise on this one would be greatly appreciated, I've been researching all morning and I'm still scratching my head. I started at a new company a few weeks ago, where I'm the only .NET developer as the development was originally done by an outsourcing company and I've been asked to research. My knowledge of the existing system is extremely limited but from what I can gather the situation is as follows.

我们希望能够在一个asp.net网站粘性会话。从我的研究,我收集了,我需要做下面的步骤。我们正在使用ASP.NET状态服务

We would like to enable sticky sessions on an asp.net web site. From my research I have gathered, I need to do the following steps. We are using the ASP.NET State Service

的设置是服务的两个Web服务器的负载平衡服务器。

The setup is a load balance server which services two web servers.


  1. 确保两个Web服务器具有相同的计算机密钥。

  2. 确保网站已经部署之前pcompiled $ P $。对于由ASP.NET状态服务对象的序列化。

  3. 确保在IIS元数据库中的应用程序路径是Web服务器上是相同的。

我在我缺乏知识位被存储在哪里会话。存储在负载均衡的课程,他们可以被存储在负载均衡?从我读过他们是由ASP.NET状态服务存储,应在服务中的负载均衡器上运行,因此在会话存储的O负载均衡。

I bit of knowledge I'm lacking is where are the sessions are stored. Are the sessions stored on the load balancer, can they be stored on the load balancer? From what I've read they are stored by the ASP.NET State Service, should the service be running on the load balancer therefore the sessions are stored o the load balancer.

据我了解ASP.NET状态服务在每个Web服务器上运行,他们只是互相交谈,这样的会议都存储在这两个服务器上。我认为他们这样做的方式是基于所使用的算法的类型。任何信息将不胜AP preciated。

From what I understand the ASP.NET state service runs on each of the web servers and they just talk to each other so that the sessions are stored across both servers. I assume that the way they do this is based on the type of algorithm that is used. Any information would be greatly appreciated.

推荐答案

zeencat,看一看的 http://msdn.microsoft.com/en-us/library/ms178586.aspx 在状态服务器模式部分:

zeencat, take a look at http://msdn.microsoft.com/en-us/library/ms178586.aspx at the State Server Mode section:

StateServer模式存储会话状态,被称为ASP.NET状态服务,即独立于ASP.NET辅助进程或IIS应用程序池
  使用这种模式可确保会话状态如果Web应用程序重新启动pserved $ P $,也使Web场中提供给多个Web服务器会话状态。
  要使用StateServer模式,必须首先确保ASP.NET状态服务的用于会话存储的服务器上运行的的。 ASP.NET状态服务的安装为服务安装ASP.NET和.NET Framework时。

StateServer mode stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. To use StateServer mode, you must first be sure the ASP.NET state service is running on the server used for the session store. The ASP.NET state service is installed as a service when ASP.NET and the .NET Framework are installed.

据我了解的ASP.Net状态服务运行在一台服务器上,一个名为 ASP.NET状态服务服务,两台服务器将具有相同的web.config文件:

From what I understand the ASP.Net state service runs on one server, as a service called ASP.NET state service, both servers will have the same web.config file:

<configuration>
  <system.web>
    <sessionState mode="StateServer"
      stateConnectionString="tcpip=SampleStateServer:42424"
      cookieless="false"
      timeout="20"/>
  </system.web>
</configuration>

这样一来,会被保存谁托管服务的服务器上。

This way, the session is stored on the server who hosts the service.

希望它能帮助,
[]

Hope it helps, []

这篇关于对负载平衡器启用粘性会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆