name: Chapter-7 class: title

Appendix


name: Section-Break-Gossip-Consensus class: title

Gossip & Consensus


name: Introduction-to-Consensus class: compact Introduction to Consensus ————————-

Consul은 일관성을 제공하기 위해 Consensus 프로토콜을 사용합니다. Consensus를 자세히 이해할 필요는 없지만 아래는 Consul에 대해 배울 때 유용한 몇 가지 용어입니다.

다음 슬라이드에서 Raft에 대한 동작을 확인할 수 있습니다.


name: Consensus-Visualization Consensus - A Visualization ————————-



.center[

Raft Consensus Visualization ]


name: Consensus-Modes class: compact Consensus - Consistency Modes ————————-

내부적으로 Consensus를 이해할 필요는 없지만 워크로드에 맞게 최적화 할 수 있도록 다양한 일관성관련 모드를 이해해야합니다.


name: Consensus-Deployment-Table class: compact Consensus - Deployment Table ————————-


<table class="tg" width=60%> Servers Quorum Size Failure Tolerance 1 1 0 3 2 1 5 3 2 </table>

이 표는 다양한 클러스터 크기에 대한 쿼럼 크기 및 내결함성을 보여줍니다. 권장되는 배포는 서버 3 개 또는 5 개입니다. 장애 시나리오에서는 데이터 손실이 불가피하므로 개발을 제외하고 단일 서버 배포는 권장되지 않습니다. 가능한 경우 서버는 대기 시간이 짧은 별도의 영역에 있어야합니다.

??? Then, shalt thou count to three. No more. No less. Three shalt be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, nor either count thou two, excepting that thou then proceed to three. Five is right out.


name: Introduction-to-Gossip Introduction to Gossip ————————- Consul은 Gossip 프로토콜을 사용하여 구성원을 관리하고 클러스터에 메시지를 브로드 캐스트합니다. 이 모든 것은 Serf 라이브러리를 사용하여 제공됩니다. Serf에서 사용하는 가십 프로토콜은 “SWIM : 확장 가능한 약하게 일관된 감염 스타일 프로세스 그룹 멤버쉽 프로토콜”을 기반으로하며 약간의 조정이 있습니다.

You can read more about Serf here.

Consul gossip이 동작하는 두개의 주요 풀:


name: Introduction-to-Gossip-LAN-Pool Introduction to Gossip - LAN Pool ————————-

??? Each datacenter Consul operates in has a LAN gossip pool containing all members of the datacenter, both clients and servers. The LAN pool is used for a few purposes. Membership information allows clients to automatically discover servers, reducing the amount of configuration needed. The distributed failure detection allows the work of failure detection to be shared by the entire cluster instead of concentrated on a few servers. Lastly, the gossip pool allows for reliable and fast event broadcasts.


name: Introduction-to-Gossip-WAN-Pool Introduction to Gossip - WAN Pool ————————-

??? The WAN pool is globally unique, as all servers should participate in the WAN pool regardless of datacenter. Membership information provided by the WAN pool allows servers to perform cross datacenter requests. The integrated failure detection allows Consul to gracefully handle an entire datacenter losing connectivity, or just a single server in a remote datacenter.


name: Introduction-to-Gossip-Visualization-50-Node class: compact Introduction to Gossip - Visualization ————————- .center[:scale 30%] .center[50 nodes, ~3.56 gossip cycles]

Consul의 Gossip은 대수적으로 확장되므로 모든 노드에 도달하려면 O (logN) 라운드가 필요합니다. 50 노드 클러스터의 경우 모든 노드에 도달하는 데 약 3.56주기를 추정 할 수 있습니다.


name: Introduction-to-Gossip-Visualization-100-Node class: compact Introduction to Gossip - Visualization ————————- .center[:scale 30%] .center[100 nodes, ~4.19 gossip cycles]

100 개 노드 클러스터의 경우 이는 모든 노드에 도달하는 데 약 4.19주기를 의미합니다. 정말 빠르고 안정된 모델입니다. 대규모 클러스터에 대해 살펴 보겠습니다.


name: Introduction-to-Gossip-Convergence Introduction to Gossip - Convergence ————————- .center[:scale 80%] .center[10,000개 노드, ~2초내로 수렴]

위의 그래프는 10k 노드 클러스터를 기반으로 다양한 컨버전스 상태에 도달하는 예상 시간을 보여줍니다. 단 2 초 만에 거의 100 %의 노드에 수렴 할 수 있습니다!

??? All the agents that are in a datacenter participate in a gossip protocol. This means there is a gossip pool that contains all the agents for a given datacenter. This serves a few purposes: first, there is no need to configure clients with the addresses of servers; discovery is done automatically. Second, the work of detecting agent failures is not placed on the servers but is distributed. This makes failure detection much more scalable than naive heartbeating schemes. It also provides failure detection for the nodes; if the agent is not reachable, then the node may have experienced a failure.