---
# System prepended metadata

title: Consul

---

# Consul

## 特點

### Service Discovery

如果某個 client 提供了某項服務（例如 API），其他的 client 可以透過 Consul 使用 DNS 或 HTTP 去發現這項服務

> **Service Discovery**: Clients of Consul can register a service, such as api or mysql, and other clients can use Consul to discover providers of a given service. Using either DNS or HTTP, applications can easily find the services they depend upon.

### Health Checking

可以去看 service 是否還活著，或是檢查使用率是否過低。

> **Health Checking**: Consul clients can provide any number of health checks, either associated with a given service ("is the webserver returning 200 OK"), or with the local node ("is memory utilization below 90%"). This information can be used by an operator to monitor cluster health, and it is used by the service discovery components to route traffic away from unhealthy hosts.

### KV Store

可以用來存值。

> **KV Store**: Applications can make use of Consul's hierarchical key/value store for any number of purposes, including dynamic configuration, feature flagging, coordination, leader election, and more. The simple HTTP API makes it easy to use.

### Secure Service Communication

可以為 service 建立、頒發 TLS 憑證。也可以定義讓特定的 services 可以互相往來，輕鬆讓服務可以被分段，不用靠複雜的網路設定或防火牆。

> **Secure Service Communication**: Consul can generate and distribute TLS certificates for services to establish mutual TLS connections. Intentions can be used to define which services are allowed to communicate. Service segmentation can be easily managed with intentions that can be changed in real time instead of using complex network topologies and static firewall rules.

### Multi Datacenter

> **Multi Datacenter**: Consul supports multiple datacenters out of the box. This means users of Consul do not have to worry about building additional layers of abstraction to grow to multiple regions.

## 架構

