Nacos — Dynamic Service Discovery & Config Management
Open source service discovery, configuration, and service management platform for cloud native and microservices applications.
Review-first install path
This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.
npx -y tokrepo@latest install a7a61cf9-3918-11f1-9bc6-00163e2b0d79 --target codexDry-run first, confirm the writes, then run this command.
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
GLPI — Open Source IT Asset and Service Management
GLPI is a self-hosted IT service management platform that combines asset inventory, help desk ticketing, license tracking, and data center management into a single web application used by thousands of organizations worldwide.
Netflix Eureka — Service Discovery for Cloud Microservices
Eureka is a REST-based service discovery server and client developed by Netflix for locating services in a mid-tier cloud environment for load balancing and failover.
Permify — Open Source Fine-Grained Authorization Service
Permify is an open-source authorization service inspired by Google Zanzibar that lets you define and enforce fine-grained, relationship-based access control across your applications.
Consul Template — Dynamic Configuration Rendering from HashiCorp Consul
A daemon that watches HashiCorp Consul and Vault for changes and renders Go templates into config files, then optionally reloads services.