全局配置

# 该选项用于上报influxdb的使用信息给InfluxData公司,默认值为false
reporting-disabled = false  
# 备份恢复时使用,默认值为8088
bind-address = ":8088"

meta相关配置

[meta]
# meta数据存放目录
dir = "/var/lib/influxdb/meta"  
# 用于控制默认存储策略,数据库创建时,会自动生成autogen的存储策略,默认值:true
retention-autocreate = true  
# 是否开启meta日志,默认值:true
logging-enabled = true

data相关配置

[data]
# 最终数据(TSM文件)存储目录
dir = "/var/lib/influxdb/data"  
# 预写日志存储目录
wal-dir = "/var/lib/influxdb/wal" 
# 是否开启tsm引擎查询日志,默认值: true
query-log-enabled = true  
# 用于限定shard最大值,大于该值时会拒绝写入,默认值:1000MB,单位:byte
cache-max-memory-size = 1048576000  
# 用于设置快照大小,大于该值时数据会刷新到tsm文件,默认值:25MB,单位:byte
cache-snapshot-memory-size = 26214400  
# tsm引擎 snapshot写盘延迟,默认值:10Minute
cache-snapshot-write-cold-duration = "10m"  
# tsm文件在压缩前可以存储的最大时间,默认值:4Hour
compact-full-write-cold-duration = "4h" 
# 限制数据库的级数,该值为0时取消限制,默认值:1000000
max-series-per-database = 1000000  
# 一个tag最大的value数,0取消限制,默认值:100000
max-values-per-tag = 100000

coordinator查询管理的配置选项

[coordinator]
# 写操作超时时间,默认值: 10s
write-timeout = "10s"  
# 最大并发查询数,0无限制,默认值: 0
max-concurrent-queries = 0  
# 查询操作超时时间,0无限制,默认值:0s
query-timeout = "0s  
# 慢查询超时时间,0无限制,默认值:0s
log-queries-after = "0s"  
# SELECT语句可以处理的最大点数(points),0无限制,默认值:0
max-select-point = 0  
# SELECT语句可以处理的最大级数(series),0无限制,默认值:0
max-select-series = 0  
# SELECT语句可以处理的最大"GROUP BY time()"的时间周期,0无限制,默认值:0
max-select-buckets = 0

retention旧数据的保留策略

[retention]
# 是否启用该模块,默认值 : true
enabled = true  
# 检查时间间隔,默认值 :"30m"
check-interval = "30m"

shard-precreation分区预创建

[shard-precreation]
# 是否启用该模块,默认值 : true
enabled = true  
# 检查时间间隔,默认值 :"10m"
check-interval = "10m"  
# 预创建分区的最大提前时间,默认值 :"30m"
advance-period = "30m"

monitor

控制InfluxDB自有的监控系统。 默认情况下,InfluxDB把这些数据写入_internal 数据库,如果这个库不存在则自动创建。 _internal 库默认的retention策略是7天,如果你想使用一个自己的retention策略,需要自己创建。

[monitor]
# 是否启用该模块,默认值 :true
store-enabled = true  
# 默认数据库:"_internal"
store-database = "_internal"  
# 统计间隔,默认值:"10s"
store-interval = "10s

admin web管理页面

[admin]
# 是否启用该模块,默认值 : false
enabled = true  
# 绑定地址,默认值 :":8083"
bind-address = ":8083"  
# 是否开启https ,默认值 :false
https-enabled = false  
# https证书路径,默认值:"/etc/ssl/influxdb.pem"
https-certificate = "/etc/ssl/influxdb.pem"

http API

