一灰灰blog 一灰灰blog
首页
  • InfluxDB
  • MongoDB
  • MySql
  • 基础系列
  • DB系列
  • 搜索系列
  • MQ系列
  • WEB系列
  • 中间件
  • 运维
  • SpringSecurity
  • SpringCloud
  • QuickAlarm
  • QuickCrawer
  • QuickFix
  • QuickMedia
  • QuickSpi
  • QuickTask
  • 高可用
  • 分类
  • 标签
  • 归档
  • 收藏
  • 关于
GitHub (opens new window)

一灰灰blog

资深搬运工
首页
  • InfluxDB
  • MongoDB
  • MySql
  • 基础系列
  • DB系列
  • 搜索系列
  • MQ系列
  • WEB系列
  • 中间件
  • 运维
  • SpringSecurity
  • SpringCloud
  • QuickAlarm
  • QuickCrawer
  • QuickFix
  • QuickMedia
  • QuickSpi
  • QuickTask
  • 高可用
  • 分类
  • 标签
  • 归档
  • 收藏
  • 关于
GitHub (opens new window)
  • InfluxDB

    • v1.6.0安装和简单使用小结
    • InfluxDB基本概念小结
    • 时序数据库InfluxDB之备份和恢复策略
    • InfluxDB之权限管理
    • InfluxDB之配置修改
      • I. 配置
        • 1. 配置文件
        • 2. 数据存储修改
        • 3. 端口修改
      • II. 其他
        • 1. 一灰灰Blog: https://liuyueyi.github.io/hexblog
        • 2. 声明
        • 3. 扫描关注
    • InfluxDb之时间戳显示为日期格式
    • Influx Sql系列教程零:安装及influx-cli使用姿势介绍
    • Influx Sql系列教程一:database 数据库
    • Influx Sql系列教程二:retention policy 保存策略
    • Influx Sql系列教程三:measurement 表
    • Influx Sql系列教程四:series/point/tag/field
    • Influx Sql系列教程五:insert 添加数据
    • Influx Sql系列教程六:insert 修改数据
    • Influx Sql系列教程七:delete 删除数据
    • Influx Sql系列教程八:query数据查询基本篇
    • Influx Sql系列教程九:query数据查询基本篇二
    • Influx Sql系列教程十:query数据查询基本篇三
  • MongoDB

  • MySql

  • 数据库
  • InfluxDB
一灰灰
2019-05-06

InfluxDB之配置修改

influxdb安装完毕之后,一般来讲,有些配置有必要改一下的,比如默认的端口号,默认的数据存储位置,本篇将介绍下常用配置的修改姿势

# I. 配置

系统环境为centos,influxdb的版本为1.6

# 1. 配置文件

默认配置文件安装目录为: /etc/influxdb/influxdb.conf

默认配置查看

infuxd config
1

输出结果如

Merging with configuration at: /etc/influxdb/influxdb.conf
reporting-disabled = false
bind-address = "127.0.0.1:8088"

[meta]
  dir = "/var/lib/influxdb/meta"
  retention-autocreate = true
  logging-enabled = true

[data]
  dir = "/var/lib/influxdb/data"
  index-version = "inmem"
  wal-dir = "/var/lib/influxdb/wal"
  wal-fsync-delay = "0s"
  validate-keys = false
  query-log-enabled = true
  cache-max-memory-size = 1073741824
  cache-snapshot-memory-size = 26214400
  cache-snapshot-write-cold-duration = "10m0s"
  compact-full-write-cold-duration = "4h0m0s"
  compact-throughput = 50331648
  compact-throughput-burst = 50331648
  max-series-per-database = 1000000
  max-values-per-tag = 100000
  max-concurrent-compactions = 0
  max-index-log-file-size = 1048576
  series-id-set-cache-size = 100
  trace-logging-enabled = false
  tsm-use-madv-willneed = false

[coordinator]
  write-timeout = "10s"
  max-concurrent-queries = 0
  query-timeout = "0s"
  log-queries-after = "0s"
  max-select-point = 0
  max-select-series = 0
  max-select-buckets = 0

[retention]
  enabled = true
  check-interval = "30m0s"

[shard-precreation]
  enabled = true
  check-interval = "10m0s"
  advance-period = "30m0s"

[monitor]
  store-enabled = true
  store-database = "_internal"
  store-interval = "10s"

[subscriber]
  enabled = true
  http-timeout = "30s"
  insecure-skip-verify = false
  ca-certs = ""
  write-concurrency = 40
  write-buffer-size = 1000

