In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Consul introduction
Consul is an open source tool developed by HashiCorp, which is used to realize service discovery and configuration in distributed systems. Unlike other distributed service registration and discovery solutions, Consul's solution is more "one-stop", with built-in service registration and discovery framework, distributed consistency protocol implementation, health check, Key/Value storage, multi-data center solution, and no longer need to rely on other tools (such as ZooKeeper, etc.). It is also easier to use. Consul is written in the Go language, so it is naturally portable (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. Friends who are willing to understand the source code directly ask for communication and sharing technology: 2147775633
Advantages of Consul:
Using Raft algorithm to ensure consistency is more direct than complex Paxos algorithm. By comparison, zookeeper uses Paxos, while etcd uses Raft.
Multiple data centers are supported, and different ports are used to monitor the services of internal and external networks. Multi-data center cluster can avoid a single point of failure of a single data center, while its deployment needs to consider network delay, fragmentation and so on. Neither zookeeper nor etcd provides support for multiple data center capabilities.
Health check-up is supported. Etcd does not provide this feature.
Http and dns protocol interfaces are supported. The integration of zookeeper is complex, and etcd only supports http protocol.
Web management interface is officially provided, but etcd does not have this function.
In a comprehensive comparison, Consul, as a new star of service registration and configuration management, is worthy of attention and research.
Properties:
Service discovery
Health examination
Key/Value storage
Multiple data centers
Consul role
Client: client, stateless, forwards HTTP and DNS interface requests to the server cluster in the local area network.
Server: server side, save configuration information, highly available cluster, communicate with local clients in the local area network, and communicate with other data centers through the wide area network. The recommended number of server per data center is 3 or 5.
The Consul client and server also support the use of the boast center, which further improves its high availability.
How Consul works:
1. When Producer starts, a post request is sent to Consul, telling Consul its IP and Port
2. After Consul receives the registration of Producer, it sends a request for health check to Producer every 10s (default) to check whether Producer is healthy.
3. When Consumer sends a GET request / api/address to Producer, it will first get a temporary table of storage services IP and Port from Consul, get the IP and Port of Producer from the table, and then send the GET request / api/address
4. The temporary table is updated every 10 seconds and contains only the Producer that has passed the health check.
The Spring Cloud Consul project is a service governance implementation for Consul. Consul is a distributed, highly available system that contains multiple components, but as a whole, it provides tools for service discovery and service configuration for our infrastructure in the micro-service architecture.
The technical architecture diagram is as follows:
Sources of data and source
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.