nacos principle

1. What is Nacos

Nacos committed to helping you discover, configure, and micro-management services. Nacos provides a set of simple-to-use set of features that help you quickly realize dynamic service discovery, service configuration, service metadata and traffic management. Spring Cloud A is registered in the service discovery component, similar to the Consul, Eureka, but it also provides the ability to configure distributed centers, similar to this point and Consul of config, support hot load.

2.Nacos principle

Here Insert Picture Description
Nacos registry is divided into server and client, server written in Java, provide registration service discovery and configuration services for the client. And may be multi-language client, client services micro nested together, nacos provide sdk and openApi, if not sdk can write logical service registration and discovery and configuration in accordance with the pulled manually OpenAPI

Here Insert Picture Description
Services model

Nacos services model is divided into namespaces, clustered service. Hierarchical storage model following figure can be seen, at the service level, save health check switch, metadata routing mechanism, protection threshold and the like is provided, and the cluster holds the health check mode, the metadata synchronization data, examples preserved ip this example, port number, weight, health status check, offline state, metadata, response time.

Here Insert Picture Description

3. Principle registry

Here Insert Picture Description
Service Registration Methods: Java nacos client v1.0.1 as an example, the strategy is a registered service every 5 seconds nacos server sends a heartbeat, heart to bring the service name, information service ip, port services and so on. Meanwhile nacos server will initiate a health check to the client, support for tcp / http examination. If there is no heartbeat within 15 seconds and the health check failed believes unhealthy instance, if a health check fails removed within 30 seconds examples.

4. Configure the central principle

Here Insert Picture Description

5.Nacos key features include:

  • 服务发现和服务健康监测
    Nacos 支持基于 DNS 和基于 RPC 的服务发现。服务提供者使用
    原生SDK、OpenAPI、或一个独立的Agent TODO注册 Service 后,服务消费者可以使用DNS TODO
    或HTTP&API查找和发现服务。

    Nacos 提供对服务的实时的健康检查,阻止向不健康的主机或服务实例发送请求。Nacos 支持传输层 (PING 或 TCP)和应用层
    (如 HTTP、MySQL、用户自定义)的健康检查。 对于复杂的云环境和网络拓扑环境中(如 VPC、边缘网络等)服务的健康检查,Nacos
    提供了 agent 上报模式和服务端主动检测2种健康检查模式。Nacos
    还提供了统一的健康检查仪表盘,帮助您根据健康状态管理服务的可用性及流量。

  • 动态配置服务
    动态配置服务可以让您以中心化、外部化和动态化的方式管理所有环境的应用配置和服务配置。

    动态配置消除了配置变更时重新部署应用和服务的需要,让配置管理变得更加高效和敏捷。

    配置中心化管理让实现无状态服务变得更简单,让服务按需弹性扩展变得更容易。

Nacos 提供了一个简洁易用的UI (控制台样例 Demo) 帮助您管理所有的服务和应用的配置。Nacos 还提供包括配置版本跟踪、金丝雀发布、一键回滚配置以及客户端配置更新状态跟踪在内的一系列开箱即用的配置管理特性,帮助您更安全地在生产环境中管理配置变更和降低配置变更带来的风险。

  • Dynamic DNS Dynamic DNS service
    re-routing services to support the right to make it easier for you to achieve the intermediate layer load balancing, simple DNS resolution service more flexible policy routing, flow control, and network data center. Dynamic DNS service also allows you to more easily implement
    DNS-based service discovery protocol, to help you eliminate coupling to a private vendor service discovery risk on the API.

    Nacos provides some simple DNS APIs TODO help you manage domain names and associated services available IP: lists PORT.

  • Service and metadata management Nacos
    allow you all the services and metadata perspective of micro-managing data center service platform from, including a description of management services, lifecycle services rely on static analysis, state health services, traffic services management, routing and security policies, services
    SLA and the most important metrics statistics.

More features list ...

6.Spring Cloud Nacos advantages and disadvantages

Advantages: 1) out of the box for dubbo, spring cloud

        2)AP模型,数据最终一致性

        3)注册中心,配置中心二合一,提供控制台管理

        4)纯国产,久经双十一考验

Disadvantages: 1) Just open soon, community heat is not enough, there is still bug

        2)0.5.0 注册服务无鉴权认证机制,存在风险
Published 18 original articles · won praise 0 · Views 760

Guess you like

Origin blog.csdn.net/qq_45122010/article/details/104079392