文档文档

InfluxDB 配置选项

通过使用 influxd 配置标志、设置环境变量或在配置文件中定义配置选项来自定义您的 InfluxDB 配置。

查看您的运行时服务器配置

使用 influx CLI 或 InfluxDB API 获取您的 InfluxDB 实例的运行时服务器配置。

服务器配置命令需要 Operator 令牌

使用 CLI 查看您的服务器配置

使用 influx server-config 命令 检索您的运行时服务器配置。

influx server-config

使用 API 查看您的服务器配置

使用 /api/v2/config InfluxDB API 端点检索您的运行时服务器配置。

GET http://localhost:8086/api/v2/config

配置优先级

InfluxDB 按照以下优先级处理配置设置

  1. influxd 标志
  2. 环境变量
  3. 配置文件设置

InfluxDB 配置文件

influxd 启动时,它会检查**当前工作目录**中名为 config.* 的文件。文件扩展名取决于配置文件的语法。InfluxDB 配置文件支持以下语法

  • YAML (.yaml, .yml)
  • TOML (.toml)
  • JSON (.json)

要自定义配置文件的目录路径,请将 INFLUXD_CONFIG_PATH 环境变量设置为您的自定义路径。

export INFLUXD_CONFIG_PATH=/path/to/custom/config/directory

在启动时,influxd 将检查 INFLUXD_CONFIG_PATH 目录中是否存在 config.*

示例配置文件
query-concurrency: 20
query-queue-size: 15
secret-store: vault
session-length: 120
tls-cert: /path/to/influxdb.crt
tls-key: /path/to/influxdb.key
query-concurrency = 20
query-queue-size = 15
secret-store = "vault"
session-length = 120
tls-cert = "/path/to/influxdb.crt"
tls-key = "/path/to/influxdb.key"
{
  "query-concurrency": 20,
  "query-queue-size": 15,
  "secret-store": "vault",
  "session-length": 120,
  "tls-cert": "/path/to/influxdb.crt",
  "tls-key": "/path/to/influxdb.key"
}

只需要在配置文件中定义非默认设置。

配置选项

要配置 InfluxDB,请在启动 influxd 服务时使用以下配置选项


assets-path

通过从指定的目录提供资源来覆盖默认的 InfluxDB 用户界面 (UI) 资源。通常仅供 InfluxData 内部使用。

influxd 标志环境变量配置键
--assets-pathINFLUXD_ASSETS_PATHassets-path
influxd 标志
influxd --assets-path=/path/to/custom/assets-dir
环境变量
export INFLUXD_ASSETS_PATH=/path/to/custom/assets-dir
配置文件
assets-path: /path/to/custom/assets-dir
assets-path = "/path/to/custom/assets-dir"
{
  "assets-path": "/path/to/custom/assets-dir"
}

bolt-path

BoltDB 数据库的路径。BoltDB 是用 Go 编写的键值存储。InfluxDB 使用 BoltDB 存储数据,包括组织和用户信息、UI 数据、REST 资源以及其他键值数据。

默认值: ~/.influxdbv2/influxd.bolt

influxd 标志环境变量配置键
--bolt-pathINFLUXD_BOLT_PATHbolt-path
influxd 标志
influxd --bolt-path=~/.influxdbv2/influxd.bolt
环境变量
export INFLUXD_BOLT_PATH=~/.influxdbv2/influxd.bolt
配置文件
bolt-path: ~/.influxdbv2/influxd.bolt
bolt-path = "~/.influxdbv2/influxd.bolt"
{
  "bolt-path": "~/.influxdbv2/influxd.bolt"
}

e2e-testing

向 InfluxDB HTTP API 添加 /debug/flush 端点以清除存储。InfluxData 在端到端测试中使用此端点。

influxd 标志环境变量配置键
--e2e-testingINFLUXD_E2E_TESTINGe2e-testing
influxd 标志
influxd --e2e-testing
环境变量
export INFLUXD_E2E_TESTING=true
配置文件
e2e-testing: true
e2e-testing = true
{
  "e2e-testing": true
}

engine-path

持久存储引擎文件的路径,InfluxDB 在其中将所有时间结构合并树 (TSM) 数据存储在磁盘上。

默认值: ~/.influxdbv2/engine

influxd 标志环境变量配置键
--engine-pathINFLUXD_ENGINE_PATHengine-path
influxd 标志
influxd --engine-path=~/.influxdbv2/engine
环境变量
export INFLUXD_ENGINE_PATH=~/.influxdbv2/engine
配置文件
engine-path: ~/.influxdbv2/engine
engine-path = "~/.influxdbv2/engine"
{
  "engine-path": "~/.influxdbv2/engine"
}

feature-flags

启用、禁用或覆盖功能标志的默认值。

功能标志用于开发和测试实验性功能,仅供内部使用。

influxd 标志环境变量配置键
--feature-flagsINFLUXD_FEATURE_FLAGSfeature-flags
influxd 标志
influxd --feature-flags flag1=value2,flag2=value2
环境变量
export INFLUXD_FEATURE_FLAGS="{\"flag1\":\value1\",\"flag2\":\"value2\"}"
配置文件
feature-flags:
  flag1: "value1"
  flag2: "value2"
[feature-flags]
  flag1 = "value1"
  glag2 = "value2"
{
  "feature-flags": {
    "flag1": "value1",
    "flag2": "value2"
  }
}

flux-log-enabled

包含用于显示 Flux 查询的详细日志的选项,包括以下日志字段

  • compiler_type:用于处理查询的编译器(始终为 Flux)。
  • response_size:响应大小,以字节为单位。
  • query:查询的文本表示形式。
  • err:处理查询时遇到的错误。
  • stat_total_duration:处理查询的总持续时间。
  • stat_compile_duration:编译查询的持续时间。
  • stat_execute_duration:执行查询的持续时间。
  • stat_max_allocated:处理查询时分配的最大内存量,以字节为单位。
  • stat_total_allocated:处理查询时分配的总内存量,以字节为单位。这包括已释放然后再次使用的内存。

