# Nacos — Dynamic Service Discovery & Config Management > Open source service discovery, configuration, and service management platform for cloud native and microservices applications. ## Install Save as a script file and run: # Nacos — Dynamic Service Discovery & Config Management ## Quick Use ```bash # Docker quickstart (standalone) docker run -d --name nacos -p 8848:8848 -p 9848:9848 -e MODE=standalone nacos/nacos-server:v2.4.3 # Console at http://localhost:8848/nacos (nacos/nacos) # Register a service with curl curl -X POST 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=demo&ip=10.0.0.1&port=8080' ``` ## Introduction Nacos (Naming And Configuration Service) is an Alibaba-incubated, Apache 2.0 platform combining 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. ## What Nacos Does - Service registry with heartbeat-based health checks for REST/RPC services. - Dynamic configuration with hot-reload, namespaces, groups, and versioning. - DNS-based and RPC-based service discovery, pluggable load balancing. - Multi-datacenter replication and CP/AP consistency modes via Raft or Distro. - First-class support for Spring Cloud, Dubbo, gRPC, and Kubernetes. ## Architecture Overview Nacos runs one Java process that exposes an HTTP/gRPC API (port 8848 + 9848). It stores metadata in an embedded Derby or an external MySQL for HA. The naming subsystem uses the Distro protocol (AP) by default for ephemeral instances, and JRaft (CP) for persistent ones; the config subsystem snapshots data to disk and notifies subscribers over long-polling or gRPC streams. ## Self-Hosting & Configuration - Standalone mode: one container, Derby storage, good for dev and small clusters. - Cluster mode: 3+ nodes behind a VIP with MySQL 8 as the shared datastore. - Authentication: set `nacos.core.auth.enabled=true` and configure JWT secret. - Namespaces isolate tenants; groups isolate applications within a namespace. - Helm chart `nacos/nacos` deploys a StatefulSet with readiness probes. ## Key Features - One binary for both discovery and config — no two services to run. - Push-based config updates: clients see changes in under a second. - Listens for Kubernetes Service changes and mirrors them to the registry. - Weight and metadata driven traffic shaping without a service mesh. - MCP gateway plugin exposes services as Model Context Protocol tools. ## Comparison with Similar Tools - **Consul** — comparable discovery, stronger KV and ACL model, but no built-in Spring Cloud story. - **Eureka** — simpler AP-only registry, no config component, now in maintenance. - **etcd** — lower-level KV, you build discovery yourself. - **Spring Cloud Config** — git-backed config only, no registry. - **Zookeeper** — classic coordination primitive, no HTTP console. ## FAQ **Q:** Is Nacos production-ready outside the JVM world? A: Yes — it ships SDKs for Go, Python, Node.js, C#, and Rust, all speaking the same gRPC API. **Q:** CP or AP? A: Ephemeral instances default to AP (Distro); persistent ones use CP (JRaft). You pick per-service. **Q:** How do I migrate from Eureka? A: Enable the Eureka protocol adapter on the Nacos server and point clients at the Nacos address. **Q:** Does it replace a service mesh? A: No — Nacos handles discovery and config; mTLS, retries, and traffic splitting still need Istio or similar. ## Sources - https://github.com/alibaba/nacos - https://nacos.io/en/docs/latest/what-is-nacos/ --- Source: https://tokrepo.com/en/workflows/a7a61cf9-3918-11f1-9bc6-00163e2b0d79 Author: Script Depot