In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
What is consul?
Consul is a service software that supports multi-data center distributed and highly available service discovery and configuration sharing. It is developed by HashiCorp in GE language and is open source based on Mozilla Public License 2.0 protocol. It has natural portability (supports Linux, windows and Mac OS X); the installation package contains only one executable file, which is easy to deploy and works seamlessly with lightweight containers such as Docker.
Similar products with Consul are: Zookeeper, Doozer, Etcd.
2. Characteristics
1. Service registration: through HTTP API or DNS, tell the service registry that a new service has joined.
two。 Service discovery: through HTTP API or DNS, you can know the address and port of the target service.
3. Health check: support a variety of methods, HTTP, TCP, Docker, Shell script customized monitoring.
4. Configuration template: Consul Template is responsible for obtaining information from the service registry on a regular basis and automatically updates the configuration file and reloads it if there is any change.
5. Visual Web interface
6. Support for multiple data centers
Add:
What is service registration?
A: the process by which a service registers its location information with the Central Registration Node. The service generally registers its host IP address and port number, and sometimes has authentication information for service access, usage protocol, version number, and details about the environment.
What is service discovery?
A: service discovery allows an application or component to discover information about its operating environment and other applications or components. Users can configure a service discovery tool to separate the actual container from the running configuration. Common configuration information includes: ip, port number, name, etc.
Third, application scenarios
Registration of 1.docker and CoreOS instances in configuration sharing
2.Vitess cluster
Configuration sharing of 3.SaaS applications
4. Integrate with confd services to dynamically generate nginx and haproxy configuration files
IV. Advantages
1. Using the Raft algorithm to maintain consistency is more direct than the paxos algorithm, and zookeeper uses the paxos algorithm
two。 Multiple data centers are supported, and different ports are used to monitor internal and external network services to avoid a single point of failure. Zookeeper and other services do not support multiple data centers.
3. Support health monitoring
4. Supports the interface between http protocol and dns protocol
5. Provide web interface
V. system architecture
This is a typical system structure diagram provided by the official website of Consul.
Consul recommends that each DataCenter should have 3-5 Server nodes, mainly to facilitate failure and data replication performance; the number of Client is arbitrary.
All nodes of DataCenter participate in the Gossip protocol; Client to Server pass through LAN Gossip. All the nodes are in the Gossip pool, and the communication between the nodes is realized through the message layer to achieve the purpose of fault detection, and there is no need to configure the Server address to the Client.
The Server node also participates in the WAN Gossip pool, and the Server node allows simple service discovery between DataCenter. For example, adding a Datacenter only requires the Server node to participate in the Gossip Pool. Moreover, the communication and service requests between DataCneter can randomly request the Server node of another DataCenter through WAN Gossip, and then the requested Server will foword the request to the leader node of this DataCenter.
The election of Server leader is achieved through Consul's Raft algorithm, the leader node is responsible for all requests and processing, and these requests must be copied to all other non-leader server nodes. When a non-leader node receives a RPC request, it also forward to the leader node.
Note: for the detailed election process of leader, please refer to the Raft algorithm. If you have time, you can study the Raft algorithm and Paxos algorithm.
VI. Installation and deployment of Console
Please see the next tweet for details.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.