Choosing the Right Nacos Cluster Deployment: Direct, VIP, or Address Server

This article compares three Nacos cluster deployment patterns—direct connection, VIP (Virtual IP), and address server—detailing their configurations, advantages, and trade‑offs for high availability, scalability, and operational complexity in production environments.

Programmer DD
Programmer DD
Programmer DD
Choosing the Right Nacos Cluster Deployment: Direct, VIP, or Address Server

1 Introduction

Nacos supports single‑node and cluster deployment modes. While single‑node is convenient for development and testing, production requires a cluster for high availability. This article introduces three practical cluster deployment patterns from the client perspective: direct mode, VIP mode, and address server mode.

2 Direct Mode

Direct mode is the simplest and easiest to understand. A typical development configuration looks like this:

Properties properties = new Properties();
properties.setProperty(PropertyKeyConst.SERVER_ADDR, "192.168.0.1:8848,192.168.0.2:8848,192.168.0.3:8848");
NamingService namingService = NacosFactory.createNamingService(properties);

Dubbo configuration:

dubbo.registry.address=192.168.0.1:8848,192.168.0.2:8848,192.168.0.3:8848
dubbo.registry.protocol=nacos

When server IPs change (e.g., scaling, migration), all applications must be updated, making this mode unsuitable for production.

High availability: low, because code changes are required for node failures.

Scalability: low.

Simple architecture and low operational cost.

No additional components required.

3 VIP Mode

VIP (Virtual IP) abstracts the real server IPs, allowing clients to connect to a stable virtual address. This solves the IP‑change problem of direct mode.

Typical configuration replaces the server address with a VIP placeholder:

Properties properties = new Properties();
properties.setProperty(PropertyKeyConst.SERVER_ADDR, "{VIP}:8848");
NamingService namingService = NacosFactory.createNamingService(properties);

Dubbo configuration:

dubbo.registry.address={VIP}:8848
dubbo.registry.protocol=nacos

In practice a domain name is often bound to the VIP for readability and redundancy. A domain can hold multiple A records, each pointing to a different VIP, enabling smooth failover.

Tip: A domain can bind multiple A records; DNS will load‑balance and health‑check them.

VIP mode provides strong high availability and scalability but requires a load‑balancer component, increasing operational cost.

4 Address Server Mode

The address server returns a list of Nacos node addresses, decoupling client configuration from the cluster. Clients poll the address server to obtain the latest node list.

A simple Java address server implementation:

@Controller
public class AddressServerController {
    @RequestMapping("/nacos/serverlist")
    public ResponseEntity<String> serverlist() {
        return ResponseEntity.ok()
            .header("Content-Type", "text/plain")
            .body("192.168.0.1:8848
" +
                  "192.168.0.2:8848
" +
                  "192.168.0.3:8848
");
    }
}

Client configuration for address server mode:

Properties properties = new Properties();
properties.setProperty(PropertyKeyConst.ENDPOINT, "{addressServerDomain}");
properties.setProperty(PropertyKeyConst.ENDPOINT_PORT, "8080");
NamingService namingService = NacosFactory.createNamingService(properties);

Dubbo configuration:

dubbo.registry.address=0.0.0.0?endpoint=127.0.0.1&endpointPort=8080
dubbo.registry.protocol=nacos

When both serverAddr and endpoint are present, the client prefers the address server.

Dubbo passes URL KV parameters to Nacos‑client; use Dubbo >= 2.7.4 and nacos‑client >= 1.0.1 for address server mode.

Address server mode offers strong high availability and scalability with low operational cost.

5 Deployment Mode Comparison

Direct mode: weak HA, low cost, suitable for development/testing. VIP mode: strong HA and scalability, higher cost due to load‑balancer, ideal for production and cloud environments. Address server mode: strong HA and scalability, low cost, suitable for production where a simple address decoupling is sufficient.

6 MSE Nacos Practice

Alibaba Cloud MSE provides a fully managed Nacos registry. The production architecture uses domain + SLB (VIP) mode, with separate public and private domains. The public domain can be used for local testing or hybrid‑cloud scenarios, while the private domain serves the internal production environment.

The public domain has bandwidth limits and requires an IP whitelist; the private domain has no bandwidth restriction.

7 Conclusion

The article presented three Nacos deployment patterns, analyzed their high‑availability, scalability, and ease‑of‑use characteristics, and offered guidance for self‑built and cloud deployments, including the MSE Nacos enterprise architecture.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendMicroservicesDeploymenthigh availabilityservice discoveryNacos
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.