Erlang集群 [英] Erlang clusters

查看:449
本文介绍了Erlang集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图实现一个集群使用Erlang作为胶水,把它所有在一起。我喜欢它创建一个完全连接的节点图,但在在线阅读不同的文章,似乎这不能很好地扩展(最多有50 - 100个节点)的想法。 OTP的开发者是否有目的地强加这个限制?我知道你可以设置节点只有明确的连接,以及有隐藏的节点等。但是,似乎默认的开箱即用的设置不是很可扩展。

I'm trying to implement a cluster using Erlang as the glue that holds it all together. I like the idea that it creates a fully connected graph of nodes, but upon reading different articles online, it seems as though this doesn't scale well (having a max of 50 - 100 nodes). Did the developers of OTP impose this limitation on purpose? I do know that you can setup nodes to have explicit connections only as well as have hidden nodes, etc. But, it seems as though the default out-of-the-box setup isn't very scalable.

所以对于问题:

1)如果你有5个节点(A,B,C,D,E)显式连接使得ABCDE。 Erlang / OTP允许A直接与E通信,或者A必须从B到D传递消息才能到达E,因此这就是完全连接图的原因?再次,它是有道理的,但它不能很好地从我所见过的。

1) If you had 5 nodes (A, B, C, D, E) that all had explicit connections such that A-B-C-D-E. Does Erlang/OTP allow A to talk directly to E or does A have to pass messages from B through D to get to E, and thus that's the reason for the fully connected graph? Again, it makes sense but it doesn't scale well from what I've seen.

2)如果一个人尝试去一个可扩展和容错系统,你有什么选择?看起来好像,如果你不能创建一个完全连接的图,因为你有太多的节点,下一个最好的事情是创建一个类型的树。但是,这看起来不是非常容错,因为如果子节点的根或任何父节点死掉,那么您的集群将会失去很大一部分。

2) If one was to try and go for a scalable and fault-tolerant system, what are your options? It seems as though, if you can't create a fully connected graph because you have too many nodes, the next best thing would be to create a tree of some kind. But, this doesn't seem very fault-tolerant because if the root or any parent of children nodes dies, you would lose a significant portion of your cluster.

3)在研究主管和工人时,我所看到的所有例子都适用于单个节点上的进程。

3) In looking into supervisors and workers, all of the examples I've seen apply this to processes on a single node. Could it be applied to a cluster of nodes to help implement fault-tolerance?

4)节点是否是几个集群的一部分?

4) Can nodes be part of several clusters?

感谢您的帮助,如果有一个半最近的网站或博客(大约1岁),我错过了,我很高兴看看那些。

Thanks for your help, if there is a semi-recent website or blogpost (roughly 1-year old) that I've missed, I'd be happy to look at those. But, I've scoured the internet pretty well.

推荐答案

广告1)是的,您可以将邮件发送到任何远程节点,例如,通过使用其进程标识符(pid)。这称为位置透明度。是的,它的规模很好(见Riak,CouchDB,RabbitMQ等)。

ad 1) Yes, you can send messages to a process on any remote node in a cluster, for example, by using its process identifier (pid). This is called location transparency. And yes, it scales well (see Riak, CouchDB, RabbitMQ, etc).

ad 2)注意一个节点可以运行数十万个进程。 Erlang已经被证明是非常可扩展的,并且是为容错而构建的。还有其他方法来构建更大的,例如。 CloudI的SOA方法(见注释)。您还可以构建使用隐藏节点的群集,如果您真的真的需要。

ad 2) Note that one node can run hundred thousands of processes. Erlang has proven to be very scalable and was built for fault tolerance. There are other approaches to build bigger, e.g. SOA approach of CloudI (see comments). You also could build clusters that use hidden nodes if you really really need to.

ad 3)在节点级别,您将采用不同的方法,例如,构建相同的节点,如果失败则容易替换,其余节点。查看Riak如何处理这个问题(查看 riak_core 并检查博客文章介绍Riak Core )。

ad 3) At the node level you would take a different approach, for example, build identical nodes that are easy to replace if they fail and the work is taken over by the remaining nodes. Check out how Riak handles this (look into riak_core and check the blog post Introducing Riak Core).

ad 4)节点可以离开并进入集群,但不能是多个集群的一部分与此同时。连接的节点共享一个用于标识连接的节点的集群cookie。您可以在VM运行时设置Cookie(请参见分布式Erlang )。

ad 4) Nodes can leave and enter a cluster but cannot be part of multiple clusters at the same time. Connected nodes share one cluster cookie which is used to identify connected nodes. You can set the cookie while the VM is running (see Distributed Erlang).

阅读 http://learnyousomeerlang.com/ 更大的好处。

这篇关于Erlang集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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