默认值: false

influxd 标志环境变量配置键
--flux-log-enabledINFLUXD_FLUX_LOG_ENABLEDflux-log-enabled
influxd 标志
influxd --flux-log-enabled
环境变量
export INFLUXD_FLUX_LOG_ENABLED=true
配置文件
flux-log-enabled: true
flux-log-enabled = "true"
{
  "flux-log-enabled": "true"
}

hardening-enabled

在 InfluxDB 中启用额外的安全功能默认值: false

influxd 标志环境变量配置键
--hardening-enabledINFLUXD_HARDENING_ENABLEDhardening-enabled
influxd 标志
influxd --hardening-enabled
环境变量
export INFLUXD_HARDENING_ENABLED=true
配置文件
hardening-enabled: true
hardening-enabled = true
{
  "hardening-enabled": true
}

http-bind-address

InfluxDB HTTP API 的绑定地址。自定义 InfluxDB API 和 UI 的 URL 和端口。

默认值: :8086

influxd 标志环境变量配置键
--http-bind-addressINFLUXD_HTTP_BIND_ADDRESShttp-bind-address
influxd 标志
influxd --http-bind-address=:8086
环境变量
export INFLUXD_HTTP_BIND_ADDRESS=:8086
配置文件
http-bind-address: ":8086"
http-bind-address = ":8086"
{
  "http-bind-address": ":8086"
}

http-idle-timeout

服务器在等待新请求时应保持已建立连接的最大持续时间。设置为 0 表示无超时。

默认值: 3m0s

influxd 标志环境变量配置键
--http-idle-timeoutINFLUXD_HTTP_IDLE_TIMEOUThttp-idle-timeout
influxd 标志
influxd --http-idle-timeout=3m0s
环境变量
export INFLUXD_HTTP_IDLE_TIMEOUT=3m0s
配置文件
http-idle-timeout: 3m0s
http-idle-timeout = "3m0s"
{
  "http-idle-timeout": "3m0s"
}

http-read-header-timeout

服务器应尝试读取新请求的 HTTP 标头的最大持续时间。设置为 0 表示无超时。

默认值: 10s

influxd 标志环境变量配置键
--http-read-header-timeoutINFLUXD_HTTP_READ_HEADER_TIMEOUThttp-read-header-timeout
influxd 标志
influxd --http-read-header-timeout=10s
环境变量
export INFLUXD_HTTP_READ_HEADER_TIMEOUT=10s
配置文件
http-read-header-timeout: 10s
http-read-header-timeout = "10s"
{
  "http-read-header-timeout": "10s"
}

http-read-timeout

服务器应尝试读取新请求的全部内容的最大持续时间。设置为 0 表示无超时。

默认值: 0

根据您的工作负载设置超时

尽管默认情况下未设置 http-read-timeout,但我们强烈建议根据您的工作负载设置超时。HTTP 超时可防止大量打开的连接,这些连接可能会损害性能。

influxd 标志环境变量配置键
--http-read-timeoutINFLUXD_HTTP_READ_TIMEOUThttp-read-timeout
influxd 标志
influxd --http-read-timeout=10s
环境变量
export INFLUXD_HTTP_READ_TIMEOUT=10s
配置文件
http-read-timeout: 10s
http-read-timeout = "10s"
{
  "http-read-timeout": "10s"
}

http-write-timeout

等待响应写入超时的最大持续时间。它不允许处理程序根据每个请求决定持续时间。

当读取新请求的标头时,超时会重置。

设置为 0 表示无超时。

默认值: 0

根据您的工作负载设置超时

尽管默认情况下未设置 http-write-timeout,但我们强烈建议根据您的工作负载设置超时。HTTP 超时可防止大量打开的连接,这些连接可能会损害性能。

influxd 标志环境变量配置键
--http-write-timeoutINFLUXD_HTTP_WRITE_TIMEOUThttp-write-timeout
influxd 标志
influxd --http-write-timeout=10s
环境变量
export INFLUXD_HTTP_WRITE_TIMEOUT=10s
配置文件
http-write-timeout: 10s
http-write-timeout = "10s"
{
  "http-write-timeout": "10s"
}

influxql-max-select-buckets

SELECT 语句可以创建的最大 group by time 存储桶数。0 允许无限数量的存储桶。

默认值: 0

influxd 标志环境变量配置键
--influxql-max-select-bucketsINFLUXD_INFLUXQL_MAX_SELECT_BUCKETSinfluxql-max-select-buckets
influxd 标志
influxd --influxql-max-select-buckets=0
环境变量
export INFLUXD_INFLUXQL_MAX_SELECT_BUCKETS=0
配置文件
influxql-max-select-buckets: 0
influxql-max-select-buckets = 0
{
  "influxql-max-select-buckets": 0
}

influxql-max-select-point

SELECT 语句可以处理的最大数据点数。0 允许无限数量的数据点。InfluxDB 每秒检查一次数据点计数(因此不会立即中止超过最大值的查询)。

默认值: 0

influxd 标志环境变量配置键
--influxql-max-select-pointINFLUXD_INFLUXQL_MAX_SELECT_POINTinfluxql-max-select-point
influxd 标志
influxd --influxql-max-select-point=0
环境变量
export INFLUXD_INFLUXQL_MAX_SELECT_POINT=0
配置文件
influxql-max-select-point: 0
influxql-max-select-point = 0
{
  "influxql-max-select-point": 0
}

influxql-max-select-series

SELECT 语句可以返回的最大序列数。0 允许无限数量的序列。

默认值: 0

