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 names
Meaning
Optional value
Default value
Support version
nacos.home(-D)
Nacos root directory
Directory path
Nacos installation directory
>= 0.1.0
nacos.standalone(-D)
Whether in stand-alone mode
true/false
false
>= 0.1.0
nacos.functionMode(-D)
Boot mode, support only start one module, do not set all modules will start
config/naming/null
null
>= 0.9.0
nacos.inetutils.prefer-hostname-over-ip
if you should fill in hostname in cluster.conf
true/false
false
>= 0.3.0
nacos.inetutils.ip-address
Native IP, set this parameter, will use this IP tocluster.confmatching, please make sure that the IP value exists in the cluster.conf
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 names
Meaning
Optional value
Default value
Support version
nacos.plugin.datasource-dialect.type
Database dialect selector
derby/mysql/postgresql/oracle/custom
By running mode
3.3.0 ~ latest
nacos.plugin.datasource.db.num
Number of external databases
positive integer
0
3.3.0 ~ latest
nacos.plugin.datasource.db.url.{index}
Indexed database URL
string
empty
3.3.0 ~ latest
nacos.plugin.datasource.db.user[.{index}]
Shared or indexed username
string
empty
3.3.0 ~ latest
nacos.plugin.datasource.db.password[.{index}]
Shared or indexed password
string
empty
3.3.0 ~ latest
nacos.plugin.datasource.db.pool.config.xxx
HikariCP setting; stable items use kebab-case
string
See plugin page
3.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 names
Meaning
Optional value
Default value
Support version
nacos.cmdb.loadDataAtStart
Whether to open the CMDB
true/false
false
>= 0.7.0
nacos.cmdb.dumpTaskInterval
The full amount of the interval of the dump, the unit is in seconds
positive integer
3600
>= 0.7.0
nacos.cmdb.eventTaskInterval
The pull interval change events, the unit is in seconds
positive integer
10
>= 0.7.0
nacos.cmdb.labelTaskInterval
Label the pull interval set, the unit is in seconds
positive integer
300
>= 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 names
Meaning
Optional value
Default value
Support version
endpoint
Connection Nacos Server specify the connection point, you can refer to file
domain name
null
>= 0.1.0
endpointPort
Connection Nacos Server specify the connection port, you can refer to file
Legal port
null
>= 0.1.0
namespace
namespace ID
namespace ID
config module is empty, naming module is public
>= 0.8.0
serverAddr
Nacos Server address list, this value is higher priority than the endpoint
ip,ip,…
null
>= 0.1.0
JM.LOG.PATH(-D)
client log directory
directory path
root directory of the user
>= 0.1.0
com.alibaba.nacos.config.log.level(-D)
Naming client log level
info,error,warn etc
info
>= 1.0.0
com.alibaba.nacos.naming.log.level(-D)
Config client log level
info,error,warn etc
info
>= 1.0.0
com.alibaba.nacos.client.naming.tls.enable(-D)
Whether to open the HTTPS
true/false
false
>= 1.0.0
Naming client
Parameter names
Meaning
Optional value
Default value
Support version
namingLoadCacheAtStart
If boot priority reads a local cache
true/false
false
>= 1.0.0
namingCacheRegistryDir
The subdirectory of cache, default is .../nacos/{SUB_DIR}/naming
path of SUB_DIR
empty string
>=2.0.2
namingClientBeatThreadCount
client’s heartbeat thread pool size
positive integer
number of the machine’s CPU half
>= 1.0.0
namingPollingThreadCount
client regularly polling data update the thread pool size