gpt4 book ai didi

implementation - 关于 Paxos 和论文 Paxos Made Simple 的说明

转载 作者:行者123 更新时间:2023-12-04 14:03:57 25 4
gpt4 key购买 nike

我读了一篇名为“Paxos made simple”的论文,但仍然有些困惑:

  • “paxos 算法的实例”指的是什么?每个实例是否表明有来自外部客户端的输入/命令?每个实例的paxos算法将并行执行???
  • 如果只有一个“杰出的”proposer 可以发布proposal,那么paxos 算法和2-phase commit 算法有什么区别???
  • 在实际项目中我们可以在哪里应用paxos算法?

  • 似乎这里的论文给出了更清晰的描述:
    http://research.microsoft.com/pubs/64634/web-dsn-submission.pdf

    还有什么想法吗?

    最佳答案

    What does the "instances of paxos algorithm" refers to? does each instance indicate there is an input/command from external clients? and the paxos algorithm for each instance would be executed in parallel???



    我在 another question 中回答了“实例”问题,所以我只在这里总结一下。

    基本上,这就像说“快速排序的一个实例”来指代算法的一次运行。在 Paxos 的情况下,它不是对列表进行排序,而是跨多个主机选择一个值。多个paxos 实例可以/正在并行运行。参与者必须意识到这一点,所以最好明确提到这一点。

    If there is only one "distinguished" proposer who is able to issue proposal, then what is the difference of paxos algorithm from 2-phase commit algorithm???



    Distinguished Proposer 是一种优化,不是算法的要求。 Distinguished Proposer 减少了两个提议者跳过准备/接受消息的争用,如果您希望实例完成,这很重要。在这个模型中,节点将请求转发给 Distinguished Proposer,而不是为自己提议。如果它认为杰出提议者已死,那么它只是为自己提议。 (不一定是/永远不可能 100% 确信杰出提议者已死)。

    Where could we apply paxos algorithm in real world/project?



    首先,我使用 Paxos 进行领导选举。例如,如果我有几个节点可以做一个数据库Master,那么我使用Paxos到一个paxos实例来选择master。

    次要用例是作为强一致性数据库。这样做的问题是,由于 Paxos 中所需的消息数量,它可能会很慢,所以我不会将它用于其他数据库更好地提供服务的事情。也就是说,我主要将它用于配置。以上面提到的数据库master leader选举为例。我存储结果,以便节点可以查询诸如“谁是当前数据库主服务器?”之类的内容。 Paxos 也会发布它的结果,所以在正常模式下我只是听这个流而不是实际查询。

    关于implementation - 关于 Paxos 和论文 Paxos Made Simple 的说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10791825/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com