### Welcome to the InfluxDB configuration file. # The values in this file override the default values used by the system if # a config option is not specified. The commented out lines are the configuration # field and the default value used. Uncommenting a line and changing the value # will change the value used at runtime when the process is restarted. # # 將某行的注釋符號去除並修改其值,那么在下次influxdb進程重啟后,你修改的數值就會在程序的運行緩存中生效(runtime) # 如果你不去除注釋符號,則可以查看這個參數的默認數值。 # Once every 24 hours InfluxDB will report usage data to usage.influxdata.com # The data includes a random ID, os, arch, version, the number of series and other # usage data. No data from user databases is ever transmitted. # Change this option to true to disable reporting. # reporting-disabled = false # 必須要告知你,當influxdb啟動后,每24小時influxdb會向usage.influxdata.com匯報一些使用數據 # 這些上報的數據包括隨機ID,運行系統,influxdb版本以及數據庫中series的數據 # 但是用戶數據庫中的數據是不會被發送的,當然你可以取消下面這個reporting-disabled = false 的注釋來禁用自動數據上報 # Bind address to use for the RPC service for backup and restore. # bind-address = "127.0.0.1:8088" # 設置用戶備份與修復(數據)的RPC服務地址 ### ### [meta] ### ### Controls the parameters for the Raft consensus group that stores metadata ### about the InfluxDB cluster. ### # 元數據 meta # 存儲有關InfluxDB集群元數據的 Raft consensus group 的控制參數將在下面被配置。 [meta] # Where the metadata/raft database is stored dir = "/var/lib/influxdb/meta" # 元數據/raft 數據庫被存儲的路徑 即meta目錄 # Automatically create a default retention policy when creating a database. # retention-autocreate = true # 當創建一個新的數據庫時自動為其創建一個默認的rentention policy(保留策略) # If log messages are printed for the meta service # logging-enabled = true # 是否為meta服務打印日志 ### ### [data] ### ### Controls where the actual shard data for InfluxDB lives and how it is ### flushed from the WAL. "dir" may need to be changed to a suitable place ### for your system, but the WAL settings are an advanced configuration. The ### defaults should work for most systems. ### # 數據 data # 這里的參數將會修改InfluxDB的分片數據的具體存放路徑,以及這部分數據從WAL(Write Ahead Log) # 刷新的(策略)。你需要根據系統的情況來為"dir"修改一個合適的路徑。(換言之,你應該大致估計在你保存策略下 #,你的數據需要多少磁盤空間) 當然WAL相關的配置是一種高級設置,而默認的配置應能滿足大多數的 # 使用場景 [data] # The directory where the TSM storage engine stores TSM files. dir = "/var/lib/influxdb/data" # TSM存儲引擎存儲TSM文件的目錄 # The directory where the TSM storage engine stores WAL files. wal-dir = "/var/lib/influxdb/wal" # TSM存儲引擎存儲WAL文件的目錄 # The amount of time that a write will wait before fsyncing. A duration # greater than 0 can be used to batch up multiple fsync calls. This is useful for slower # disks or when WAL write contention is seen. A value of 0s fsyncs every write to the WAL. # Values in the range of 0-100ms are recommended for non-SSD disks. # wal-fsync-delay = "0s" # 這個時間參數是在fsyncing之前一個寫入操作將等待的時間。(fsync解釋為:幀同步脈沖 操作 被同步 把文件在內存中的部分寫回磁盤) # 大於0的參數可以用來整理多重fsync操作。當系統磁盤讀寫速度較慢或出現WAL寫入延緩時,可以考慮配置該參數 # 對於非固態硬盤,這個參數推薦的配置范圍是0~100毫秒 # The type of shard index to use for new shards. The default is an in-memory index that is # recreated at startup. A value of "tsi1" will use a disk based index that supports higher # cardinality datasets. # index-version = "inmem" # 對於influxdb新產生的分片索引的類型將在這里被設置。初始默認的索引類型是一種 in-memory 索引,如果你修改成 # tsi1 將會對於高基數數據支持的更好。(high-cardinality 是描述tag rentention-policy measurement組合成series規模的度量值) # Trace logging provides more verbose output around the tsm engine. Turning # this on can provide more useful output for debugging tsm engine issues. # trace-logging-enabled = false # 打印追蹤日志,也就是打印debug日志。如果打開的話會創建大量冗長的、有關tsm存儲引擎工作細節的日志。 # Whether queries should be logged before execution. Very useful for troubleshooting, but will # log any sensitive data contained within a query. # query-log-enabled = true # 這個配置決定在執行query查詢動作前是否記錄為日志。對於解決問題很有幫助 # 但是會把所有含有query的敏感數據都記錄下來 # Settings for the TSM engine # 有關TSM存儲引擎的設置 # CacheMaxMemorySize is the maximum size a shard's cache can # reach before it starts rejecting writes. # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). # Vaues without a size suffix are in bytes. # cache-max-memory-size = "1g" # cache-max-memory-size 是一個分片在拒接寫入之前的最大容量(換言之就是一個分片的最大容量) # 這里的體積單位可以是 k m 或者g 並且不區分大小寫,如果不寫單位就表示byte # CacheSnapshotMemorySize is the size at which the engine will # snapshot the cache and write it to a TSM file, freeing up memory # Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k). # Values without a size suffix are in bytes. # cache-snapshot-memory-size = "25m" # cache-snapshot-memory-size 是引擎向TSM文件寫入時,快照緩存數據的大小 # 單位規則和上面的一樣 # CacheSnapshotWriteColdDuration is the length of time at # which the engine will snapshot the cache and write it to # a new TSM file if the shard hasn't received writes or deletes # cache-snapshot-write-cold-duration = "10m" # 這個參數為:如果分片(shard)沒有接收到寫入或刪除(請求),引擎向TSM文件寫入時候產生的快照緩存文件的時間 # CompactFullWriteColdDuration is the duration at which the engine # will compact all TSM files in a shard if it hasn't received a # write or delete # compact-full-write-cold-duration = "4h" # 這個參數為:若分片沒有收到寫入或者刪除(請求),則在這個參數表示的時間間隔后壓縮這個分片中的所有TSM文件 # The maximum number of concurrent full and level compactions that can run at one time. A # value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. Any number greater # than 0 limits compactions to that value. This setting does not apply # to cache snapshotting. # max-concurrent-compactions = 0 # 同一時刻,全並發與level compaction的最大數值。(與influxdb並發性能有關)如果將這個參數設為0表示,在influxdb運時 # runtime.GOMAXPROCS(0)為50%(這個參數是GO語言設置go進程對cpu核心的使用的)任何大於0的數值則等同相同的compaction數值 # 這個設置不影響緩存快照功能 # The maximum series allowed per database before writes are dropped. This limit can prevent # high cardinality issues at the database level. This limit can be disabled by setting it to # 0. # max-series-per-database = 1000000 # 每個數據庫的最大series數值,設置這個數值可以避免高基數問題(就是內存要維護過多series導致OOM) # 如果你將其設置為0,則表示禁用該限制 # The maximum number of tag values per tag that are allowed before writes are dropped. This limit # can prevent high cardinality tag values from being written to a measurement. This limit can be # disabled by setting it to 0. # max-values-per-tag = 100000 # 對於同一個measurement允許的最大 不同tag數值,功能和上面的一樣,防止高基數問題。同樣設置為0可以禁用該設置 # 所以在向influxdb導入數據應該大致考慮下數據庫允許的series數與tag數是否滿足需求 ### ### [coordinator] ### ### Controls the clustering service configuration. ### # 協同器配置,管理集群服務器配置 [coordinator] # The default time a write request will wait until a "timeout" error is returned to the caller. # write-timeout = "10s" # 寫入超時時間 # The maximum number of concurrent queries allowed to be executing at one time. If a query is # executed and exceeds this limit, an error is returned to the caller. This limit can be disabled # by setting it to 0. # max-concurrent-queries = 0 # 數據庫允許的最大查詢並發數,如果達到設置上限后,還有人執行查詢操作,那么influxdb將為其返回一個錯誤。 # 設置為0則禁用該配置。 # The maximum time a query will is allowed to execute before being killed by the system. This limit # can help prevent run away queries. Setting the value to 0 disables the limit. # query-timeout = "0s" # 一個查詢請求在被系統殺死前,被運行執行的最大時間。這個參數可以避免一些 失控的查詢行為 對程序可能造成的損害。 # 比如說過大的查詢導致內存不夠用而使influxdb崩潰。設置為0則為禁用該配置 # The time threshold when a query will be logged as a slow query. This limit can be set to help # discover slow or resource intensive queries. Setting the value to 0 disables the slow query logging. # log-queries-after = "0s" # 一條查詢會被記錄為"慢查詢"的時間門檻。這個配置可以幫助你找到或區分哪些是慢查詢,或者稱之為資源密集查詢。設置為0則為禁用 # The maximum number of points a SELECT can process. A value of 0 will make # the maximum point count unlimited. This will only be checked every second so queries will not # be aborted immediately when hitting the limit. # max-select-point = 0 # SELECT 語句一次可查詢的最大points(時間點數據),如果設置為0則表示符合select條件,有多少條記錄就返回多少條 # The maximum number of series a SELECT can run. A value of 0 will make the maximum series # count unlimited. # max-select-series = 0 # SELECT 語句可查詢series的最大數目 # The maxium number of group by time bucket a SELECT can create. A value of zero will max the maximum # number of buckets unlimited. # max-select-buckets = 0 # SELECT 語句可創建的時間段限定條件的最大數目 ### ### [retention] ### ### Controls the enforcement of retention policies for evicting old data. ### # 保存策略,控制保留策略與清除過期數據 [retention] # Determines whether retention policy enforcement enabled. # enabled = true # 控制是否啟用保存策略 # The interval of time when retention policy enforcement checks run. # check-interval = "30m" # 系統每隔這個參數的時間就會去檢查一下這些保留策略是不是在運行 ### ### [shard-precreation] ### ### Controls the precreation of shards, so they are available before data arrives. ### Only shards that, after creation, will have both a start- and end-time in the ### future, will ever be created. Shards are never precreated that would be wholly ### or partially in the past. # 分片預創建階段 # 控制分片的預創建,使它們在存儲實際數據之前就處於可用狀態。(后面一段是講未來的變動計划) [shard-precreation] # Determines whether shard pre-creation service is enabled. # enabled = true # 是否開啟分片預創建,默認開啟 # The interval of time when the check to pre-create new shards runs. # check-interval = "10m" # 每隔這個參數的時間就會去檢查一下預創建新分片有沒有在運行 # The default period ahead of the endtime of a shard group that its successor # group is created. # advance-period = "30m" # 這個參數控制,在某分片組能存儲的截至時間到來之前多久,就創建其繼承者(說得很擬人,就是創建新的分片組) ### ### Controls the system self-monitoring, statistics and diagnostics. ### ### The internal database for monitoring data is created automatically if ### if it does not already exist. The target retention within this database ### is called 'monitor' and is also created with a retention period of 7 days ### and a replication factor of 1, if it does not exist. In all cases the ### this retention policy is configured as the default for the database. # 系統自我監控、數據與診斷功能 # [monitor] # Whether to record statistics internally. # store-enabled = true # 是否記錄內部統計數據 # The destination database for recorded statistics # store-database = "_internal" # 存儲內部統計數據的數據名稱 # The interval at which to record statistics # store-interval = "10s" # 存儲統計數據的時間間隔 ### ### [http] ### ### Controls how the HTTP endpoints are configured. These are the primary ### mechanism for getting data into and out of InfluxDB. ### # http設置,設置http端點配置。這些配置與influxdb數據流入流出的基礎機制有關 [http] # Determines whether HTTP endpoint is enabled. # enabled = true # 配置http端點是否啟用,默認開啟 # The bind address used by the HTTP service. # bind-address = ":8086" # 如果使用HTTP傳輸服務,綁定端口,默認為8086 # Determines whether user authentication is enabled over HTTP/HTTPS. # auth-enabled = false # 在HTTP/HTTPS上是否開啟用戶驗證,默認關閉 # The default realm sent back when issuing a basic auth challenge. # realm = "InfluxDB" # 當發起一次基礎認證所范圍的默認領域(不是很明白這個配置的意思) # Determines whether HTTP request logging is enabled. # log-enabled = true # 配置HTTP請求是否記錄於日志 # Determines whether detailed write logging is enabled. # write-tracing = false # 配置寫入數據的細節內容是否記錄於日志,默認為關閉 # Determines whether the pprof endpoint is enabled. This endpoint is used for # troubleshooting and monitoring. # pprof-enabled = true # 配置pprof端點是否開啟,這個端點用於問題調試與監控 # Determines whether HTTPS is enabled. # https-enabled = false # 配置HTTPS是否開啟,默認為關閉 # The SSL certificate to use when HTTPS is enabled. # https-certificate = "/etc/ssl/influxdb.pem" # 如果開啟HTTPS,需要在這里配置SSL證書地址 # Use a separate private key location. # https-private-key = "" # 配置https的本地分離私鑰 # The JWT auth shared secret to validate requests using JSON web tokens. # shared-secret = "" # JWT認證所使用的JSON網頁token # The default chunk size for result sets that should be chunked. # max-row-limit = 0 # 默認塊大小 # The maximum number of HTTP connections that may be open at once. New connections that # would exceed this limit are dropped. Setting this value to 0 disables the limit. # max-connection-limit = 0 # 最大可同時創建的HTTP連接數。如果達到此數值,新的HTTP連接會被拒絕。設置為0則禁用該配置 # Enable http service over unix domain socket # unix-socket-enabled = false # 允許在unix域套接字上啟用http服務,默認關閉 # The path of the unix domain socket. # bind-socket = "/var/run/influxdb.sock" # unix域套接字路徑配置 # The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit. # max-body-size = 25000000 # 客戶端發送請求的最大體積限制,單位為字節。設置為0則為禁用該配置 ### ### [ifql] ### ### Configures the ifql RPC API. ### # 配置ifql RPC接口 [ifql] # Determines whether the RPC service is enabled. # enabled = true # 是否開啟RPC服務 # Determines whether additional logging is enabled. # log-enabled = true # 是否在日志中記錄這塊內容 # The bind address used by the ifql RPC service. # bind-address = ":8082" # ifql RPC服務的綁定端口 ### ### [subscriber] ### ### Controls the subscriptions, which can be used to fork a copy of all data ### received by the InfluxDB host. ### # 訂閱者,控制訂閱功能,是否允許從Influxdb主機上fork整份數據 [subscriber] # Determines whether the subscriber service is enabled. # enabled = true # 是否開啟訂閱者服務 # The default timeout for HTTP writes to subscribers. # http-timeout = "30s" # 向訂閱者通過HTTP寫入的超時時間 # Allows insecure HTTPS connections to subscribers. This is useful when testing with self- # signed certificates. # insecure-skip-verify = false # 是否允許向訂閱者創建不安全HTTPS連接,在測試自簽證書時很有用 # The path to the PEM encoded CA certs file. If the empty string, the default system certs will be used # ca-certs = "" # PEM編碼CA證書文件的路徑,如果為空,則默認的系統證書會被應用 # The number of writer goroutines processing the write channel. # write-concurrency = 40 # 處理寫入通道的 go協程數目 # The number of in-flight writes buffered in the write channel. # write-buffer-size = 1000 # 在寫入通道的寫入緩存大小 ### ### [[graphite]] ### ### Controls one or many listeners for Graphite data. ### # 控制一個或多個Graphite數據監聽器 [[graphite]] # Determines whether the graphite endpoint is enabled. # 設置graphite端點是否開啟 # enabled = false # database = "graphite" # 數據庫名 # retention-policy = "" # 保存策略 # bind-address = ":2003" # 綁定端口 # protocol = "tcp" # 連接協議 # consistency-level = "one" # 一致性級別 # These next lines control how batching works. You should have this enabled # otherwise you could get dropped metrics or poor performance. Batching # will buffer points in memory if you have many coming in. # 下面的配置是有關於batching的設置。你最好打開這些配置,否則可能會導致丟失metrcis或遇到(influxdb) # 性能過低的情況。當有大量數據點要被寫入時,Batching會在內存中緩存這些數據點 # Flush if this many points get buffered # batch-size = 5000 # 當這么多數據點被緩存后進行清理或刷新操作(flush) # number of batches that may be pending in memory # batch-pending = 10 # 在內存中可被掛起的batch數量 # Flush at least this often even if we haven't hit buffer limit # batch-timeout = "1s" # 如果我們沒有達到緩存上限,也會以這個時間為最低值進行清理(flush) # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. # udp-read-buffer = 0 # UDP讀取緩存大小,0代表采用系統默認值。如果這個值大於系統所設置的最大值,UDP監聽器就會失效 ### This string joins multiple matching 'measurement' values providing more control over the final measurement name. # separator = "." # 這個配置可以提供對 最終measurement名稱的控制?() ### Default tags that will be added to all metrics. These can be overridden at the template level ### or by tags extracted from metric # tags = ["region=us-east", "zone=1c"] # 修改默認tags,來添加給所有metrics 這些可以被模板等級(template level)或者從metrci中提取的tags所改寫 ### Each template line requires a template pattern. It can have an optional ### filter before the template and separated by spaces. It can also have optional extra ### tags following the template. Multiple tags should be separated by commas and no spaces ### similar to the line protocol format. There can be only one default template. # 下面的模板配置,每一行都要求一個模板類型,在模板前可以用空格來分隔一個可選的過濾器。 # 在下面的模板中還可以有可選的額外tags。和行協議格式(line protocol)一樣,用逗號(不要有空格)來分隔多個tags # 也可以只有一個默認的模板 # templates = [ # "*.app env.service.resource.measurement", # # Default template # "server.*", # ] ### ### [collectd] ### ### Controls one or many listeners for collectd data. ### # collectd 控制一個或多個collectd 數據監聽器 [[collectd]] # enabled = false # bind-address = ":25826" # database = "collectd" # retention-policy = "" # # The collectd service supports either scanning a directory for multiple types # db files, or specifying a single db file. # collectd不僅支持掃描一個目錄下不同類型的文件,可以只掃描一個指定的db數據庫文件 # typesdb = "/usr/local/share/collectd" # # security-level = "none" # 安全級別 # auth-file = "/etc/collectd/auth_file" # 認證文件路徑 # These next lines control how batching works. You should have this enabled # otherwise you could get dropped metrics or poor performance. Batching # will buffer points in memory if you have many coming in. # 這一行和上面graphite一樣,描述batch工作的 # Flush if this many points get buffered # batch-size = 5000 # Number of batches that may be pending in memory # batch-pending = 10 # Flush at least this often even if we haven't hit buffer limit # batch-timeout = "10s" # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. # read-buffer = 0 # Multi-value plugins can be handled two ways. # "split" will parse and store the multi-value plugin data into separate measurements # "join" will parse and store the multi-value plugin as a single multi-value measurement. # "split" is the default behavior for backward compatability with previous versions of influxdb. # 多值插件(multi-value plugin)可以用兩種方式來運行 # "split"會將多值插件解析並保存到單獨的measurement中 # "join" 則會把它們像一個單值一樣解析並保存 # parse-multivalue-plugin = "split" ### ### [opentsdb] ### ### Controls one or many listeners for OpenTSDB data. ### # opentsdb的相關配置 [[opentsdb]] # enabled = false # bind-address = ":4242" # database = "opentsdb" # retention-policy = "" # consistency-level = "one" # 一致性等級 # tls-enabled = false # 是否開啟tls安全傳輸 # certificate= "/etc/ssl/influxdb.pem" # 證書路徑 # Log an error for every malformed point. # log-point-errors = true # 如果出現畸形、殘缺的數據點,則在日志中以error等級記錄 # These next lines control how batching works. You should have this enabled # otherwise you could get dropped metrics or poor performance. Only points # metrics received over the telnet protocol undergo batching. # batch相關設置 # Flush if this many points get buffered # batch-size = 1000 # Number of batches that may be pending in memory # batch-pending = 5 # Flush at least this often even if we haven't hit buffer limit # batch-timeout = "1s" ### ### [[udp]] ### ### Controls the listeners for InfluxDB line protocol data via UDP. ### # 通過UDP協議來監聽InfluxDB行協議數據的控制配置 [[udp]] # enabled = false # bind-address = ":8089" # database = "udp" # retention-policy = "" # These next lines control how batching works. You should have this enabled # otherwise you could get dropped metrics or poor performance. Batching # will buffer points in memory if you have many coming in. # Flush if this many points get buffered # batch-size = 5000 # Number of batches that may be pending in memory # batch-pending = 10 # Will flush at least this often even if we haven't hit buffer limit # batch-timeout = "1s" # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max. # read-buffer = 0 ### ### [continuous_queries] ### ### Controls how continuous queries are run within InfluxDB. ### # InfluxDB中的持續查詢的相關配置(continuous queries) [continuous_queries] # Determines whether the continuous query service is enabled. # 是否開啟持續查詢 # enabled = true # Controls whether queries are logged when executed by the CQ service. # log-enabled = true # 當持續查詢被執行時時候記錄日志 # Controls whether queries are logged to the self-monitoring data store. # query-stats-enabled = false # 控制查詢是否被influxdb的自我監控數據所存儲 # interval for how often continuous queries will be checked if they need to run # run-interval = "1s" # 如果CQ需要被運行,則對它們進行檢查的時間間隔將在這里被設置