Skip to content
OpenClaw 不踩坑恶意 Skills ,企业需 Skills Registry:Nacos 3.2 发布Know more

Nacos system parameters introduce

Document optimizing…

Nacos Server

For Server side, usually set in {nacos.home}/conf/application.properties, if the parameter name after mark (-D), says is the JVM parameter, need in {nacos.home}/bin/startup.sh accordingly set up. Such as setting nacos. The value of the home, can be in {nacos.home}/bin/startup.sh the following Settings:

JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}"

Global parameters

Parameter namesMeaningOptional valueDefault valueSupport version
nacos.home(-D)Nacos root directoryDirectory pathNacos installation directory>= 0.1.0
nacos.standalone(-D)Whether in stand-alone modetrue/falsefalse>= 0.1.0
nacos.functionMode(-D)Boot mode, support only start one module, do not set all modules will startconfig/naming/nullnull>= 0.9.0
nacos.inetutils.prefer-hostname-over-ipif you should fill in hostname in cluster.conftrue/falsefalse>= 0.3.0
nacos.inetutils.ip-addressNative IP, set this parameter, will use this IP tocluster.confmatching, please make sure that the IP value exists in the cluster.confNative IPnull>= 0.3.0

Naming module

Parameter namesMeaningOptional valueDefault valueSupport version
nacos.naming.data.warmupWhether the Server startup to preheat the datatrue/falsefalse>= 1.0.2
nacos.naming.expireInstanceWhether automatic removal of temporary instancetrue/falsetrue>= 1.0.2
nacos.naming.distro.taskDispatchPeriodSynchronization task generation cycle, millisecondspositive integer2000>= 1.0.2
nacos.naming.distro.batchSyncKeyCountThe number of each batch of key synchronization taskpositive integer1000>= 1.0.2
nacos.naming.distro.syncRetryDelaySynchronization task failure retry intervals, millisecondspositive integer5000>= 1.0.2

In addition to the above listed to in application.propertiesconfiguration properties, And some can be adjusted call interface at runtime, These parameters are in the Open APIexamine system current data indexthe API in a statement.

Config module

Parameter namesMeaningOptional valueDefault valueSupport version
nacos.plugin.datasource-dialect.typeDatabase dialect selectorderby/mysql/postgresql/oracle/customBy running mode3.3.0 ~ latest
nacos.plugin.datasource.db.numNumber of external databasespositive integer03.3.0 ~ latest
nacos.plugin.datasource.db.url.{index}Indexed database URLstringempty3.3.0 ~ latest
nacos.plugin.datasource.db.user[.{index}]Shared or indexed usernamestringempty3.3.0 ~ latest
nacos.plugin.datasource.db.password[.{index}]Shared or indexed passwordstringempty3.3.0 ~ latest
nacos.plugin.datasource.db.pool.config.xxxHikariCP setting; stable items use kebab-casestringSee plugin page3.3.0 ~ latest

spring.sql.init.platform and db.* remain historical aliases, and canonical keys win. spring.datasource.platform is removed. See Datasource Plugin for stable keys, defaults, and migration rules.

CMDB module

Parameter namesMeaningOptional valueDefault valueSupport version
nacos.cmdb.loadDataAtStartWhether to open the CMDBtrue/falsefalse>= 0.7.0
nacos.cmdb.dumpTaskIntervalThe full amount of the interval of the dump, the unit is in secondspositive integer3600>= 0.7.0
nacos.cmdb.eventTaskIntervalThe pull interval change events, the unit is in secondspositive integer10>= 0.7.0
nacos.cmdb.labelTaskIntervalLabel the pull interval set, the unit is in secondspositive integer300>= 0.7.0

Nacos Java Client

TODO: Move to dependent document in user guide

Client parameters are divided into two kinds, one kind is through the -D parameter to specify the configuration of the client is a kind of structure, through Properties objects specified in the configuration, the following without -D marked by Properties injection configuration.

General parameters

Parameter namesMeaningOptional valueDefault valueSupport version
endpointConnection Nacos Server specify the connection point, you can refer to filedomain namenull>= 0.1.0
endpointPortConnection Nacos Server specify the connection port, you can refer to fileLegal portnull>= 0.1.0
namespacenamespace IDnamespace IDconfig module is empty, naming module is public>= 0.8.0
serverAddrNacos Server address list, this value is higher priority than the endpointip
,ip
,…
null>= 0.1.0
JM.LOG.PATH(-D)client log directorydirectory pathroot directory of the user>= 0.1.0
com.alibaba.nacos.config.log.level(-D)Naming client log levelinfo,error,warn etcinfo>= 1.0.0
com.alibaba.nacos.naming.log.level(-D)Config client log levelinfo,error,warn etcinfo>= 1.0.0
com.alibaba.nacos.client.naming.tls.enable(-D)Whether to open the HTTPStrue/falsefalse>= 1.0.0

Naming client

Parameter namesMeaningOptional valueDefault valueSupport version
namingLoadCacheAtStartIf boot priority reads a local cachetrue/falsefalse>= 1.0.0
namingCacheRegistryDirThe subdirectory of cache, default is .../nacos/{SUB_DIR}/namingpath of SUB_DIRempty string>=2.0.2
namingClientBeatThreadCountclient’s heartbeat thread pool sizepositive integernumber of the machine’s CPU half>= 1.0.0
namingPollingThreadCountclient regularly polling data update the thread pool sizepositive integernumber of the machine’s CPU half>= 1.0.0
com.alibaba.nacos.naming.cache.dir(-D)The directory of client cachepath of directory{user.home}/nacos/naming>= 1.0.0

Config client

Parameter namesMeaningOptional valueDefault valueSupport version
configLongPollTimeout(config.long-poll.timeout 1.0.1 version)Long polling timeout, millisecondspositive integer30000>= 1.0.2
configRetryTime(config.retry.time 1.0.1 version)Retry time long polling tasks, millisecondspositive integer2000>= 1.0.2
maxRetryLong polling retriespositive integer3>= 1.0.2
enableRemoteSyncConfigListeners are added to the remote configuration for the first timeboolean valuefalse>= 1.0.2