[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = true
  log-enabled = true
  suppress-write-log = false
  write-tracing = false
  flux-enabled = false
  flux-log-enabled = false
  pprof-enabled = true
  debug-pprof-enabled = false
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"
  https-private-key = ""
  max-row-limit = 0
  max-connection-limit = 0
  shared-secret = ""
  realm = "InfluxDB"
  unix-socket-enabled = false
  unix-socket-permissions = "0777"
  bind-socket = "/var/run/influxdb.sock"
  max-body-size = 25000000
  access-log-path = ""
  max-concurrent-write-limit = 0
  max-enqueued-write-limit = 0
  enqueued-write-timeout = 30000000000

[logging]
  format = "auto"
  level = "info"
  suppress-logo = false

[[graphite]]
  enabled = false
  bind-address = ":2003"
  database = "graphite"
  retention-policy = ""
  protocol = "tcp"
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "1s"
  consistency-level = "one"
  separator = "."
  udp-read-buffer = 0

[[collectd]]
  enabled = false
  bind-address = ":25826"
  database = "collectd"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  batch-timeout = "10s"
  read-buffer = 0
  typesdb = "/usr/share/collectd/types.db"
  security-level = "none"
  auth-file = "/etc/collectd/auth_file"
  parse-multivalue-plugin = "split"

[[opentsdb]]
  enabled = false
  bind-address = ":4242"
  database = "opentsdb"
  retention-policy = ""
  consistency-level = "one"
  tls-enabled = false
  certificate = "/etc/ssl/influxdb.pem"
  batch-size = 1000
  batch-pending = 5
  batch-timeout = "1s"
  log-point-errors = true

[[udp]]
  enabled = false
  bind-address = ":8089"
  database = "udp"
  retention-policy = ""
  batch-size = 5000
  batch-pending = 10
  read-buffer = 0
  batch-timeout = "1s"
  precision = ""

[continuous_queries]
  log-enabled = true
  enabled = true
  query-stats-enabled = false
  run-interval = "1s"

[tls]
  min-version = ""
  max-version = ""
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

# 2. 数据存储修改

从上面的配置中可以知道,默认的数据存储为/var/lib/influxdb/data, /var/lib/influxdb/wal, /var/lib/influxdb/meta

将数据保存在我们挂载的硬盘 /influx

第一步,修改配置文件

vim /etc/influxdb/influxdb.conf

## 修改配置
[meta]
  dir = '/influx/meta'
  
[data]
  dir = '/influx/data'
  war-dir = '/influx/wal'
1
2
3
4
5
6
7
8
9

第二步,修改用户组

重新制定存储目录之后,需要修改文件夹的owner和分组,否则influxdb将无法正常启动

chown -R influxdb:influxdb /influx
1

第三步,重启

service influxdb restart
1

# 3. 端口修改

可以修改默认的端口号,首先进入配置文件

[[udp]]
  bind-address = ":18089"

[[http]]
  bind-address = ":18086"
  # 开启下权限验证,相关配置可以参考博文: https://blog.hhui.top/hexblog/2019/05/05/190505-InfluxDB之权限管理/ 
  auth-enabled = true
1
2
3
4
5
6
7

# II. 其他

# 1. 一灰灰Blog (opens new window): https://liuyueyi.github.io/hexblog

一灰灰的个人博客,记录所有学习和工作中的博文,欢迎大家前去逛逛

# 2. 声明

尽信书则不如,已上内容,纯属一家之言,因个人能力有限,难免有疏漏和错误之处,如发现bug或者有更好的建议,欢迎批评指正,不吝感激

  • 微博地址: 小灰灰Blog (opens new window)
  • QQ: 一灰灰/3302797840

# 3. 扫描关注

一灰灰blog

QrCode

知识星球

goals

编辑 (opens new window)
#InfluxDB
上次更新: 2021/10/15, 19:56:22
InfluxDB之权限管理
InfluxDb之时间戳显示为日期格式

← InfluxDB之权限管理 InfluxDb之时间戳显示为日期格式→

最近更新
01
【基础系列】基于maven多环境配置
04-25
02
【WEB系列】内嵌Tomcat配置Accesslog日志文件生成位置源码探索
04-24
03
【搜索系列】ES查询常用实例演示
04-18
更多文章>
Theme by Vdoing | Copyright © 2017-2022 一灰灰Blog
MIT License | 鄂ICP备18017282号 |
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
×