Nacos is an open source service discovery and configuration management project of Alibaba. Version 1.1.4 of this release mainly brings the docking function with Istio, using the latest MCP protocol of Istio. This article describes the features in the new release, including this feature.

Upgrade guide

The service side

Version 0.8.0 and above:

  • Decompress the installation package and replace {nacos.home}/target/nacos-server.jar
  • Restart the Nacos Server one by one
For versions earlier than 0.8.0, upgrade to 1.0.0 first.

The client

Just replace the POM dependencies.

Supports Istio MCP

This is the biggest update of this release, which mainly realizes the function of sending Nacos service data to Istio. It is also the first official MCP protocol interconnection version in all industry registries. Pilot’s latest design uses the MCP protocol to interact with all backend data sources. The benefit of this is that you can decouple the code of all extension components, and Pilot maintains lightweight logic, resulting in significant improvements in code quality, component stability, and extensibility. We can have a look at the Pilot design drawing officially provided by Pilot. Please refer to the address details here.



Figure 1 Pilot’s latest design concept diagram

Although Pilot back-end MCP Server has Consul, Eureka, etc., in the design drawing, none of these projects has officially supported MCP Server. Nacos is the first project to officially support the Istio MCP protocol.

For the design of the MCP protocol, refer to the Istio documentation. The MCP Server implemented by Nacos currently uses the mode of single service number and full service push, because the Pilot does not support incremental push of service data (after the release of Nacos 1.1.4, the Pilot has supported incremental push at the endpoint level. Nacos will also support it in the next version). The logic is to start a gRPC Server for MCP data transmission, the code can refer to here.

Figure 2 Nacos MCP Server architecture

You can use the Nacos MCP Server as follows: 1. Download the latest Nacos 1.1.4 installation package and decompress it. 2. Configure application.properties and restart Nacos.

nacos.istio.mcp.server.enabled=trueCopy the code
Note: If Nacos is clustered, you only need to configure one Server to start THE MCP Server, because the data of each Nacos Server is full. At the same time, the port used by the Nacos MCP Server is 18848. Check whether the ports conflict.

3. Configure Pilot using Nacos MCP Server:

configSources
-- address: x.x.x.x:18848Copy the code
4. Restart the Pilot.

Custom instance ID

In previous versions, the instanceId field of the Instance class was used to uniquely identify the Instance, and its value was not specified by the client by default. In version 1.1.4, we supported allowing clients to customize ids and a new instanceId generation algorithm: a unique integer within the service that can be used as a unique index for instances within the service. This feature was contributed by Vettal-Wu, thank you very much.

The example code for instanceId is as follows:

Instance instance = new Instance();
instance.setIp("1.1.1.1"); instance.setPort(80); // Ephemeral = must be setfalseTo ensure that the server uses a strict consistency protocol, otherwise it may cause the generated instance ID conflict: instance.setehpemeral (false);
instance.setMetadata(new HashMap<String, String>());
instance.getMetadata().put(PreservedMetadataKeys.INSTANCE_ID_GENERATOR, Constants.SNOWFLAKE_INSTANCE_ID_GENERATOR);Copy the code
Nacos also has some improved code quality updates in this release, which can be found in the issue list of version 1.1.4.

How to build the

To achieve this, you need to be actively involved in the Nacos community. If you find typos in your documentation, errors in your code, or want new features or suggestions, you can create issues on GitHub.

If you want to get started, you can select issues in the Github repository with the following tags. Good first Issue: This is a good introduction to issues for beginners. Contribution welcome: very important problems and very important modules, but currently lack of contributors, contributors are welcome to contribute.

The thriving Nacos community

DISS is cheap, show me your hand more important than teasing is helping the community develop Nacos

Follow and join the Nacos community as a user

The Nacos community is developing vigorously. As of the date of publication, Nacos has 9 wechat groups in just a few months, among which 7 are full, 1 QQ group and 1 Dingdinggroup. The number of community concerned about Nacos has nearly 5000 people, exchanging technology and experience with “Dao (basis) friends” in the Nacos group. Recruiting friends, grabbing red envelopes… It’s a joy.



  • Join the Nacos community as a code contributor
The growth from Nacos users to contributors is a natural progression, and indeed the Nacos development team has grown from 4 code contributors to more than 40. In version 1.1.4, developers contributing to the Nacos repository include: Stackisok, Loadchange, LY641921791, EZLippi, RushSky518, Universefeeler, Nkorange, Vettal-Wu, Beldon, etc.









The original link

This article is the original content of the cloud habitat community, shall not be reproduced without permission