仅使用 C 的分布式系统设计 [英] Distributed system design using only C

查看:26
本文介绍了仅使用 C 的分布式系统设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作是实现一个分布式节点系统(如 p2p 节点),每个节点(比如说 A、B、C 和 D)执行某些功能,并且需要相互交互以进行各种操作,例如同步操作和其他事情,例如 15 个 A 节点与一组 5 个 B 节点交互,以进入负载最少的节点的队列并获取令牌编号,然后等待 C 将它们重定向到空闲节点 D 等等.

I have the work of implementing a distributed system of nodes (like p2p nodes) each of these nodes (lets say A,B,C and D) perform certain functions and need to interact with each other for various operations such as synchronize operations and other things like 15 A nodes interact with a group of 5 B nodes to get into the least loaded node's queue and get a token number and thereafter wait for C to redirect them to a free node D and so on.

我对如何进行设计有点迷茫:

I am a bit lost as to how should i go about the design:

  1. 我想到的协议是封装一个struct 的操作类型和其他要发送的东西.此外,这是使用确认方案完成的,因此我可以确定对方收到了消息.

  1. The protocol that i have thought of is to encapsulate a struct of the type of operation and other things to be sent. Also, this is done using an acknowledgment scheme so i can be sure the other side got the message.

由于我没有中央服务器,我该如何处理分布式互斥方面.我猜每个节点都会复制数据,但这听起来有点太贵了(更不用说愚蠢了).

How do i go about the distributed mutual exclusion aspect as I do not have a central server. I am guessing each node replicates the data, but this sounds a bit too expensive(not to mention stupid).

实现 p2p 系统时遵循的基本设计方法是什么,即我如何实现程序以使其在接收时被阻止但也可以发送进一步的更新等,同时从其他人​​那里获取信息关于整个系统的状态".

What is the basic design methodology followed while implementing p2p systems, ie how do i implement the program such that it is blocked on a receive but also can send further updates et al and at the same time get information from others about the 'state' of the whole system.

如何确保请求的总排序?

How do i ensure total ordering of requests?

另外,我可能需要查看/面对的其他问题是什么.如果您能指出一些关于实现 p2p 和分布式系统的优秀在线资源,我也将不胜感激.

Also, what are the other issues that I may need to look at/face. I also would appreciate if you could point me towards some good online resources on implementing p2p and distributed systems.

谢谢!!

推荐答案

我不会试图给出一个完整"的答案(因为这个问题太大而且很模糊)但我可以为你指出一个有趣的问题拼图:

I won't try to give a "whole" answer (because the question is way too large & vague anyways) but I could point you towards an interesting piece of the puzzle:

  1. 您可以使用消息队列系统(例如 AMQP RabbitMQ:有一个实验性的 C绑定可用)以在您的节点之间实现可靠的消息传递.

  1. You could use a Message Queuing system (e.g. AMQP RabbitMQ: there is an experimental C binding available) to implement reliable message delivery between your nodes.

互斥:可以使用Paxos等协议

这篇关于仅使用 C 的分布式系统设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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