"Principles of Reactive Programming" 之<Actors are Distributed> (3)

Cluster

讲课的这哥们接下来讲了下Akka Cluster的使用,但是是通过把一个以前讲过的actor 系统改成使用cluster来介绍的Akka cluster. 这部分代码很多,还是直接看视频吧。或者,看这篇文章,

Akka Clustering, Step by Step

更直白一些,不用事先了解课程中那个比较复杂的例子。

还是从正常的顺序了解下Akka Cluster吧。

Akka Clustering用来解决什么问题?

Akka Cluster provides a fault-tolerant decentralized peer-to-peer based cluster membership service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.

这句话的主干就是“Akka Cluster提供了一个cluster membership service"。

什么是"membership service"呢?按照课程的说法就是所有的成员都知道谁是这个cluster的成员,也就是所有的成员都了解谁在这个集群中 。

那么知道这些信息有啥意义呢?

在HDFS中,datanode并不知道谁在集群中, MapReduce的taskTracker也不知道,Storm的supervisor也不知道,对于这些分布式系统,只要master知道谁在集群中就可以正常工作了,但这也会造成单点的问题。那么,Akka Cluster呢? ”decentralized peer-to-peer based cluster membership service"。它没有单点,但是工作的组织就成了问题。当整个集群需要对某些东西达成一致,它们起码得知道哪些节点属于这个集群。另一方面,Akka Cluster的membership service还会提供成员的状态变化的通知,允许集群的成员跟据状态进行更复杂的操作,比如,主动把负载迁移到新成员。

membership service直接的体现就是集群中的结点可以订阅ClusterEvent.

Cluster(context.system).subscribe(actorRef, classOf[ClusterEvent.XXXX]

Akka只是提供这种构建分布式系统的基础服务,但是构造针对特定问题的分布式系统,还需要更详细的设计和实现。

时间: 2024-08-13 13:52:00

"Principles of Reactive Programming" 之<Actors are Distributed> (3)的相关文章

&quot;Principles of Reactive Programming&quot; 之&lt;Actors are Distributed&gt; (1)

week7中的前两节课的标题是”Actors are Distributed",讲了很多Akka Cluster的内容,同时也很难理解. Roland Kuhn并没有讲太多Akka Cluster自身如何工作的细节,而是更关注于如何利用Akka Cluster来把Actor分布到不同的节点上,或许这么安排是因为Akka Cluster能讲的东西太多,而Coursera的课时不够.但是,从听众的角度来说,这节课只是初步明白了下Akka Cluster能干啥,但是想要自己用起来,特别是想了解其工作的

Notes of Principles of Parallel Programming - partial

0.1 TopicNotes of Lin C., Snyder L.. Principles of Parallel Programming. Beijing: China Machine Press. 2008. (1) Parallel Computer Architecture - done 2015/5/24(2) Parallel Abstraction(3) Scable Algorithm Techniques(4) PP Languages: Java(Thread), MPI

&quot;reactive programming&quot;的概念

下面的内容大多是翻译来的. Reactive Programming? What is Reactive Programming? 为了了解Reactive——从编程范式至其背后的动机,有必要了解现在的开发者和公司在十年前不曾面对的挑战. 游戏的改变主要有两大方面: 硬件的提升 因特网 Why things are different now? (原文对比了一遍2005年和2014年因特用户的增长:10亿至29.5亿:Facebook用户的增长:550万至13亿: twitter从无至有,0至2

Unity基于响应式编程(Reactive programming)入门

系列目录 [Unity3D基础]让物体动起来①--基于UGUI的鼠标点击移动 [Unity3D基础]让物体动起来②--UGUI鼠标点击逐帧移动 时光煮雨 Unity3D让物体动起来③—UGUI DoTween&Unity Native2D实现 时光煮雨 Unity3D实现2D人物动画① UGUI&Native2D序列帧动画 时光煮雨 Unity3D实现2D人物动画② Unity2D 动画系统&资源效率 背景 前有慕容小匹夫的一篇<解构C#游戏框架uFrame兼谈游戏架构设计&

[RxJS] Reactive Programming - What is RxJS?

First thing need to understand is, Reactive programming is dealing with the event stream. Event streams happens overtime, which not stay in the memory. For example, the array we have: var source = ['1', '1', 'foo', '2', '3', '5', 'bar', '8', '13']; W

[Reactive Programming] RxJS dynamic behavior

This lesson helps you think in Reactive programming by explaining why it is a beneficial paradigm for programming. See how reactive programming helps you understand the dynamic behavior of a value evolving over time. It allows you to specify the dyna

Functional reactive programming introduction using ReactiveCocoa中文版

今天发现了Functional reactive programming introduction using ReactiveCocoa - By AshFurrow的中文翻译版,译者为: kevinHM,以下为github地址: https://github.com/KevinHM/FunctionalReactiveProgrammingOniOS 感谢原作者和译者的贡献!

响应式编程(Reactive programming)

响应式编程是指确保程序对事件或输入做出响应的做法.在这一节,我们将专注于图形界面方面的响应式编程,图形界面总量响应式的.然而,其他网格的编程也需要考虑响应式编程,例如,运行在服务器上的程序总是需要保持对输入作出响应,即使是在它处理其他需要长时间运行的任务期间.我们将在第十一章实现聊天服务器时,会看到在服务器编程方面也要用到这里讨论的一些方法. 大多数图形界面库使用事件循环去处理绘制图形界面,以及与用户之间的交互,就是说,一个线程既要负责绘制图形界面,也要处理其上的所有事件,我们称这种线程为图形界

ReactiveCocoa与Functional Reactive Programming

什么是Functional Reactive Programming http://limboy.me/ios/2013/06/19/frp-reactivecocoa.html Functional Reactive Programming(以下简称FRP)是一种响应变化的编程范式.先来看一小段代码 a = 2 b = 2 c = a + b // c is 4 b = 3 // now what is the value of c? 如果使用FRP,c的值将会随着b的值改变而改变,所以叫做「