Erlang群集 [英] Erlang clusters

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

问题描述

我试图使用Erlang实现一个集群,将它们整合在一起。我喜欢它创建一个完全连接的节点图,但是在阅读不同的文章在线,似乎这不能很好地(最多50 - 100个节点)。 OTP的开发者是否将目的限制在此限制?我知道您可以将节点设置为仅具有明确的连接以及隐藏节点等。但是,似乎默认的即开即用设置不是非常可扩展的。



所以问题:


  1. 如果你有5个节点(A,B,C ,D,E)都有明确的连接,使ABCDE。 Erlang / OTP是否允许A直接与E进行通话,或者A是否需要传递从B到D的消息到E,因此这是完全连接图的原因?再次,这是有道理的,但它并不比我所看到的更好。


  2. 如果一个人试图去寻找一个可扩展的,宽容系统,你有什么选择?似乎好像,如果你不能创建一个完全连接的图,因为你有太多的节点,那么下一个最好的事情就是创建一个某种树。但是,这似乎不是容错的,因为如果子节点的根节点或任何父节点死机,您将丢失群集的很大一部分。


  3. 在查看主管和工作人员时,我看到的所有示例都将其应用于单个节点上的进程。节点是否可以应用于节点集群以帮助实现容错?


  4. 节点可以是几个集群的一部分吗?

  5. 感谢您的帮助,如果有一个半近期的网站或博客(大约1岁),我错过了,我会很高兴看看那些。但是,我已经很好地浏览了互联网。

    解决方案


    1. 将消息发送到集群中任何远程节点上的进程,例如使用其进程标识符(pid)。这称为位置透明度。是的,它可以很好地扩展(参见Riak,CouchDB,RabbitMQ等)。


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


    3. 在节点级别,您将采取不同的方法,例如,构建相同的节点,如果它们失败并且工作被剩余的节点。看看Riak如何处理这个问题(查看 riak_core 并查看博客文章介绍Riak Core )。


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


    阅读 http ://learnyousomeerlang.com/ 获得更大的收获。


    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.

    So to the questions:

    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. 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. 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. Can nodes be part of several clusters?

    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. 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).

    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.

    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).

    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).

    Read http://learnyousomeerlang.com/ for greater good.

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

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