influxd 标志环境变量配置键
--influxql-max-select-seriesINFLUXD_INFLUXQL_MAX_SELECT_SERIESinfluxql-max-select-series
influxd 标志
influxd --influxql-max-select-series=0
环境变量
export INFLUXD_INFLUXQL_MAX_SELECT_SERIES=0
配置文件
influxql-max-select-series: 0
influxql-max-select-series = 0
{
  "influxql-max-select-series": 0
}

instance-id

在复制期间标识边缘节点,并防止两个边缘节点写入相同的 measurement,tagset 时发生冲突。

influxd 标志环境变量配置键
--instance-idINFLUXD_INSTANCE_IDinstance-id
influxd 标志
influxd --instance-id=:8086
环境变量
export INFLUXD_INSTANCE_ID=:8086
配置文件
instance-id: ":8086"
instance-id = ":8086"
{
  "instance-id": ":8086"
}

log-level

日志输出级别。InfluxDB 输出严重性级别大于或等于指定级别的日志条目。

选项: debuginfoerror
默认值: info

influxd 标志环境变量配置键
--log-levelINFLUXD_LOG_LEVELlog-level
influxd 标志
influxd --log-level=info
环境变量
export INFLUXD_LOG_LEVEL=info
配置文件
log-level: info
log-level = "info"
{
  "log-level": "info"
}

metrics-disabled

禁用 HTTP /metrics 端点,该端点公开内部 InfluxDB 指标

默认值: false

influxd 标志环境变量配置键
--metrics-disabledINFLUXD_METRICS_DISABLEDmetrics-disabled
influxd 标志
influxd --metrics-disabled
环境变量
export INFLUXD_METRICS_DISABLED=true
配置文件
metrics-disabled: true
metrics-disabled = true
{
  "metrics-disabled": true
}

nats-max-payload-bytes

nats-max-payload-bytesInfluxDB 2.2 中已弃用,不再起任何作用。

NATS 消息负载中允许的最大字节数。

默认值: 1048576

influxd 标志环境变量配置键
--nats-max-payload-bytesINFLUXD_NATS_MAX_PAYLOAD_BYTESnats-max-payload-bytes
influxd 标志
influxd --nats-max-payload-bytes=1048576
环境变量
export INFLUXD_NATS_MAX_PAYLOAD_BYTES=1048576
配置文件
nats-max-payload-bytes: 1048576
nats-max-payload-bytes = 1048576
{
  "nats-max-payload-bytes": 1048576
}

nats-port

nats-portInfluxDB 2.2 中已弃用,不再起任何作用。

NATS 流服务器的端口。-1 选择一个随机端口。

默认值: -1

influxd 标志环境变量配置键
--nats-portINFLUXD_NATS_PORTnats-port
influxd 标志
influxd --nats-port=-1
环境变量
export INFLUXD_NATS_PORT=-1
配置文件
nats-port: -1
nats-port = -1
{
  "nats-port": -1
}

no-tasks

禁用任务调度器。如果任务出现问题阻止 InfluxDB 启动,请使用此选项在不调度或执行任务的情况下启动 InfluxDB。

默认值: false

influxd 标志环境变量配置键
--no-tasksINFLUXD_NO_TASKSno-tasks
influxd 标志
influxd --no-tasks
环境变量
export INFLUXD_NO_TASKS=true
配置文件
no-tasks: true
no-tasks = true
{
  "no-tasks": true
}

overwrite-pid-file

覆盖 pid-file 指定的 PID 文件(如果存在),而不是退出并显示错误。

默认值: false

influxd 标志环境变量配置键
--overwrite-pid-fileINFLUXD_OVERWRITE_PID_FILEoverwrite-pid-file
influxd 标志
influxd --overwrite-pid-file
环境变量
export INFLUXD_OVERWRITE_PID_FILE=true
配置文件
overwrite-pid-file: true
overwrite-pid-file = true
{
  "overwrite-pid-file": true
}

pid-file

将 PID 文件写入到指定的路径,并在 InfluxDB 停止时将其删除。

默认 ``

influxd 标志环境变量配置键
--pid-fileINFLUXD_PID_FILEpid-file
influxd 标志
influxd --pid-file /path/to/pid-file
环境变量
export INFLUXD_PID_FILE=/path/to/pid-file
配置文件
pid-file: /path/to/pid-file
pid-file = "/path/to/pid-file"
{
  "pid-file": "/path/to/pid-file"
}

pprof-disabled

禁用 /debug/pprof HTTP 端点。此端点提供运行时分析数据,在调试时可能很有用。

默认值: false

influxd 标志环境变量配置键
--pprof-disabledINFLUXD_PPROF_DISABLEDpprof-disabled
influxd 标志
influxd --pprof-disabled
环境变量
export INFLUXD_PPROF_DISABLED=true
配置文件
pprof-disabled: true
pprof-disabled = true
{
  "pprof-disabled": true
}

query-concurrency

允许并发执行的查询数。设置为 0 允许无限数量的并发查询。

默认值: 0

influxd 标志环境变量配置键
--query-concurrencyINFLUXD_QUERY_CONCURRENCYquery-concurrency
influxd 标志
influxd --query-concurrency=10
环境变量
export INFLUXD_QUERY_CONCURRENCY=10
配置文件
query-concurrency: 10
query-concurrency = 10
{
  "query-concurrency": 10
}

query-initial-memory-bytes

为查询分配的初始内存字节数。

默认值: 等于 query-memory-bytes

influxd 标志环境变量配置键
--query-initial-memory-bytesINFLUXD_QUERY_INITIAL_MEMORY_BYTESquery-initial-memory-bytes
influxd 标志
influxd --query-initial-memory-bytes=10485760
环境变量
export INFLUXD_QUERY_INITIAL_MEMORY_BYTES=10485760
配置文件
query-initial-memory-bytes: 10485760
query-initial-memory-bytes = 10485760
{
  "query-initial-memory-bytes": 10485760
}

query-max-memory-bytes

允许查询使用的最大总内存字节数。

默认值: 等于 query-concurrency × query-memory-bytes

