SpringCloud Nacos Configurations

Nacos Config Starter Configurations

 

The following shows the other configurations of the starter of Nacos Config:

Configuration

Key

Default Value

Description

Server address

spring.cloud.nacos.config.server-addr

 

IP and port of the Nacos Server listener

Dataid from nacos config

spring.cloud.nacos.config.name

 

First take the prefix, then go to the name, and finally take spring.application.name

Dataid from nacos config

spring.cloud.nacos.config.prefix

 

First take the prefix, then go to the name, and finally take spring.application.name

Encode for nacos config content

spring.cloud.nacos.config.encode

 

Encode for nacos config content

GROUP for nacos config

spring.cloud.nacos.config.group

DEFAULT_GROUP

GROUP for nacos config

The suffix of nacos config dataId, also the file extension of config content.

spring.cloud.nacos.config.fileExtension

properties

The suffix of nacos config dataId, also the file extension of config content(now support properties or yaml(yml))

Timeout for get config from nacos

spring.cloud.nacos.config.timeout

3000

Timeout for get config from nacos

Endpoint

spring.cloud.nacos.config.endpoint

 

Endpoint

Namespace

spring.cloud.nacos.config.namespace

 

Namespace

AccessKey

spring.cloud.nacos.config.accessKey

 

Alibaba Cloud account accesskey

SecretKey

spring.cloud.nacos.config.secretKey

 

Alibaba Cloud account secretkey

The context path of Nacos Server

spring.cloud.nacos.config.contextPath

 

The context path of Nacos Server

Cluster name

spring.cloud.nacos.config.clusterName

 

Cluster name

Dataid for Shared Configuration

spring.cloud.nacos.config.sharedDataids

 

Dataid for Shared Configuration, split by ","

Dynamic refresh dataid for Shared Configuration

spring.cloud.nacos.config.refreshableDataids

 

Dynamic refresh dataid for Shared Configuration, split by ","

custom dataid

spring.cloud.nacos.config.extConfig

 

It’s a List,build up by Config POJO. Config has 3 attributes, dataIdgroup and refresh

 

Nacos Discovery Starter Configurations

The following shows the other configurations of the starter of Nacos Discovery:

Configuration

Key

Default Value

Description

Server address

spring.cloud.nacos.discovery.server-addr

 

IP and port of the Nacos Server listener

Service name

spring.cloud.nacos.discovery.service

${spring.application.name}

Name the current service

Weight

spring.cloud.nacos.discovery.weight

1

Value range: 1 to 100. The bigger the value, the greater the weight

Network card name

spring.cloud.nacos.discovery.network-interface

 

If the IP address is not specified, the registered IP address is the IP address of the network card. If this is not specified either, the IP address of the first network card will be used by default.

Registered IP address

spring.cloud.nacos.discovery.ip

 

Highest priority

Registered port

spring.cloud.nacos.discovery.port

-1

Will be detected automatically by default. Do not need to be configured.

Namespace

spring.cloud.nacos.discovery.namespace

 

A typical scenario is to isolate the service registration for different environment, such as resource (configurations, services etc.) isolation between testing and production environment

AccessKey

spring.cloud.nacos.discovery.access-key

 

Alibaba Cloud account accesskey

SecretKey

spring.cloud.nacos.discovery.secret-key

 

Alibaba Cloud account secretkey

Metadata

spring.cloud.nacos.discovery.metadata

 

You can define some of the metadata for your services in the Map format

Log file name

spring.cloud.nacos.discovery.log-name

   

Cluster Name

spring.cloud.nacos.discovery.cluster-name

DEFAULT

Cluster name of Nacos

Endpoint

spring.cloud.nacos.discovery.endpoint

 

The domain name of a certain service in a specific region. You can retrieve the server address dynamically with this domain name

Integrate Ribbon or not

ribbon.nacos.enabled

true

Set to true in most cases

Enable Nacos Watch

spring.cloud.nacos.discovery.watch.enabled

true

set to false to close watch

 

 

猜你喜欢

转载自blog.csdn.net/kq1983/article/details/113956175