Nacos 2.0.0-ALPHA

After nearly 5 months of discussion and development in the community, the core features of Nacos 2.0.0 based on the long connection have been developed completely.

2.0.0-ALPHA.1 public testing for community currently.

Note that the ALPHA version is only for testing and discussion, please do not use it in a production environment. The interface API and features presentation results provided by the ALPHA version may be inconsistent with the release version, please refer to the release version.

The 2.0.0-ALPHA version is an independent version temporarily, and not support upgrade server from version 1.X to 2.0.0-ALPHA smoothly. The release version will support it. Please pay attention to the subsequent upgrade documents.

Deployment

Refer to Deployment Guide and replace the version to 2.0.0-ALPHA.

Features completion and adaptation for the old client

Configuration Management

JAVA SDK

  • Completely compatible with all interfaces of 1.X client;
  • Completely implement all interfaces of 2.X client.

Other SDK

  • Completely compatible

openAPI

  • Fully compatible with all openAPIs related to the configuration management.

Service Discovery

Due to major changes in the data model of service discovery, A few features are temporarily unsupported.

JAVA SDK

  • Not support registration of persistent instances temporarily;
  • Compatible with ephemeral instances interfaces;
  • Implement with ephemeral instances interfaces;

Other SDK

  • Compatible with all operation of ephemeral instances interfaces;

openAPI

  • Register instance (Only ephemeral)
  • Deregister instance (Supported)
  • Modify instance (Supported)
  • Query instances (Supported)
  • Query instance detail (Not support, not affect viewing details from the console)
  • Send instance beat (Supported)
  • Create service (Not support, not affect create service by register instance)
  • Delete service (Not support, clean service by auto clean empty service)
  • Update service (Supported)
  • Query service (Not support, not affect viewing details from the console))
  • Query service list (Supported)
  • Query system switches (Supported)
  • Update system switch (Supported)
  • Query system metrics (Supported)
  • Query server list (Supported)
  • Query the leader of current cluster (Deprecated)
  • Update instance health status (Not support)
  • Batch update instance metadata(Beta, Not support)
  • Batch delete instance metadata(Beta, Not support)

Console

  • Completely compatible with Config Management
  • Completely compatible with Authority Control
  • Completely compatible with Namespace
  • Completely compatible with Cluster Managerment
  • Completely compatible with most of Service Managerment
    • Not support create service manually
    • Not support delete service manually
    • Not support update cluster metadata

Ecological compatibility

Spring Cloud Alibaba

Use Nacos 2.0 connection features by specifying nacos-client version.

  1. <dependency>
  2. <groupId>com.alibaba.cloud</groupId>
  3. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  4. <version>2.1.5.RELEASE</version>
  5. <exclusions>
  6. <exclusion>
  7. <groupId>com.alibaba.nacos</groupId>
  8. <artifactId>nacos-client</artifactId>
  9. </exclusion>
  10. </exclusions>
  11. </dependency>
  12. <dependency>
  13. <groupId>com.alibaba.cloud</groupId>
  14. <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
  15. <version>2.1.5.RELEASE</version>
  16. <exclusions>
  17. <exclusion>
  18. <groupId>com.alibaba.nacos</groupId>
  19. <artifactId>nacos-client</artifactId>
  20. </exclusion>
  21. </exclusions>
  22. </dependency>
  23. <dependency>
  24. <groupId>com.alibaba.nacos</groupId>
  25. <artifactId>nacos-client</artifactId>
  26. <version>2.0.0-ALPHA.1</version>
  27. </dependency>

Dubbo

Because Dubbo obtains part of the Nacos client content through reflection in the configuration center (metadata center), it is temporarily incompatible with the 2.0.0-ALPHA.1 version. At present, we have communicated with the dubbo community to solve the adaptation problem as soon as possible.

Nacos Spring Boot

Nacos spring boot will release an ALPHA version with the new version of Nacos client.

Usage

SDK and Console

The usage of Nacos 2.0.0-ALPHA version is exactly the same as that of Nacos 1.X version. For the client interface, please refer to JAVA SDK of Nacos1.X.

Server

The deployment and usage of the Nacos 2.0.0-ALPHA server is not much different from the old version. Here only to describe the new configuration parameters in the new version.

ParametersDefaultDescription
nacos.naming.clean.empty-service.interval60000(ms)The interval time of Nacos auto clean empty service. This parameter will replace nacos.naming.empty-service.clean.period-time-ms in old version.
nacos.naming.clean.empty-service.expired-time60000(ms)The expired time for Nacos judge whether an empty service is expired. When an empty service has no updated for setting time, it will be removed.
nacos.naming.clean.expired-metadata.interval5000(ms)The interval time of Nacos auto clean expired metadata.
nacos.naming.clean.expired-metadata.expired-time60000(ms)The expired time for Nacos judge whether a metadata is expired. When services or instances removed and after setting time, the metadata of removed services or instances will be deleted.

FAQ

Why can’t upgrade smoothly? Can it be supported in future?

Since the service model and data model of the Nacos service discovery have been redesigned, the data structure has major changes, so smoothly upgrading are temporarily not supported.

When 2.0.0 Released, will support part of 1.X version to upgrade smoothly. Please pay attention to community and upgrade document.

Whether support the old client?

Configuration Management can support all clients after 1.0, and Service Management can support all client after 1.2.

So recommending use Nacos client after 1.2.0.

But Nacos 1.X client can’t use new connection features, so recommending to use 2.0.0 client strongly.

Error code:503,msg:server is DOWN now, please try again later! during using.

After version 1.4, Nacos use SOFA-Jraft to replace old raft implementation by nacos-self. Jraft will election leader with raft protocol and save the cluster metadata. If cluster restart with ip changed, it might cause Jraft can election leader successfully so that nacos can’t start up.

The solution is removed the data directory under nacos directory and restart.

Or use -Dnacos.server.ip=${domain} jvm parameters to start nacos and set domain list in nacos/conf/cluster.conf to avoid the ip change effect.

com.alibaba.nacos.consistency.entity can’t be found in source codes

This package will be auto-generated by protobuf, so if you want to read source code or do some develop, you can use mvn compile to generate them. If you are using IDEA, you can also use IDEA’s protobuf plugin.

To be added…