Aeron集群互通
我想了解 aeron 集群内部通信
嗨, 我是 Aeron Cluster 的新手,我尝试了解各个集群组件之间的关系。
来自 https://github.com/real-logic/aeron/wiki/Cluster -教程:
4.3。运行集群 现在我们已经配置好了集群,可以开始运行它了。启动服务的代码如下。
try (
ClusteredMediaDriver clusteredMediaDriver = ClusteredMediaDriver.launch(
mediaDriverContext, archiveContext, consensusModuleContext); // (1)
ClusteredServiceContainer container = ClusteredServiceContainer.launch(
clusteredServiceContext)) // (2)
{
System.out.println("\[" + nodeId + "\] Started Cluster Node on " + hostname + "...");
barrier.await(); // (3)
System.out.println("\[" + nodeId + "\] Exiting");
}
我不明白 ClusteredServiceContainer 如何与 ClusteredMediaDriver 通信。 我的意思是,在上面的代码中,每个对象都是独立构造的。它们之间的“粘合剂”是什么?
i want to understand aeron cluster inter communication
Hi,
I am new in Aeron Cluster and I try to understand the relations between the various cluster's components.
From https://github.com/real-logic/aeron/wiki/Cluster-Tutorial :
4.3. Running the Cluster
Now we have a configured cluster, we can start it running. The code for launching the service is as follows.
try (
ClusteredMediaDriver clusteredMediaDriver = ClusteredMediaDriver.launch(
mediaDriverContext, archiveContext, consensusModuleContext); // (1)
ClusteredServiceContainer container = ClusteredServiceContainer.launch(
clusteredServiceContext)) // (2)
{
System.out.println("\[" + nodeId + "\] Started Cluster Node on " + hostname + "...");
barrier.await(); // (3)
System.out.println("\[" + nodeId + "\] Exiting");
}
I do not understand how the ClusteredServiceContainer communicate with the ClusteredMediaDriver .
I mean that in the code above each object constructed independently .What is the "glue" between them ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MediaDriver.Context
ClusteredServiceContainer.Context
它们使用上面相同的aeronDirectoryName
,共享磁盘或内存上的同一个文件。MediaDriver.Context
ClusteredServiceContainer.Context
they use the sameaeronDirectoryName
in the above, share the same file on the disk or memory.ConsensusModule 和 ClustedServiceContainer 之间有两个信息流。首先,有一些控制消息在它们之间流动。其中包括“加入日志”和“服务确认”等消息,允许 ClusteredServiceContainer 开始读取日志并确认日志中特定点的进度(例如快照已完成)。这发生在
controlChannel
上,它默认是一个 IPC 通道,在 ClusteredServiceContainer 和 ConsensusModule 中配置。第二个是实际数据。这是通过监视正在接收要写入存档的日志数据的订阅来实现的。它使用 BoundedLogAdapter,因此它只会读取集群商定的当前提交位置。
There are two flows of information between the ConsensusModule and the ClustedServiceContainer. Firstly there are some control messages that flow between them. These include messages like "join log" and "service ack" that allow for the ClusteredServiceContainer to start reading the log and acknowledge progress to specific points in the log (e.g. a snapshot has completed). This occurs on the
controlChannel
, which is by default an IPC channel, configured in both the ClusteredServiceContainer and ConsensusModule.The second is the actual data. This happens through a spy on the subscription that is receiving the log data to be written to the archive. It uses the BoundedLogAdapter so that it will only read up to the current commit position agreed upon by the cluster.