azure中无状态虚拟机和有状态虚拟机有什么区别? [英] What is difference between stateless and stateful virtual machines in azure?

查看:218
本文介绍了azure中无状态虚拟机和有状态虚拟机有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

azure中无状态虚拟机和有状态虚拟机有什么区别?

What is difference between stateless and stateful virtual machines in azure?

推荐答案

HTTP是无状态协议,这意味着服务器不必维护和保存自身与客户之间的联系活动。下载文档(当然是HTML文档)时,连接终止,对于下一个资源,客户端必须重新建立连接并重新下载文档,就像它是第一次一样(因为活动没有保存!)。这意味着,如果用户登录,服务器不知道。会话,缓存,cookie用于解决此问题。因此,每次我登录CodeProject时,网站都会检查cookie,缓存和其他会话变量(如果有的话),以便为我提供适合我的数据。



有状态协议,可以长时间保持该用户的连接和活动,从而可以实现服务器到客户端的通信,因为它们维护状态,他们知道用户正在下载页面第二次,所以服务器本身可以管理内容,而无需等待cookie或缓存检查。



在简单版本中,如果用户活动丢失(或未知)之前每个请求无状态,如果用户活动已知,或者先前的数据已知,则协议有状态



仅仅是为了举例:一个普通的-ASP.NET网站是无状态的,而安装了SignalR的应用程序将模仿有状态应用的属性;虽然它仍然是基于HTTP协议的无状态。



asp.net mvc - 有状态和无状态之间的区别是什么? - 程序员堆栈交换 [ ^ ]

无状态协议 - 维基百科,免费百科全书 [ ^ ]



现在,只需将此概念应用于Azure中的这些虚拟机,您就会明白这些术语的用途。像第一次一样开始的机器将是无国籍的。



如何为虚拟桌面池中的虚拟机创建无状态映像 - 远程桌面服务(终端服务)团队博客 - 站点主页 - MSDN博客 [ ^ ]
HTTP is a stateless protocol, which means, server doesn't have to maintain and save the activity of the connection between itself and the client. As soon as the document (HTML document, of course) is downloaded the connection is terminated and for next resource, client has to re-establish the connection and re-download the document as if it were his first time (because activity is not saved!). This means, that if the user logs in, server doesn't know. Sessions, caches, cookies are used to overcome this problem. So that each time I log in to CodeProject, website would check for a cookie, cache and other session variables (if they had any) to provide me with data that is meant for me.

Stateful protocols, would maintain the connection and activity of that user for a longer time so that server-to-client communication can be possible, also, since they maintain the state, they know that the user is downloading the page second time so server itself can manage the content without having to wait for cookie or cache check.

In simple version, if the user activity is lost (or unknown) before each request Stateless, while if the user activity is known, or previous data is known then protocol is Stateful.

Just for the sake of example: A plain-ASP.NET website would be stateless, while an application having SignalR installed would mimic the properties of stateful application; although it is still stateless based on HTTP protocol.

asp.net mvc - What's the difference between stateful and stateless? - Programmers Stack Exchange[^]
Stateless protocol - Wikipedia, the free encyclopedia[^]

Now, just apply this concept to those virtual machines in Azure and you will understand the purpose of these terminologies. The machines that start as if it were their first time, would be stateless.

How to Make a Stateless Image for Virtual Machines in a Virtual Desktop Pool - Remote Desktop Services (Terminal Services) Team Blog - Site Home - MSDN Blogs[^]


这篇关于azure中无状态虚拟机和有状态虚拟机有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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