influxd 标志环境变量配置键
--query-max-memory-bytesINFLUXD_QUERY_MAX_MEMORY_BYTESquery-max-memory-bytes
influxd 标志
influxd --query-max-memory-bytes=104857600
环境变量
export INFLUXD_QUERY_MAX_MEMORY_BYTES=104857600
配置文件
query-max-memory-bytes: 104857600
query-max-memory-bytes = 104857600
{
  "query-max-memory-bytes": 104857600
}

query-memory-bytes

单个查询允许使用的最大内存字节数。

默认值: 无限制

必须大于或等于 query-initial-memory-bytes

influxd 标志环境变量配置键
--query-memory-bytesINFLUXD_QUERY_MEMORY_BYTESquery-memory-bytes
influxd 标志
influxd --query-memory-bytes=10485760
环境变量
export INFLUXD_QUERY_MEMORY_BYTES=10485760
配置文件
query-memory-bytes: 10485760
query-memory-bytes = 10485760
{
  "query-memory-bytes": 10485760
}

query-queue-size

执行队列中允许的最大查询数。当达到队列限制时,新查询将被拒绝。设置为 0 允许队列中有无限数量的查询。

默认值: 0

influxd 标志环境变量配置键
--query-queue-sizeINFLUXD_QUERY_QUEUE_SIZEquery-queue-size
influxd 标志
influxd --query-queue-size=10
环境变量
export INFLUXD_QUERY_QUEUE_SIZE=10
配置文件
query-queue-size: 10
query-queue-size = 10
{
  "query-queue-size": 10
}

reporting-disabled

禁用向 InfluxData 发送遥测数据。InfluxData 遥测页面提供了有关收集哪些数据以及 InfluxData 如何使用这些数据的信息。

默认值: false

influxd 标志环境变量配置键
--reporting-disabledINFLUXD_REPORTING_DISABLEDreporting-disabled
influxd 标志
influxd --reporting-disabled
环境变量
export INFLUXD_REPORTING_DISABLED=true
配置文件
reporting-disabled: true
reporting-disabled = true
{
  "reporting-disabled": true
}

secret-store

指定用于存储密钥(例如密码和令牌)的数据存储。将密钥存储在 InfluxDB 内部 BoltDBVault 中。

选项: boltvault
默认值: bolt

influxd 标志环境变量配置键
--secret-storeINFLUXD_SECRET_STOREsecret-store
influxd 标志
influxd --secret-store=bolt
环境变量
export INFLUXD_SECRET_STORE=bolt
配置文件
secret-store: bolt
secret-store = "bolt"
{
  "secret-store": "bolt"
}

session-length

指定新建用户会话的生存时间 (TTL),单位为分钟

默认值: 60

influxd 标志环境变量配置键
--session-lengthINFLUXD_SESSION_LENGTHsession-length
influxd 标志
influxd --session-length=60
环境变量
export INFLUXD_SESSION_LENGTH=60
配置文件
session-length: 60
session-length = 60
{
  "session-length": 60
}

session-renew-disabled

禁用在每个请求上自动延长用户会话 TTL。默认情况下,每个请求都会将会话的过期时间设置为从现在起五分钟后。禁用后,会话将在指定的会话时长后过期,并且用户将被重定向到登录页面,即使最近处于活动状态。

默认值: false

influxd 标志环境变量配置键
--session-renew-disabledINFLUXD_SESSION_RENEW_DISABLEDsession-renew-disabled
influxd 标志
influxd --session-renew-disabled
环境变量
export INFLUXD_SESSION_RENEW_DISABLED=true
配置文件
session-renew-disabled: true
session-renew-disabled = true
{
  "session-renew-disabled": true
}

sqlite-path

SQLite 数据库文件的路径。SQLite 数据库用于存储笔记本和注释的元数据。

默认值: influxd.sqlite,与 bolt-path 位于同一目录下。

influxd 标志环境变量配置键
--sqlite-pathINFLUXD_SQLITE_PATHsqlite-path
influxd 标志
influxd --sqlite-path ~/.influxdbv2/influxd.sqlite
环境变量
export INFLUXD_SQLITE_PATH=~/.influxdbv2/influxd.sqlite
配置文件
sqlite-path: ~/.influxdbv2/influxd.sqlite
sqlite-path = "~/.influxdbv2/influxd.sqlite"
{
  "sqlite-path": "~/.influxdbv2/influxd.sqlite"
}

storage-cache-max-memory-size

分片缓存可以达到的最大大小(以字节为单位),超过此大小将开始拒绝写入。

默认值: 1073741824

influxd 标志环境变量配置键
--storage-cache-max-memory-sizeINFLUXD_STORAGE_CACHE_MAX_MEMORY_SIZEstorage-cache-max-memory-size
influxd 标志
influxd --storage-cache-max-memory-size=1073741824
环境变量
export INFLUXD_STORAGE_CACHE_MAX_MEMORY_SIZE=1073741824
配置文件
storage-cache-max-memory-size: 1073741824
storage-cache-max-memory-size = 1073741824
{
  "storage-cache-max-memory-size": 1073741824
}

storage-cache-snapshot-memory-size

存储引擎将快照缓存并将其写入 TSM 文件以释放更多内存的大小(以字节为单位)。

默认值: 26214400)

influxd 标志环境变量配置键
--storage-cache-snapshot-memory-sizeINFLUXD_STORAGE_CACHE_SNAPSHOT_MEMORY_SIZEstorage-cache-snapshot-memory-size
influxd 标志
influxd --storage-cache-snapshot-memory-size=26214400
环境变量
export INFLUXD_STORAGE_CACHE_SNAPSHOT_MEMORY_SIZE=26214400
配置文件
storage-cache-snapshot-memory-size: 26214400
storage-cache-snapshot-memory-size = 26214400
{
  "storage-cache-snapshot-memory-size": 26214400
}

storage-cache-snapshot-write-cold-duration

