跳到主要内容
版本:v2.5.x

动态配置 Milvus

Milvus 允许你动态更改一些配置。

开始之前

您需要确保

  • 已安装 Birdwatcher。详情请参阅 安装 Birdwatcher
  • 安装了 etcdctl。有关详情,请参阅 与 etcd 交互,或
  • 安装了其他 etcd 客户端,例如 Python 客户端。
说明
  • 本指南中的示例将 proxy.minPasswordLength 的值更改为 8。您可以使用 "适用的配置项"中列出的适用密钥替换这些密钥。
  • 本指南中的示例假定 Milvus 的根路径是 by-dev。所有配置都列在 by-dev/config 路径下。Milvus 根路径因安装方式而异。对于使用 Helm Chart 安装的实例,根路径默认为 by-dev。如果不知道根路径,请参阅 连接到 etcd

更改配置

在 Milvus 上,proxy.minPasswordLength 默认设置为 6。要更改该值,可按以下步骤操作:

Shell
etcdctl put by-dev/config/proxy/minPasswordLength 8
# or
birdwatcher -olc "#connect --etcd 127.0.0.1:2379 --rootPath=by-dev,set config-etcd --key by-dev/config/proxy/minPasswordLength --value 8"

然后按如下步骤检查配置:

Shell
etcdctl get by-dev/config/proxy/minPasswordLength

回滚配置

如果更改的值不再适用,Milvus 还允许您回滚配置。

Shell
etcdctl del by-dev/config/proxy/minPasswordLength
# or
birdwatcher -olc "#connect --etcd 127.0.0.1:2379 --rootPath=by-dev,remove config-etcd --key by-dev/config/proxy/minPasswordLength"

然后可以按如下方式检查配置:

Shell
etcdctl get by-dev/config/proxy/minPasswordLength

查看配置

除了查看特定配置项的值,您还可以列出所有配置项。

Shell
etcdctl get --prefix by-dev/config
# or
birdwatcher -olc "#connect --etcd 127.0.0.1:2379 --rootPath=by-dev,show config-etcd"

查看特定节点的配置:

Shell
Offline > connect --etcd ip:port
Milvus(by-dev) > show session # List all nodes with their server ID
Milvus(by-dev) > visit querycoord 1 # Visit a node by server ID
QueryCoord-1(ip:port) > configuration # List the configuration of the node

适用的配置项

目前,您可以动态更改以下配置项目。

配置项目默认值
pulsar.maxMessageSize5242880
common.retentionDuration86400
common.entityExpiration-1
common.gracefulTime5000
common.gracefulStopTimeout30
quotaAndLimits.ddl.enabledFALSE
quotaAndLimits.indexRate.enabledFALSE
quotaAndLimits.flushRate.enabledFALSE
quotaAndLimits.compactionRate.enabledFALSE
quotaAndLimits.dml.enabledFALSE
quotaAndLimits.dql.enabledFALSE
quotaAndLimits.limits.collection.maxNum64
quotaAndLimits.limitWriting.forceDenyFALSE
quotaAndLimits.limitWriting.ttProtection.enabledFALSE
quotaAndLimits.limitWriting.ttProtection.maxTimeTickDelay9223372036854775807
quotaAndLimits.limitWriting.memProtection.enabledTRUE
quotaAndLimits.limitWriting.memProtection.dataNodeMemoryLowWaterLevel0.85
quotaAndLimits.limitWriting.memProtection.dataNodeMemoryHighWaterLevel0.95
quotaAndLimits.limitWriting.memProtection.queryNodeMemoryLowWaterLevel0.85
quotaAndLimits.limitWriting.memProtection.queryNodeMemoryHighWaterLevel0.95
quotaAndLimits.limitWriting.diskProtection.enabledTRUE
quotaAndLimits.limitWriting.diskProtection.diskQuota+INF
quotaAndLimits.limitReading.forceDenyFALSE
quotaAndLimits.limitReading.queueProtection.enabledFALSE
quotaAndLimits.limitReading.queueProtection.nqInQueueThreshold9223372036854775807
quotaAndLimits.limitReading.queueProtection.queueLatencyThreshold+INF
quotaAndLimits.limitReading.resultProtection.enabledFALSE
quotaAndLimits.limitReading.resultProtection.maxReadResultRate+INF
quotaAndLimits.limitReading.coolOffSpeed0.9
autoIndex.enableFALSE
autoIndex.params.build""
autoIndex.params.extra""
autoIndex.params.search""
proxy.maxNameLength255
proxy.maxUsernameLength32
proxy.minPasswordLength6
proxy.maxPasswordLength256
proxy.maxFieldNum64
proxy.maxShardNum256
proxy.maxDimension32768
proxy.maxUserNum100
proxy.maxRoleNum10
queryNode.enableDiskTRUE
dataCoord.segment.diskSegmentMaxSize2048
dataCoord.compaction.enableAutoCompactionTRUE

下一步