Nacos FAQ

Quick Start Questions

What operating systems does Nacos support?

Nacos supports Linux, Unix, Mac, and Windows operating systems. Linux/Unix/Mac is recommended for production environments.

What Java version does Nacos require?

Nacos requires JDK 17 or higher. Make sure JAVA_HOME is properly configured.

What should I do if Nacos fails to start?

  1. Check Java environment: Run java -version to confirm the correct JDK version
  2. Check port usage: Confirm ports 8848 and 9848 are not occupied
  3. Check logs: Review error messages in logs/start.out or logs/nacos.log
  4. Check authentication configuration: Nacos 3.0+ requires authentication-related parameters

How to change the default Nacos port?

Modify the following configuration in conf/application.properties:

server.port=8848

What are the Nacos console default credentials?

  • Default username: nacos
  • Default password: nacos@demo

Please change the default password in production environments.

Service Discovery Questions

After successful service registration, why can't the client discover the service?

  1. Check service health status: Ensure the instance status is healthy
  2. Check network connectivity: Ensure the client can access the Nacos server
  3. Check service name: Ensure the queried service name matches the registered one (including namespace and group)
  4. Check client configuration: Confirm the nacos.server-addr configuration is correct

How to implement load balancing?

Nacos provides multiple load balancing strategies:

  1. Client-side load balancing: Use the selectOneHealthyInstance method from Nacos SDK
  2. Weighted load balancing: Implement by setting instance weights
  3. Cluster load balancing: Automatically implemented in cluster environments

After a service instance goes offline, why does the client still call the offline instance?

  1. Check health check configuration: Ensure the health check mechanism is working properly
  2. Check client cache: Clients cache service instance lists with some delay
  3. Adjust synchronization interval: Modify the client's refresh interval

Configuration Management Questions

After publishing configuration, why doesn't the client receive update notifications?

  1. Check listener: Ensure the client has correctly added a configuration listener
  2. Check network: Ensure network connectivity is normal
  3. Check logs: Review error messages in client logs
  4. Confirm dataId and group: Ensure they match exactly

How to achieve multi-environment configuration management?

  1. Use Namespace: Different environments use different namespaces for complete isolation
  2. Use Group: Use different groups under the same namespace to manage configurations
  3. Use DataId: Use different dataIds to distinguish configurations for different environments

How to view configuration history versions?

The Nacos console provides configuration change history, allowing you to view:

  • Configuration modification records
  • Content comparison for each modification
  • One-click rollback to historical versions

How to implement configuration canary release?

Nacos supports configuration canary release:

  1. Create canary configuration in the console
  2. Specify the canary client scope
  3. Verify canary configuration effect
  4. Full release or rollback

Cluster Deployment Questions

How many nodes are required for Nacos cluster deployment?

At least 3 nodes are recommended for production environments to ensure high availability.

How to choose data storage in cluster mode?

  • Test/Development environment: Can use built-in Derby database
  • Production environment: Must use external database (MySQL) to ensure data reliability

How does cluster ensure data consistency?

Nacos uses self-developed Distro protocol and Raft protocol to ensure cluster data consistency:

  • Distro protocol: Responsible for data synchronization
  • Raft protocol: Responsible for leader election and log replication

What happens when a cluster node fails?

Nacos cluster has automatic failover capabilities:

  1. Health checks automatically detect failed nodes
  2. Traffic automatically switches to healthy nodes
  3. Failed nodes automatically synchronize data after recovery

Authentication and Security Questions

How to configure authentication in Nacos 3.0?

Starting from Nacos 3.0, authentication is enabled by default. The following parameters need to be configured on startup:

# Token secret key
nacos.core.auth.plugin.nacos.token.secret.key=<your-base64-secret-key>

# Service identity key
nacos.core.auth.server.identity.key=<your-identity-key>
nacos.core.auth.server.identity.value=<your-identity-value>

How to disable Nacos authentication?

Modify conf/application.properties:

nacos.core.auth.enabled=false

Note: Disabling authentication is not recommended in production environments.

How to assign permissions to different users?

Nacos supports role-based access control:

  1. Create users in the console
  2. Assign roles to users
  3. Configure role permissions

MCP Questions

What should I do if compatibility issues occur when starting MCP Server?

Ensure the auto-registered MCP Server data is compatible with the corresponding version in Nacos:

  • Is the MCP Server protocol (stdio, sse, streamable) consistent?
  • Is the service reference consistent?
  • Is the Tools data consistent (Tools name, Tools count, parameter types, optional parameters)?

Note: Tools descriptions and parameter descriptions do not need to be consistent.

Why can't discovered MCP Server be found after registration?

  1. Check MCP Server status: Ensure the service is correctly registered
  2. Check namespace: Ensure the client and service are in the same namespace
  3. Check authentication information: Ensure username and password are correct

How to dynamically modify MCP Server tool configuration?

After MCP Server is automatically registered to Nacos, you can dynamically change MCP Server Tools descriptions and switches in the console. Related modifications will be dynamically applied to the MCP Server at runtime without restarting the service.

Performance and Optimization Questions

How does Nacos handle large-scale service registration?

Nacos was born from Alibaba's millions of instances scale and has the following capabilities:

  • High-performance service registration and discovery
  • Low-latency configuration update response
  • Massive-scale service and configuration management

How to optimize Nacos performance?

  1. Set health check intervals appropriately
  2. Use appropriate database connection pool configuration
  3. Enable client-side caching to reduce request frequency
  4. Plan namespaces and groups reasonably

Memory configuration recommendations?

Based on service scale:

  • Small scale (services < 1000): 2C4G
  • Medium scale (services 1000-5000): 4C8G
  • Large scale (services > 5000): 8C16G+

Ecosystem Integration Questions

How to integrate Nacos with Spring Cloud?

Add dependencies to pom.xml:

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    <version>2023.0.3.2</version>
</dependency>
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    <version>2023.0.3.2</version>
</dependency>

How to integrate Nacos with Kubernetes?

Nacos supports deployment in Kubernetes environments using:

  • Helm Chart deployment
  • Operator deployment
  • Custom YAML deployment

What languages does Nacos support SDKs for?

Nacos provides SDKs for the following languages:

  • Java (official)
  • Python
  • Go
  • Node.js
  • C/C++
  • Ruby
  • PHP

Troubleshooting

How to troubleshoot service registration failures?

  1. Check if Nacos Server is running properly
  2. Check network connectivity
  3. Review client logs
  4. Confirm registration parameters are correct

How to troubleshoot configuration retrieval issues?

  1. Confirm configuration was published successfully
  2. Check if dataId and group match
  3. Check if listeners are correctly added
  4. Review client logs for specific errors

Where are Nacos logs located?

Nacos log files are located at:

  • Main log: logs/nacos.log
  • Startup log: logs/start.out
  • Access log: logs/access.log

Upgrade and Migration

How to upgrade from Nacos 1.x to 2.x or 3.x?

  1. Backup data: Backup database or snapshot files
  2. Read upgrade guide: Check corresponding version upgrade documentation
  3. Gradual upgrade: Test in staging environment first
  4. Migrate configurations: Pay attention to authentication and other configuration changes

How to migrate Nacos data?

  1. Export original environment configuration data
  2. Import to new environment database
  3. Verify data integrity
  4. Switch traffic to new environment