原创 George555   公众号:测试江湖路

如果这些内容对你有帮助,也可以打开微信扫一扫,加关注:

一、简介

InfluxDB:是一款用Go语言编写的开源分布式时序、事件和指标数据库, 一般主要用于存储涉及大量的时间戳数据,如DevOps监控数据,APP metrics, loT传感器数据和实时分析数据。

二、安装

1.centos下下载和安装

下载命令:wget et https://dl.influxdata.com/influxdb/releases/influxdb-1.6.2.x86_64.rpm

[root@georgeComputer georgeProject]# wget et https://dl.influxdata.com/influxdb/releases/influxdb-1.6.2.x86_64.rpm。。。。。。。此处省略1万字Saving to: “influxdb-1.6.2.x86_64.rpm”100%[===============================================>] 24,691,802  6.06M/s   in 5.0s2020-06-24 19:20:59 (4.71 MB/s) - “influxdb-1.6.2.x86_64.rpm” saved [24691802/24691802]FINISHED --2020-06-24 19:20:59--Downloaded: 1 files, 24M in 5.0s (4.71 MB/s)

安装命令:yum localinstall influxdb-1.6.2.x86_64.rpm

[root@georgeComputer georgeProject]# yum localinstall influxdb-1.6.2.x86_64.rpmLoaded plugins: fastestmirrorSetting up Local Package ProcessExamining influxdb-1.6.2.x86_64.rpm: influxdb-1.6.2-1.x86_64   | 3.7 kB     00:00。。。。。。。此处省略1万字Installed:influxdb.x86_64 0:1.6.2-1

2.windows下下载安装

InfluxDB1.2.0可自行下载

注:由于1.3后就不提供web管理端了,所以如果想用管理端的需要下载1.3之前版本,这里提供了1.2版本,这个包比较难找到,如果网络上未找到请微信联系笔者。

InfluxDB1.2.0安装:

InfluxDB的windows版本是绿色包,不需要安装,下载后解压即可使用,内部文件如下图:

三、配置-Centos环境

安装成功后,就需要去修改配置文件,以便可以和Jmeter或其他工具进行连通使用了。

当然这里windows和linux环境配置稍微有些差异,这里以linux为例进行说明:

修改如下文件:/etc/influxdb/influxdb.conf

因为jmeter把数据写入到influxdb中,需要用graphite协议或http协议(两种方式见下文中进行区分),所以需要修改如下板块内容:

[http]# Determines whether HTTP endpoint is enabled.enabled = true# The bind address used by the HTTP service.bind-address = ":8086"# Determines whether user authentication is enabled over HTTP/HTTPS.# auth-enabled = false# The default realm sent back when issuing a basic auth challenge.# realm = "InfluxDB"# Determines whether HTTP request logging is enabled.log-enabled = true[[graphite]]# Determines whether the graphite endpoint is enabled.enabled = truedatabase = "jmeterTest"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.# Flush if this many points get bufferedbatch-size = 5000# number of batches that may be pending in memorybatch-pending = 10# Flush at least this often even if we haven't hit buffer limitbatch-timeout = "1s"# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.udp-read-buffer = 0### This string joins multiple matching 'measurement' values providing more control over the final measurement name.separator = "."

修改完成后可以使用命令:Influxd config ,查询下修改后的配置信息,如下图:


[root@georgeComputer georgeProject]# influxd config
Merging with configuration at: /etc/influxdb/influxdb.conf
reporting-disabled = false
bind-address = "127.0.0.1:8088"
。。。。此处省略1万字
[http]# Determines whether HTTP endpoint is enabled.enabled = true# The bind address used by the HTTP service.bind-address = ":8086"# Determines whether user authentication is enabled over HTTP/HTTPS.# auth-enabled = false# The default realm sent back when issuing a basic auth challenge.# realm = "InfluxDB"# Determines whether HTTP request logging is enabled.log-enabled = true
[[graphite]]enabled = falsebind-address = ":2003"database = "jmeterTest"retention-policy = ""protocol = "tcp"batch-size = 5000batch-pending = 10batch-timeout = "1s"consistency-level = "one"separator = "."udp-read-buffer = 0

