文档Documentation

InfluxDB 配置选项

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

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

使用 influx 命令行界面 (CLI) 或 InfluxDB API 获取 InfluxDB 实例的运行时服务器配置。

服务器配置命令需要 操作员令牌

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

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

influx server-config

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

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

GET https://127.0.0.1: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

/debug/flush 端点添加到 InfluxDB HTTP API 以清除存储。 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

等待响应写入超时的最长持续时间。 它不允许 Handlers 基于每个请求决定持续时间。

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

设置为 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 bucket 数量。0 允许无限数量的 buckets。

默认值: 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 输出严重性级别大于或等于指定级别的日志条目。

选项: debug, info, error
默认值: 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
}

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

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

默认值: unlimited (无限制)

必须大于或等于 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 中。

选项: bolt, vault
默认值: 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。 默认情况下,每个请求都将会话的到期时间设置为从现在起五分钟。 禁用后,会话将在指定的 session length 后过期,并且用户将被重定向到登录页面,即使最近处于活动状态。

**默认值:** 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 数据库用于存储笔记本和注释的元数据。

默认值: bolt-path 位于同一目录中的 influxd.sqlite

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 开源现在处于公开 Alpha 阶段

InfluxDB 3 开源现已可用于 alpha 测试,并已获得 MIT 或 Apache 2 许可。

我们正在发布两个产品作为 alpha 的一部分。

InfluxDB 3 Core 是我们新的开源产品。 它是时间序列和事件数据的最新数据引擎。 InfluxDB 3 Enterprise 是一个商业版本,它建立在 Core 的基础上,增加了历史查询功能、读取副本、高可用性、可扩展性和细粒度安全性。

有关如何入门的更多信息,请查看