You are currently viewing Consul 介紹

Consul 介紹

Consul 介紹

簡介

consul-sulotion

Consul 除了廣為熟知的自動發現功能外,近年來持續整合了 Service Mesh 以及 Zero Trust 的功能,提升安全性的同時,還可以降低網路設定的複雜度。

Consul 架構

consul-arch

Consul 的架構設計上使用相同的 Process 進行啟動,使用不同的設定檔即可讓節點成為不相同的腳色進行服務。

在一座 Datacenter 內主要由多台的 Server 組成 Cluster,並互相推選出 Leader 作為 Master,而其他的 Server node 則自動成為 Follower。當資料寫入到 Leader 後會快速的複寫到 Follower 中,並提供給 Client 進行查詢。

相較於 open source 中的功能,在 Enterperise 中甚至提供 Redundancy Zones 的功能進一步提高可用性。

如果在該 AZ 內的具有投票權的 Server 的服務死亡,會自動將該 AZ 內 non voting 的 Server 權限升級並替換成新的 Follower,如果該 AZ 全部離線,則會使用提其他 AZ 的 non voting 的 Server 進行替換。

Consul-redundancy-zones

系統需求

硬體需求

SizeCPUMemoryDisk CapacityDisk IODisk Throughput
Small2-4 core8-16 GB RAM100+ GB3000+ IOPS75+ MB/s
Large8-16 core32-64 GB RAM200+ GB7500+ IOPS250+ MB/s

Server agents 通常會使用 I/O Write 和 CPU read

注意:對於高工作負載,請確保硬碟支持大量 IOPS 以跟上快速的 Raft 日誌更新速率。

Network latency and bandwidth

latency and bandwidth

對於所有 Consul agent 之間使用 Lan gossip 發送的資料,必須滿足以下延遲要求:

  • 所有流量的平均 RTT 不能超過 50 毫秒。
  • 99% 的流量的 RTT 不能超過 100 毫秒。

Port and Protocal

NamePort / ProtocolSourceDestinationDescription
RPC8300 / TCPAll agents (client & server)Server agentsUsed by servers to handle incoming requests from other agents.
Serf LAN8301 / TCP & UDPAll agents (client & server)All agents (client & server)Used to handle gossip in the LAN. Required by all agents.
Serf WAN8302 / TCP & UDPServer agentsServer agentsUsed by server agents to gossip over the WAN to other server agents. Only used in multi-cluster environments.
HTTP/HTTPS8500 & 8501 TCPLocalhost of client or server agentLocalhost of client or server agentUsed by clients to talk to the HTTP API. HTTPS is disabled by default.
DNS8600 TCP & UDPLocalhost of client or server agentLocalhost of client or server agentUsed to resolve DNS queries.
gRPC (Optional)8502 TCPEnvoy proxyClient agent or server agent that manages the sidecar proxies service registrationUsed to expose the xDS API to Envoy proxies. Disabled by default.
Sidecar Proxy (Optional)21000 – 21255 TCPAll agents (client & server)Client agent or server agent that manages the sidecar proxies service registrationPort range used for automatically assigned sidecar service registrations.

Beck Yeh

熱愛學習於 Linux 與 程式設計 在網站中分享各式各樣學習到的新知識

發佈留言

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料