四、配置-Win环境

windows环境下的influxdb.conf配置文件中,需要配置如下8大板块内容:

A.meta:数据库源meta存储路径,默认是linux路径,需要改为windows目录,注意 \\

[meta]# Where the metadata/raft database is stored#dir = "/var/lib/influxdb/meta"dir = "d:\\influx\\meta"# Automatically create a default retention policy when creating a database.retention-autocreate = true# If log messages are printed for the meta servicelogging-enabled = true

B.data:TSM存储引擎存放TSM文件目录

[data]# The directory where the TSM storage engine stores TSM files.# dir = "/var/lib/influxdb/data"dir = "d:\\influx\\data"# The directory where the TSM storage engine stores WAL files.#wal-dir = "/var/lib/influxdb/wal"wal-dir = "d:\\influx\\waldir"# 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# 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

C.retention:确定是否启用执行保留策略

[retention]# Determines whether retention policy enforcment enabled.enabled = true# The interval of time when retention policy enforcement checks run.check-interval = "30m"

D.shard-precreation:确定是否开启 分片预创建,默认开启

[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"

E.monitor:是否记录内部统计数据

[monitor]# Whether to record statistics internally.store-enabled = true# The destination database for recorded statisticsstore-database = "_internal"# The interval at which to record statisticsstore-interval = "10s"

F.admin:web端管理配置

[admin]# Determines whether the admin service is enabled.enabled = true# The default bind address used by the admin service.bind-address = ":8083"# Whether the admin service should use HTTPS.# https-enabled = false# The SSL certificate used when HTTPS is enabled.# https-certificate = "/etc/ssl/influxdb.pem"

备注:admin板块是针对influxdb的web后台管理端做的设置,只有在V1.3版本之前可用,之后版本中官方配置文件取消了这个配置项,不能直接用web后台配置管理了,这时候可以用chronograf,此工具使用见后面分享。

G.http:http协议配置。用于http协议访问influxdb,比如jmeter中后端监听器(Backend Listener)中选influxdb方式

[http]# Determines whether HTTP endpoint is enabled.enabled = true# The bind address used by the HTTP service.bind-address = ":8086"

H.graphite:graphite协议配置。用于graphite协议访问influxdb,比如jmeter中后端监听器(Backend Listener)中选graphite方式

[[graphite]]# Determines whether the graphite endpoint is enabled.是否启用enabled = true#数据库名配置database = "jmeterTest"retention-policy = ""#数据库连接ip和端口配置bind-address = ":2003"#协议配置protocol = "tcp"consistency-level = "one"

#####欢迎加好友交流切磋####

QQ:464314378

微信群请先加群主微信,群主会拉各位小伙伴进群,注意添加备注。

1.Influxdb使用1相关推荐

  1. 在CentOS 7.7 x86_64上安装InfluxDB 1.8.0实录

    在InfluxDB官网获取最新稳定版的下载和安装指导 wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0.x86_64.rp ...

  2. InfluxDB 2.0 Alpha展开测试!将会加入查询语言Flux

    InfluxData释出其开源时序数据库InfluxDB 2.0 Alpha测试版,这个版本最大的更新,便是增加了新的数据脚本和查询语言Flux,不只能提供跨平台时序数据操作,还能将TICK组件堆栈整 ...

  3. influxdb java spring_Spring boot使用influxDB总结

    项目中需要存放大量设备日志,且需要对其进行简单的数据分析,信息提取工作. 结合众多考量因素,项目决定使用时序数据库中的领头羊InfluxDB. 引入依赖 项目中使用influxdb-java,在pom ...

  4. telegraf监控mysql数据库_部署Telegraf+Influxdb+Grafana 架构来监控 MySQL

    前段时间小编写了一篇:使用Nginx+Telegraf+Influxb+Grafana构建高逼格Nginx集群监控系统!文章,详细了介绍了 采集器telegraf, 时序数据库influxdb , 数 ...

  5. 时序数据库连载系列: 时序数据库一哥InfluxDB之存储机制解析

    InfluxDB 的存储机制解析 本文介绍了InfluxDB对于时序数据的存储/索引的设计.由于InfluxDB的集群版已在0.12版就不再开源,因此如无特殊说明,本文的介绍对象都是指 InfluxD ...

  6. 基于 Prometheus、InfluxDB 与 Grafana 打造监控平台

    在本文中,我将把几个常用的监控部分给梳理一下.前面我们提到过,在性能监控图谱中,有操作系统.应用服务器.中间件.队列.缓存.数据库.网络.前端.负载均衡.Web 服务器.存储.代码等很多需要监控的点. ...

  7. 可视化-grafana_使用influxDB数据

    1 添加数据源 给数据源取个名字,然后选择数据类型为influxDB. HTTP:8086是influxDB的HTTP查询API,grafana是通过这个接口获取数据. Details:选择从infl ...

  8. grafana模板_EMQ X + InfluxDB + Grafana:物联网数据监控可视化方案

    本文以常见物联网使用场景为例,介绍了如何利用 EMQ X 消息中间件与开源数据可视化方案 InfluxDB + Grafana ,将物联网设备大量基于时序的数据便捷地展示出来. 在物联网项目中接入平台 ...

  9. 将Windows下的InfluxDB、Grafana做成Windows服务

    从网上下载的Windows下的InfluxDB.Grafana,都是控制台程序,打开窗口后,很容易被别人给关掉,因此考虑做成Windows服务,nssm正是解决该问题的利器. 1.下载nssm htt ...

  10. 基于InfluxDB实现分页查询功能

    InfluxDB作为时序数据库中的翘楚,应用范围非常广泛,尤其在监控领域. 最近做了一个功能,将InfluxDB中的数据查询出来后,在前台分页展现,比如每页10条,一共100页,可以查看首页.末页,进 ...

最新文章

  1. 地图旋转_折纸效果三维旋转,不一样的地图页设计
  2. 搜索专题【2010】四2.过河问题
  3. Scala学习第五天数组
  4. python常用内置函数汇总_太全了!Python3常用内置函数总结
  5. C++ 性能剖析 (四):Inheritance 对性能的影响
  6. G6 图可视化引擎——简介
  7. mycncart操作使用教程 - 横幅广告
  8. 利用 Github Actions 自动更新 docfx 文档
  9. oracle bbed 使用,Oracle BBED使用 四步快速启动Oracle BBED
  10. 使用 js 设置组合快捷键,支持多个组合键定义,还支持 React
  11. 华为telnet的两种连接方式
  12. 分解原理_葛兰维均线的数学拟合原理--傅立叶函数的分解的应用
  13. 程序员面试金典——番外篇之约瑟夫问题1
  14. 十几位资深架构师,整理了最新架构师学习体系,分享给大家......
  15. android 文件管理 显示缩略图,android将缩略图保存到缩略图文件夹_android_开发99编程知识库...
  16. An Empirical Analysis of Anonymity in Zcash
  17. 关于网站版权声明(Copyright)的格式和写法
  18. 注塑模具与吹塑模具的区别
  19. rq940服务器 经常自动重启,高端首选 联想ThinkServer RQ940服务器
  20. 数据立方体的基本计算

热门文章

  1. 常用px,pt,em换算表
  2. Adobe Dreamweaver CS6已停止工作的解决办法
  3. ubuntu显卡输出hdmi屏幕没有声音
  4. 【C语言】判断数字是否为素数或合数
  5. Python安装 第三方库的安装技巧
  6. python怎么导入大小字母_python遍历小写英文字母的方法
  7. MATLAB火灾自动报警与消防控制系统
  8. 详解百度地图API之驾车导航
  9. python银行排队系统仿真_离散事件仿真简例——银行排队系统
  10. 第一篇 关于2012百度开发者技术论坛大会总结