如果分片未收到写入或删除操作,则存储引擎将快照缓存并将其写入新的 TSM 文件的持续时间。

默认值: 10m0s

influxd 标志环境变量配置键
--storage-cache-snapshot-write-cold-durationINFLUXD_STORAGE_CACHE_SNAPSHOT_WRITE_COLD_DURATIONstorage-cache-snapshot-write-cold-duration
influxd 标志
influxd --storage-cache-snapshot-write-cold-duration=10m0s
环境变量
export INFLUXD_STORAGE_CACHE_SNAPSHOT_WRITE_COLD_DURATION=10m0s
配置文件
storage-cache-snapshot-write-cold-duration: 10m0s
storage-cache-snapshot-write-cold-duration = "10m0s"
{
  "storage-cache-snapshot-write-cold-duration": "10m0s"
}

storage-compact-full-write-cold-duration

如果分片未收到写入或删除操作,则存储引擎将压缩分片中所有 TSM 文件的持续时间。

默认值: 4h0m0s

influxd 标志环境变量配置键
--storage-compact-full-write-cold-durationINFLUXD_STORAGE_COMPACT_FULL_WRITE_COLD_DURATIONstorage-compact-full-write-cold-duration
influxd 标志
influxd --storage-compact-full-write-cold-duration=4h0m0s
环境变量
export INFLUXD_STORAGE_COMPACT_FULL_WRITE_COLD_DURATION=4h0m0s
配置文件
storage-compact-full-write-cold-duration: 4h0m0s
storage-compact-full-write-cold-duration = "4h0m0s"
{
  "storage-compact-full-write-cold-duration": "4h0m0s"
}

storage-compact-throughput-burst

TSM 压缩可以写入磁盘的速率限制(以字节/秒为单位)。

默认值: 50331648

influxd 标志环境变量配置键
--storage-compact-throughput-burstINFLUXD_STORAGE_COMPACT_THROUGHPUT_BURSTstorage-compact-throughput-burst
influxd 标志
influxd --storage-compact-throughput-burst=50331648
环境变量
export INFLUXD_STORAGE_COMPACT_THROUGHPUT_BURST=50331648
配置文件
storage-compact-throughput-burst: 50331648
storage-compact-throughput-burst = 50331648
{
  "storage-compact-throughput-burst": 50331648
}

storage-max-concurrent-compactions

可以并发运行的完整和级别压缩的最大数量。值为 0 将导致运行时使用 runtime.GOMAXPROCS(0) 的 50%。任何大于零的数字都会将压缩限制为该值。此设置不适用于缓存快照。

默认值: 0

influxd 标志环境变量配置键
--storage-max-concurrent-compactionsINFLUXD_STORAGE_MAX_CONCURRENT_COMPACTIONSstorage-max-concurrent-compactions
influxd 标志
influxd --storage-max-concurrent-compactions=0
环境变量
export INFLUXD_STORAGE_MAX_CONCURRENT_COMPACTIONS=0
配置文件
storage-max-concurrent-compactions: 0
storage-max-concurrent-compactions = 0
{
  "storage-max-concurrent-compactions": 0
}

storage-max-index-log-file-size

索引预写日志 (WAL) 文件将压缩为索引文件的大小(以字节为单位)。较小的值将导致日志文件更快地被压缩,并以写入吞吐量为代价降低堆使用率。

默认值: 1048576

influxd 标志环境变量配置键
--storage-max-index-log-file-sizeINFLUXD_STORAGE_MAX_INDEX_LOG_FILE_SIZEstorage-max-index-log-file-size
influxd 标志
influxd --storage-max-index-log-file-size=1048576
环境变量
export INFLUXD_STORAGE_MAX_INDEX_LOG_FILE_SIZE=1048576
配置文件
storage-max-index-log-file-size: 1048576
storage-max-index-log-file-size = 1048576
{
  "storage-max-index-log-file-size": 1048576
}

storage-no-validate-field-size

跳过对传入写入请求的字段大小验证。

默认值: false

influxd 标志环境变量配置键
--storage-no-validate-field-sizeINFLUXD_STORAGE_NO_VALIDATE_FIELD_SIZEstorage-no-validate-field-size
influxd 标志
influxd --storage-no-validate-field-size
环境变量
export INFLUXD_STORAGE_NO_VALIDATE_FIELD_SIZE=true
配置文件
storage-no-validate-field-size: true
storage-no-validate-field-size = true
{
  "storage-no-validate-field-size": true
}

storage-retention-check-interval

保留策略强制检查的间隔。

默认值: 30m0s

influxd 标志环境变量配置键
--storage-retention-check-intervalINFLUXD_STORAGE_RETENTION_CHECK_INTERVALstorage-retention-check-interval
influxd 标志
influxd --storage-retention-check-interval=30m0s
环境变量
export INFLUXD_STORAGE_RETENTION_CHECK_INTERVAL=30m0s
配置文件
storage-retention-check-interval: 30m0s
storage-retention-check-interval = "30m0s"
{
  "storage-retention-check-interval": "30m0s"
}

storage-series-file-max-concurrent-snapshot-compactions

可以跨数据库中所有序列分区并发运行的最大快照压缩数。

默认值: 0

influxd 标志环境变量配置键
--storage-series-file-max-concurrent-snapshot-compactionsINFLUXD_STORAGE_SERIES_FILE_MAX_CONCURRENT_SNAPSHOT_COMPACTIONSstorage-series-file-max-concurrent-snapshot-compactions
influxd 标志
influxd --storage-series-file-max-concurrent-snapshot-compactions=0
环境变量
export INFLUXD_STORAGE_SERIES_FILE_MAX_CONCURRENT_SNAPSHOT_COMPACTIONS=0
配置文件
storage-series-file-max-concurrent-snapshot-compactions: 0
storage-series-file-max-concurrent-snapshot-compactions = 0
{
  "storage-series-file-max-concurrent-snapshot-compactions": 0
}

