All Products
Search
Document Center

Microservices Engine:Why do HTTP or TCP health checks always report unhealthy for persistent instances in MSE Nacos?

Last Updated:Mar 11, 2026

When you register a persistent service provider with a Microservices Engine (MSE) Nacos instance, HTTP and TCP health checks always report the instance as unhealthy -- even if the instance is running normally.

Why this happens

Nacos uses two health check models depending on the instance type:

Instance typeParameterHealth check directionHow it works
Ephemeral (default)ephemeral=trueInstance to serverThe service instance sends heartbeats to the Nacos server.
Persistentephemeral=falseServer to instanceThe Nacos server actively probes the service instance by sending HTTP or TCP requests to it.

MSE Nacos is a managed service that runs in an isolated network, separate from your applications. For security, the network layer blocks outbound requests from the MSE Nacos server to service instances. Because persistent instances rely on server-initiated probes, health checks always time out and report the instance as unhealthy.

Ephemeral instances are unaffected because the health check direction is reversed: the instance sends heartbeats to the Nacos server, which the network layer allows.

Solution: switch to ephemeral instances

Register the service as ephemeral by setting ephemeral to true. Because true is the default value, removing the ephemeral parameter entirely has the same effect.

Open API

curl -d 'serviceName=<your-service-name>' \
  -d 'ip=<your-instance-ip>' \
  -d 'port=<your-instance-port>' \
  -d 'ephemeral=true' \
  -X POST 'http://<nacos-server-address>/nacos/v2/ns/instance'

Replace the placeholders with your actual values:

PlaceholderDescriptionExample
<your-service-name>Service namemy-service
<your-instance-ip>IP address of the service instance192.168.1.100
<your-instance-port>Port of the service instance8080
<nacos-server-address>MSE Nacos instance addressmse-xxx.nacos.mse.aliyuncs.com:8848

Spring Cloud Alibaba

Add the following property to your application configuration:

spring.cloud.nacos.discovery.ephemeral=true

If your configuration does not explicitly set ephemeral, the default is already true and no change is needed. Look for an explicit ephemeral=false setting and remove or change it.