Nacos — Dynamic Service Discovery & Config Management
Open source service discovery, configuration, and service management platform for cloud native and microservices applications.
What it is
Nacos (Naming And Configuration Service) is an Alibaba-incubated, Apache 2.0 licensed platform that combines service registry, dynamic configuration, and service management. It targets the same problems as Eureka, Consul, and Spring Cloud Config but bundles them into a single server with one console and one SDK.
It is designed for teams building microservices with Spring Cloud, Dubbo, gRPC, or Kubernetes who need a centralized place for service discovery and configuration hot-reload.
How it saves time or tokens
Running separate systems for service discovery (Eureka or Consul) and configuration (Spring Cloud Config or etcd) increases operational overhead. Nacos consolidates both into one process with one admin console. Dynamic configuration with namespace isolation and version history means developers push config changes without restarting services. The built-in health check system detects unhealthy instances and routes traffic away automatically.
How to use
- Start a standalone Nacos server with Docker.
docker run -d --name nacos -p 8848:8848 -p 9848:9848 \
-e MODE=standalone nacos/nacos-server:v2.4.3
- Open the console at
http://localhost:8848/nacos(default credentials: nacos/nacos).
- Register a service programmatically.
curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=demo&ip=10.0.0.1&port=8080'
Example
Publishing and reading a configuration key:
# Publish config
curl -X POST 'http://127.0.0.1:8848/nacos/v1/cs/configs' \
-d 'dataId=app.properties&group=DEFAULT_GROUP&content=db.url=jdbc:mysql://localhost:3306/mydb'
# Read config
curl 'http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=app.properties&group=DEFAULT_GROUP'
Spring Boot apps using nacos-config-spring-boot-starter pick up changes automatically without restart.
Related on TokRepo
- DevOps tools -- Infrastructure tools for cloud-native service management.
- Self-hosted tools -- Run your own service discovery and config management.
Common pitfalls
- Standalone mode uses embedded Derby. For production, configure an external MySQL backend for high availability.
- Nacos 2.x uses gRPC on port 9848 in addition to HTTP on 8848. Ensure both ports are open in your firewall rules.
- The default credentials (nacos/nacos) must be changed before exposing the console to any network beyond localhost.
Frequently Asked Questions
Both provide service discovery and key-value configuration. Nacos adds first-class support for Spring Cloud and Dubbo SDKs, namespace isolation for multi-tenant environments, and a built-in configuration version history. Consul offers a stronger service mesh story with Connect. The choice often depends on your existing stack.
Yes. Nacos can sync with Kubernetes service endpoints. It also runs inside Kubernetes as a StatefulSet. For teams already using Kubernetes DNS-based discovery, Nacos adds dynamic configuration and health checking on top.
Nacos supports both AP (Distro protocol) for ephemeral service instances and CP (Raft) for persistent service instances and configuration data. You choose per service based on your consistency requirements.
Yes. When a configuration value changes in Nacos, connected clients receive a push notification and update in-memory values without restarting. This works with Spring Boot, Dubbo, and custom SDK integrations.
Nacos has been used in production at Alibaba and many other organizations. For production deployments, run at least three Nacos nodes with an external MySQL database for metadata storage and configure authentication.
Citations (3)
- Nacos GitHub— Nacos is an Alibaba-incubated platform under Apache 2.0 license
- Nacos Architecture Docs— Supports CP (Raft) and AP (Distro) consistency models
- Nacos Documentation— First-class support for Spring Cloud, Dubbo, and gRPC
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.