storage-series-id-set-cache-size

TSI 索引中用于存储先前计算的序列结果的内部缓存大小。缓存的结果会快速返回,而无需在执行具有相同标签键/值谓词的后续查询时重新计算。将此值设置为 0 将禁用缓存,并可能降低查询性能。

默认值: 100

只有当数据库的所有指标中经常使用的标签键/值谓词集大于 100 时,才应增加此值。增加缓存大小可能会导致堆使用率增加。

influxd 标志环境变量配置键
--storage-series-id-set-cache-sizeINFLUXD_STORAGE_SERIES_ID_SET_CACHE_SIZEstorage-series-id-set-cache-size
influxd 标志
influxd --storage-series-id-set-cache-size=100
环境变量
export INFLUXD_STORAGE_SERIES_ID_SET_CACHE_SIZE=100
配置文件
storage-series-id-set-cache-size: 100
storage-series-id-set-cache-size = 100
{
  "storage-series-id-set-cache-size": 100
}

storage-shard-precreator-advance-period

在分片组结束时间之前的多长时间创建后继分片组。

默认值: 30m0s

influxd 标志环境变量配置键
--storage-shard-precreator-advance-periodINFLUXD_STORAGE_SHARD_PRECREATOR_ADVANCE_PERIODstorage-shard-precreator-advance-period
influxd 标志
influxd --storage-shard-precreator-advance-period=30m0s
环境变量
export INFLUXD_STORAGE_SHARD_PRECREATOR_ADVANCE_PERIOD=30m0s
配置文件
storage-shard-precreator-advance-period: 30m0s
storage-shard-precreator-advance-period = "30m0s"
{
  "storage-shard-precreator-advance-period": "30m0s"
}

storage-shard-precreator-check-interval

预创建新分片检查的间隔。

默认值: 10m0s

influxd 标志环境变量配置键
--storage-shard-precreator-check-intervalINFLUXD_STORAGE_SHARD_PRECREATOR_CHECK_INTERVALstorage-shard-precreator-check-interval
influxd 标志
influxd --storage-shard-precreator-check-interval=10m0s
环境变量
export INFLUXD_STORAGE_SHARD_PRECREATOR_CHECK_INTERVAL=10m0s
配置文件
storage-shard-precreator-check-interval: 10m0s
storage-shard-precreator-check-interval = "10m0s"
{
  "storage-shard-precreator-check-interval": "10m0s"
}

storage-tsm-use-madv-willneed

通知内核 InfluxDB 打算分页调入 TSM 文件的 mmap 区段。

默认值: false

influxd 标志环境变量配置键
--storage-tsm-use-madv-willneedINFLUXD_STORAGE_TSM_USE_MADV_WILLNEEDstorage-tsm-use-madv-willneed
influxd 标志
influxd --storage-tsm-use-madv-willneed
环境变量
export INFLUXD_STORAGE_TSM_USE_MADV_WILLNEED=true
配置文件
storage-tsm-use-madv-willneed: true
storage-tsm-use-madv-willneed = true
{
  "storage-tsm-use-madv-willneed": true
}

storage-validate-keys

验证传入的写入,以确保键仅包含有效的 Unicode 字符。

默认值: false

influxd 标志环境变量配置键
--storage-validate-keysINFLUXD_STORAGE_VALIDATE_KEYSstorage-validate-keys
influxd 标志
influxd --storage-validate-keys
环境变量
export INFLUXD_STORAGE_VALIDATE_KEYS=true
配置文件
storage-validate-keys: true
storage-validate-keys = true
{
  "storage-validate-keys": true
}

storage-wal-fsync-delay

写入在 fsync 之前等待的持续时间。大于 0 的持续时间会批量处理多个 fsync 调用。这对于较慢的磁盘或存在 WAL 写入争用时很有用。

默认值: 0s

influxd 标志环境变量配置键
--storage-wal-fsync-delayINFLUXD_STORAGE_WAL_FSYNC_DELAYstorage-wal-fsync-delay
influxd 标志
influxd --storage-wal-fsync-delay=0s
环境变量
export INFLUXD_STORAGE_WAL_FSYNC_DELAY=0s
配置文件
storage-wal-fsync-delay: 0s
storage-wal-fsync-delay = "0s"
{
  "storage-wal-fsync-delay": "0s"
}

storage-wal-max-concurrent-writes

同时尝试写入 WAL 目录的最大写入数。

默认值: 0 (可用处理单元数 × 2)

influxd 标志环境变量配置键
--storage-wal-max-concurrent-writesINFLUXD_STORAGE_WAL_MAX_CONCURRENT_WRITESstorage-wal-max-concurrent-writes
influxd 标志
influxd --storage-wal-max-concurrent-writes=0
环境变量
export INFLUXD_STORAGE_WAL_MAX_CONCURRENT_WRITES=0
配置文件
storage-wal-max-concurrent-writes: 0
storage-wal-max-concurrent-writes = 0
{
  "storage-wal-max-concurrent-writes": 0
}

storage-wal-max-write-delay

当达到WAL 目录的最大并发活动写入数时,写入 WAL 目录的写入请求将等待的最大时间量。设置为 0 以禁用超时。

默认值: 10m

influxd 标志环境变量配置键
--storage-wal-max-write-delayINFLUXD_STORAGE_WAL_MAX_WRITE_DELAYstorage-wal-max-write-delay
influxd 标志
influxd --storage-wal-max-write-delay=10m
环境变量
export INFLUXD_STORAGE_WAL_MAX_WRITE_DELAY=10m
配置文件
storage-wal-max-write-delay: 10m
storage-wal-max-write-delay = "10m"
{
  "storage-wal-max-write-delay": "10m"
}

storage-write-timeout

存储引擎处理写入请求超时之前的最大时间量。

默认值: 10s

