English 中文(简体)
集束技术方案服务器,从而可以向所有客户发送数据。
原标题:Clustering TCP servers, so can send data to all clients

<>载体>Important note:

我已在服务器Fault上询问这个问题:https://serverfault.com/questions/349065/clustering-tcp-servers-so-can-send-data-to-all-clients,但我也希望看到

www.un.org/Depts/DGACM/index_spanish.htm

I m developing a real-time mobile app by setting up a TCP connection between the app and server backend. Each user can send messages to all other users.

http://aws.amazon.com/“rel=“nofollow noreferer”>Twisted,正在制作我自己的通讯程序,在Amazon Web Services

www.un.org/Depts/DGACM/index_spanish.htm Currently I m trying to make the backend scalable (and reliable). As far as I can tell, the system could cope with more users by upgrading to a bigger server (which could become rather limiting), or by adding new servers in a cluster configuration - i.e. having several servers sitting behind a load balancer, probably with 1 database they all access.

I have sketched out the rough architecture of this: TCP server cluster problem

然而,如果红新用户向所有其他相关用户发出信息,又怎么办? 红色服务器与红外线连接,但与绿化无关。

我可以想办法解决这一问题:

  • Each server could have an open TCP (or SSL) connection with each other server. When one server wants to send a message to all users it simply passes this along it s connection to the other servers. A record could be kept in the database of which servers are online (and their IP address), and one of the servers could be a boss - i.e. decides if others are up and running, if not it could remove them from the database (if a server was up and lost it s connection to the boss it could check the database and see if it had been removed, and restart if it had - else it could assume the boss was down.)

Clearly this needs refinement but shows the general principle.

否则,我不敢肯定这一点(我当然似乎喜欢想):

  • Perhaps users could just connect to a box or router, and all servers could message all users through it?

www.un.org/Depts/DGACM/index_spanish.htm

如果你知道如何有效地集中TCP服务器,或提供解决办法的设计模式,或根本没有评论,那么我将非常感谢。 感谢:

最佳回答

你们需要决定(或如果你已经这样做的话)你系统的可靠性要求:是否应当把所有电文发送给所有用户(例如一台或多台服务器坠毁),你是否可以容忍在服务器坠毁时两次向同一用户发出同样的电文? 你的制度复杂性直接取决于这些决定。

The simplest version is when a message is not delivered to all users on server crash. All your servers keep TCP connection to each other. One of them receives a message from a user and sends it to all other connected users (to this server) and to all other connected servers. Other servers send this message to all their users. To scale the system you just run additional server which connects to all existing servers.

问题回答

查阅如何使用IRC服务器处理。 他们基本上可以这样做。 人们可以把所有服务器寄给他人。 或者只有单一用户,还有另一个服务器。 以及团体,称为“渠道”。 该系统的最佳方法是在服务器之间轮换。

It s not that hard, if you can make sure the servers know each other and can talk to each other.

附带说明: 9/11时,最可靠的互联网新闻来源是国际搜索救援委员会网络。 由于带宽,所有www网站都倒塌;网站甚至连一个便衣网页也从来。 在此期间,该中心的网络能够在跨大西洋提供近乎实时、温和的新闻频道。 也许你不能再将服务器登录在另一个方面,但至少服务器能够保持服务器与服务器之间的连接。

一个明显的选择是,利用亚洲开发银行作为信息交流中心。 您不得不在任何地方储存新电文,以免服务器突然坠毁而丢失。 将电文输入中央数据库,并拥有关于TCP服务器的通知程序,以收集电文并向正确用户发送。

TCP server cannot be clustered, the snapshot you put here is a classic HTTP server example. Since the device will send TCP connection to server, say, pure socket, there will be noway of establishing a load-balancing server.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...