[http]
# 是否启用该模块,默认值 :true
enabled = true  
# 绑定地址,默认值:":8086"
bind-address = ":8086"  
# 是否开启认证,默认值:false
auth-enabled = false  
# 配置JWT realm,默认值: "InfluxDB"
realm = "InfluxDB"  
# 是否开启日志,默认值:true
log-enabled = true  
# 是否开启写操作日志,如果置成true,每一次写操作都会打日志,默认值:false
write-tracing = false  
# 是否开启pprof,默认值:true
pprof-enabled = true  
# 是否开启https,默认值:false
https-enabled = false  
# 设置https证书路径,默认值:"/etc/ssl/influxdb.pem"
https-certificate = "/etc/ssl/influxdb.pem"  
# 设置https私钥,无默认值
https-private-key = ""  
# 用于JWT签名的共享密钥,无默认值
shared-secret = ""  
# 配置查询返回最大行数,0无限制,默认值:0
max-row-limit = 0  
# 配置最大连接数,0无限制,默认值:0
max-connection-limit = 0  
# 是否使用unix-socket,默认值:false
unix-socket-enabled = false  
# unix-socket路径,默认值:"/var/run/influxdb.sock"
bind-socket = "/var/run/influxdb.sock"

subscriber 控制Kapacitor接受数据的配置

[subscriber]
# 是否启用该模块,默认值 :true
enabled = true  
# http超时时间,默认值:"30s"
http-timeout = "30s"  
# 是否允许不安全的证书
insecure-skip-verify = false  
# 设置CA证书
ca-certs = "" 
# 设置并发数目,默认值:40
write-concurrency = 40  
# 设置buffer大小,默认值:1000
write-buffer-size = 1000

graphite 相关配置

[[graphite]]
# 是否启用该模块,默认值 :false
enabled = false  
# 数据库名称,默认值:"graphite"
database = "graphite"  
# 存储策略,无默认值
retention-policy = ""  
# 绑定地址,默认值:":2003"
bind-address = ":2003"  
# 协议,默认值:"tcp"
protocol = "tcp"  
# 一致性级别,默认值:"one
consistency-level = "one"  
# 批量size,默认值:5000
batch-size = 5000  
# 配置在内存中等待的batch数,默认值:10
batch-pending = 10  
# 超时时间,默认值:"1s"
batch-timeout = "1s"  
# udp读取buffer的大小,0表示使用操作系统提供的值,如果超过操作系统的默认配置则会出错。 该配置的默认值:0
udp-read-buffer = 0  
# 多个measurement间的连接符,默认值: "."
separator = "."

collectd

[[collectd]]
# 是否启用该模块,默认值 :false
enabled = false  
# 绑定地址,默认值: ":25826"
bind-address = ":25826"  
# 数据库名称,默认值:"collectd"
database = "collectd"  
# 存储策略,无默认值
retention-policy = ""  
# 路径,默认值:"/usr/share/collectd/types.db"
typesdb = "/usr/local/share/collectd"  
auth-file = "/etc/collectd/auth_file"
batch-size = 5000
batch-pending = 10
batch-timeout = "10s"
# udp读取buffer的大小,0表示使用操作系统提供的值,如果超过操作系统的默认配置则会出错。默认值:0
read-buffer = 0

opentsdb

[[opentsdb]]
# 是否启用该模块,默认值:false
enabled = false  
# 绑定地址,默认值:":4242"
bind-address = ":4242"  
# 默认数据库:"opentsdb"
database = "opentsdb"  
# 存储策略,无默认值
retention-policy = ""  
# 一致性级别,默认值:"one"
consistency-level = "one"  
# 是否开启tls,默认值:false
tls-enabled = false  
# 证书路径,默认值:"/etc/ssl/influxdb.pem"
certificate= "/etc/ssl/influxdb.pem"  
# 出错时是否记录日志,默认值:true
log-point-errors = true  
batch-size = 1000
batch-pending = 5
batch-timeout = "1s"

udp

[[udp]]
# 是否启用该模块,默认值:false
enabled = false  
# 绑定地址,默认值:":8089"
bind-address = ":8089"  
# 数据库名称,默认值:"udp"
database = "udp"  
# 存储策略,无默认值
retention-policy = ""  
batch-size = 5000
batch-pending = 10
batch-timeout = "1s"
# udp读取buffer的大小,0表示使用操作系统提供的值,如果超过操作系统的默认配置则会出错。 该配置的默认值:0 
read-buffer = 0

continuous_queries

[continuous_queries]
# enabled 是否开启CQs,默认值:true
enabled = true  
# 是否开启日志,默认值:true
log-enabled = true  
# 时间间隔,默认值:"1s"
run-interval = "1s"