influxd 标志环境变量配置键
--storage-write-timeoutINFLUXD_STORAGE_WRITE_TIMEOUTstorage-write-timeout
influxd 标志
influxd --storage-write-timeout=10s
环境变量
export INFLUXD_STORAGE_WRITE_TIMEOUT=10s
配置文件
storage-write-timeout: 10s
storage-write-timeout = "10s"
{
  "storage-write-timeout": "10s"
}

store

指定 REST 资源的数据存储。

选项: disk, memory
默认值: disk

为了向后兼容,此标志也接受 bolt 作为值。当使用 disk 时,REST 资源使用 bolt-pathsqlite-path 存储在磁盘上。

memory 旨在用于瞬态环境,例如测试环境,在这些环境中数据持久性无关紧要。InfluxData 不建议在生产环境中使用 memory

influxd 标志环境变量配置键
--storeINFLUXD_STOREstore
influxd 标志
influxd --store=bolt
环境变量
export INFLUXD_STORE=bolt
配置文件
store: bolt
store = "bolt"
{
  "store": "bolt"
}

strong-passwords

要求密码至少包含八个字符,并且至少包含以下四个字符类别中的三个

  • 大写字母 (A-Z)
  • 小写字母 (a-z)
  • 数字 (0-9)
  • 特殊字符 (!@#$%^&*()_+)
influxd 标志环境变量配置键
--strong-passwordsINFLUXD_STRONG_PASSWORDSstrong-passwords
influxd 标志
influxd --strong-passwords
环境变量
export INFLUXD_STRONG_PASSWORDS=true
配置文件
strong-passwords: true
strong-passwords = true
{
  "strong-passwords": true
}

testing-always-allow-setup

确保 /api/v2/setup 端点始终返回 true 以允许初始设置。此配置选项主要用于持续集成测试中。

默认值: false

influxd 标志环境变量配置键
--testing-always-allow-setupINFLUXD_TESTING_ALWAYS_ALLOW_SETUPtesting-always-allow-setup
influxd 标志
influxd --testing-always-allow-setup
环境变量
export INFLUXD_TESTING_ALWAYS_ALLOW_SETUP=true
配置文件
testing-always-allow-setup: true
testing-always-allow-setup = true
{
  "testing-always-allow-setup": true
}

tls-cert

TLS 证书文件的路径。需要设置 tls-key

有关更多信息,请参阅启用 TLS 加密

influxd 标志环境变量配置键
--tls-certINFLUXD_TLS_CERTtls-cert
influxd 标志
influxd --tls-cert=/path/to/influxdb.crt
环境变量
export INFLUXD_TLS_CERT=/path/to/influxdb.crt
配置文件
tls-cert: /path/to/influxdb.crt
tls-cert = "/path/to/influxdb.crt"
{
  "tls-cert": "/path/to/influxdb.crt"
}

tls-key

TLS 密钥文件的路径。需要设置 tls-cert

有关更多信息,请参阅启用 TLS 加密

influxd 标志环境变量配置键
--tls-keyINFLUXD_TLS_KEYtls-key
influxd 标志
influxd --tls-key=/path/to/influxdb.key
环境变量
export INFLUXD_TLS_KEY=/path/to/influxdb.key
配置文件
tls-key: /path/to/influxdb.key
tls-key = "/path/to/influxdb.key"
{
  "tls-key": "/path/to/influxdb.key"
}

tls-min-version

接受的最低 TLS 版本。

默认值: 1.2

influxd 标志环境变量配置键
--tls-min-versionINFLUXD_TLS_MIN_VERSIONtls-min-version
influxd 标志
influxd --tls-min-version=1.2
环境变量
export INFLUXD_TLS_MIN_VERSION=1.2
配置文件
tls-min-version: "1.2"
tls-min-version = "1.2"
{
  "tls-min-version": "1.2"
}

tls-strict-ciphers

将接受的 TLS 密码限制为

  • ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  • ECDHE_RSA_WITH_AES_128_GCM_SHA256
  • ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  • ECDHE_RSA_WITH_AES_256_GCM_SHA384
  • ECDHE_ECDSA_WITH_CHACHA20_POLY1305
  • ECDHE_RSA_WITH_CHACHA20_POLY1305

默认值: false

influxd 标志环境变量配置键
--tls-strict-ciphersINFLUXD_TLS_STRICT_CIPHERStls-strict-ciphers
influxd 标志
influxd --tls-strict-ciphers
环境变量
export INFLUXD_TLS_STRICT_CIPHERS=true
配置文件
tls-strict-ciphers: true
tls-strict-ciphers = true
{
  "tls-strict-ciphers": true
}

tracing-type

在 InfluxDB 中启用跟踪并指定跟踪类型。默认情况下禁用跟踪。

选项: log, jaeger

influxd 标志环境变量配置键
--tracing-typeINFLUXD_TRACING_TYPEtracing-type
influxd 标志
influxd --tracing-type=log
环境变量
export INFLUXD_TRACING_TYPE=log
配置文件
tracing-type: log
tracing-type = "log"
{
  "tracing-type": "log"
}

ui-disabled

禁用 InfluxDB 用户界面 (UI)。默认情况下启用 UI。

默认值: false

influxd 标志环境变量配置键
--ui-disabledINFLUXD_UI_DISABLEDui-disabled
influxd 标志
influxd --ui-disabled
环境变量
export INFLUXD_UI_DISABLED=true
配置文件
ui-disabled: true
ui-disabled = true
{
  "ui-disabled": true
}

vault-addr

指定 Vault 服务器的地址,表示为 URL 和端口。例如:https://127.0.0.1:8200/

influxd 标志环境变量配置键
--vault-addrVAULT_ADDRvault-addr
influxd 标志
influxd --vault-addr=https://127.0.0.1:8200/
环境变量
export VAULT_ADDR=https://127.0.0.1:8200/
配置文件
vault-addr: https://127.0.0.1:8200/
vault-addr = "https://127.0.0.1:8200/"
{
  "vault-addr": "https://127.0.0.1:8200/"
}

vault-cacert

指定本地磁盘上 PEM 编码的 CA 证书文件的路径。此文件用于验证 Vault 服务器的 SSL 证书。此设置优先于 --vault-capath 设置。

influxd 标志环境变量配置键
--vault-cacertVAULT_CACERTvault-cacert
influxd 标志
influxd  --vault-cacert=/path/to/ca.pem
环境变量
export VAULT_CACERT=/path/to/ca.pem
配置文件
vault-cacert: /path/to/ca.pem
vault-cacert = "/path/to/ca.pem"
{
  "vault-cacert": "/path/to/ca.pem"
}

vault-capath

指定本地磁盘上 PEM 编码的 CA 证书文件目录的路径。这些证书用于验证 Vault 服务器的 SSL 证书。

influxd 标志环境变量配置键
--vault-capathVAULT_CAPATHvault-capath
influxd 标志
influxd --vault-capath=/path/to/certs/
环境变量
export VAULT_CAPATH=/path/to/certs/
配置文件
vault-capath: /path/to/certs/
vault-capath = "/path/to/certs/"
{
  "vault-capath": "/path/to/certs/"
}

vault-client-cert

指定本地磁盘上 PEM 编码的客户端证书的路径。此文件用于与 Vault 服务器进行 TLS 通信。

influxd 标志环境变量配置键
--vault-client-certVAULT_CLIENT_CERTvault-client-cert
influxd 标志
influxd --vault-client-cert=/path/to/client_cert.pem
环境变量
export VAULT_CLIENT_CERT=/path/to/client_cert.pem
配置文件
vault-client-cert: /path/to/client_cert.pem
vault-client-cert = "/path/to/client_cert.pem"
{
  "vault-client-cert": "/path/to/client_cert.pem"
}

vault-client-key

指定磁盘上未加密的 PEM 编码私钥的路径,该私钥与匹配的客户端证书相对应。

influxd 标志环境变量配置键
--vault-client-keyVAULT_CLIENT_KEYvault-client-key
influxd 标志
influxd --vault-client-key=/path/to/private_key.pem
环境变量
export VAULT_CLIENT_KEY=/path/to/private_key.pem
配置文件
vault-client-key: /path/to/private_key.pem
vault-client-key = "/path/to/private_key.pem"
{
  "vault-client-key": "/path/to/private_key.pem"
}

vault-max-retries

指定遇到 5xx 错误代码时最大重试次数。默认值为 2(总共尝试三次)。设置为 0 或更小以禁用重试。

默认值: 2

influxd 标志环境变量配置键
--vault-max-retriesVAULT_MAX_RETRIESvault-max-retries
influxd 标志
influxd --vault-max-retries=2
环境变量
export VAULT_MAX_RETRIES=2
配置文件
vault-max-retries: 2
vault-max-retries = 2
{
  "vault-max-retries": 2
}

vault-client-timeout

指定 Vault 客户端超时。

默认值: 60s

influxd 标志环境变量配置键
--vault-client-timeoutVAULT_CLIENT_TIMEOUTvault-client-timeout
influxd 标志
influxd --vault-client-timeout=60s
环境变量
export VAULT_CLIENT_TIMEOUT=60s
配置文件
vault-client-timeout: 60s
vault-client-timeout = "60s"
{
  "vault-client-timeout": "60s"
}

vault-skip-verify

跳过与 Vault 通信时的证书验证。设置此变量会使 Vault 的安全模型失效,不建议使用

默认值: false

influxd 标志环境变量配置键
--vault-skip-verifyVAULT_SKIP_VERIFYvault-skip-verify
influxd 标志
influxd --vault-skip-verify
环境变量
export VAULT_SKIP_VERIFY=true
配置文件
vault-skip-verify: true
vault-skip-verify = true
{
  "vault-skip-verify": true
}

vault-tls-server-name

指定通过 TLS 连接时用作服务器名称指示 (SNI) 主机名的名称。

influxd 标志环境变量配置键
--vault-tls-server-nameVAULT_TLS_SERVER_NAMEvault-tls-server-name
influxd 标志
influxd --vault-tls-server-name=secure.example.com
环境变量
export VAULT_TLS_SERVER_NAME=secure.example.com
配置文件
vault-tls-server-name: secure.example.com
vault-tls-server-name = "secure.example.com"
{
  "vault-tls-server-name": "secure.example.com"
}

vault-token

指定与 Vault 身份验证时使用的 Vault 令牌。

influxd 标志环境变量配置键
--vault-tokenVAULT_TOKENvault-token
influxd 标志
influxd --vault-token=exAmple-t0ken-958a-f490-c7fd0eda5e9e
环境变量
export VAULT_TOKEN=exAmple-t0ken-958a-f490-c7fd0eda5e9e
配置文件
vault-token: exAmple-t0ken-958a-f490-c7fd0eda5e9e
vault-token = "exAmple-t0ken-958a-f490-c7fd0eda5e9e"
{
  "vault-token": "exAmple-t0ken-958a-f490-c7fd0eda5e9e"
}

此页是否对您有帮助?

感谢您的反馈!


Flux 的未来

Flux 即将进入维护模式。您可以继续像当前一样使用它,而无需对代码进行任何更改。

阅读更多

现已全面上市

InfluxDB 3 Core 和 Enterprise

快速启动。更快扩展。

获取更新

InfluxDB 3 Core 是一个开源、高速、近实时数据引擎,可实时收集和处理数据,并将其持久化到本地磁盘或对象存储。InfluxDB 3 Enterprise 构建在 Core 的基础上,增加了高可用性、读取副本、增强的安全性以及数据压缩,从而实现更快的查询和优化的存储。InfluxDB 3 Enterprise 的免费层可供非商业家庭或业余爱好者使用。

有关更多信息,请查看