Documentation

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.2 public testing for community currently.

Note that the ALPHA version is only for testing and discussion, please use it in uat or pre-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.

Benchmark for Nacos 2.0.0-ALPHA

Detail see: Nacos2.0 Naming Benchmark and Nacos2.0 Config Benchmark .

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 (Supported)
  • 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 (Supported)
  • Delete service (Supported)
  • 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 update cluster metadata

Ecological compatibility

Spring Cloud Alibaba

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

    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        <version>2.1.5.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        <version>2.1.5.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.alibaba.nacos</groupId>
        <artifactId>nacos-client</artifactId>
        <version>2.0.0-ALPHA.1</version>
    </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.

Parameters Default Description
nacos.naming.clean.empty-service.interval 60000(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-time 60000(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.interval 5000(ms) The interval time of Nacos auto clean expired metadata.
nacos.naming.clean.expired-metadata.expired-time 60000(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...