Skip to content
欢迎报名8月2日上海首个AI原生应用架构开源沙龙!Know more

Cluster Deployment Guide

Cluster deployment instructions

Document optimizing…

This quick start manual assists you in rapidly downloading, installing, and using Nacos in a production-ready clustered mode on your computer.

Cluster Deployment Architecture

Open-source recommendations include placing all service lists under a VIP and associating it with a domain name.

  • <http://ip1:port/openAPI>: Direct IP mode requires IP modification when a machine fails.
  • <http://SLB:port/openAPI>: SLB (intranet) mounting mode is not to be exposed to the public network due to security risks.
  • <>: Domain + SLB (intranet) mode is recommended for its readability and easy IP swapping.


PortOffset from Main PortDescription
88480Primary port used by clients, console, and OpenAPI for HTTP requests.
98481000gRPC client request to server port, for client-initiated connections and requests.
98491001Server-to-server gRPC request port for service synchronization, etc.
7848-1000Jraft request to server port, for handling Raft-related requests among servers.

When using VIP/nginx, configure TCP forwarding instead of http2 to prevent connection termination by nginx. Ports 9849 and 7848 are for inter-service communication; do not expose them to external networks or clients.

1. Prerequisite Environment Preparation

Ensure the following are installed and used:

2. Obtain Source Code or Installation Package

Nacos can be obtained through two methods.

Download Source Code from GitHub

Terminal window
cd nacos/
mvn -Prelease-nacos clean install -U
cd nacos/distribution/target/nacos-server-1.3.0/nacos/bin

Download Compiled Package

Download from the latest stable version nacos-server-$ or nacos-server-$version.tar.gz.

Terminal window
unzip nacos-server-$ or tar -xvf nacos-server-$version.tar.gz
cd nacos/bin

3. Configure Cluster Configuration Files

Under the conf directory in the extracted nacos/, edit cluster.conf with each line as ip:port (minimum 3 nodes).

# ip:port

3.1 Enable Default Authentication Plugin (Optional)

Modify in the conf directory.


nacos.core.auth.plugin.nacos.token.secret.key=${custom, ensure consistency across all nodes}
nacos.core.auth.server.identity.key=${custom, ensure consistency across all nodes}
nacos.core.auth.server.identity.value=${custom, ensure consistency across all nodes}

For more details, refer to Authentication.

Note: The default values SecretKey012345678901234567890123456789012345678901234567890123456789 and VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= are public defaults, suitable for temporary testing. Replace with custom values for actual use.

4. Determine Data Source

Use Built-in Data Source

No configuration required.

Use External Data Source

Recommended for production in at least master-slave mode or with a highly available database.

Initialize MySQL Database

SQL script source Configuration file

5. Start Server


Standalone Mode

Terminal window
sh -m standalone

Cluster Mode

Built-in Data Source

Terminal window
sh -p embedded

External Data Source

Terminal window

6. Service Registration & Discovery and Configuration Management

Service Registration

Terminal window
curl -X POST ''

If the default authentication plugin is enabled, include credentials in the Header.

Service Discovery

Terminal window
curl -X GET ''

If the default authentication plugin is enabled, include credentials in the Header.

Publish Configuration

Terminal window
curl -X POST ""

If the default authentication plugin is enabled, include credentials in the Header.

Retrieve Configuration

Terminal window
curl -X GET "