InfluxDB

1.InfluxDB-官方测试数据导入

依然范特西╮ 提交于 2019-12-01 16:08:08
本文翻译自官网,官方文档地址: https://docs.influxdata.com/influxdb/v1.7/query_language/data_download/ 1.下载官网示例数据 命令如下: curl https://s3.amazonaws.com/noaa.water-database/NOAA_data.txt -o NOAA_data.txt 图示: 可见,执行完命令之后,在当前目录可以看到下载成功的数据 NOAA_data.txt 。通过 cat 命令还可以看到文件中的内容。 2.将数据导入到influxdb中 命令如下: influx -import -path=NOAA_data.txt -precision=s -database=NOAA_water_database 图示: 3.查看结果 进入到InfluxDB中。如下图,可见通过上面的导入命令,已在influxdb中创建了一个名为NOAA_water_database的数据库,并且在库中新建了几个表并插入了测试数据。 查询数据测试: 至此,官网测试数据导入完成。 来源: https://www.cnblogs.com/suhaha/p/11692005.html

Update multiple field values matching a condition in InfluxDB

∥☆過路亽.° 提交于 2019-12-01 14:46:50
In an InfluxDB measurement, how can the field values of points matching a query be updated? Is this still not easily doable as of v1.6 ? As the example in that GitHub ticket suggested, what's the cleanest way of achieving something like this? UPDATE access_log SET username='something' WHERE mac='xxx' Anything better than driving it all from the client by updating individual points ? Q: How can the field values of points matching a query be updated? Is this still not easily doable as of v1.4? A: From the best of my knowledge, there isn't an easy way to accomplish update in version 1.4 yet.

C3.js - How to specify the timestamp format when plotting timeseries taken from InfluxDB

ぃ、小莉子 提交于 2019-12-01 14:32:41
问题 influxDB timestamps look like this: 2015-01-29T21:55:43.702900257Z The question is what options should I use for the x-axis when I generate the graph with C3.js The error I get: "Failed to parse x '2015-01-29T21:55:43.702900257Z' to Date object" Maybe this jsfiddle will help you do some quick tests... I think the problem is with the time format but any other suggestions are welcome: axis: { x: { type: 'timeseries', tick: { format: '%Y-%m-%d' } } } 回答1: First, I had to add xFormat because as

Update multiple field values matching a condition in InfluxDB

北城余情 提交于 2019-12-01 13:09:11
问题 In an InfluxDB measurement, how can the field values of points matching a query be updated? Is this still not easily doable as of v1.6? As the example in that GitHub ticket suggested, what's the cleanest way of achieving something like this? UPDATE access_log SET username='something' WHERE mac='xxx' Anything better than driving it all from the client by updating individual points? 回答1: Q: How can the field values of points matching a query be updated? Is this still not easily doable as of v1

[转帖]时序数据库技术体系 – InfluxDB TSM存储引擎之数据读取

允我心安 提交于 2019-12-01 10:19:35
时序数据库技术体系 – InfluxDB TSM存储引擎之数据读取 http://hbasefly.com/2018/05/02/timeseries-database-7/ 2018年5月2日 范欣欣 时序数据库 任何一个数据库系统内核关注的重点无非:数据在内存中如何存储、在文件中如何存储、索引结构如何存储、数据写入流程以及数据读取流程。关于InfluxDB存储内核,笔者在之前的文章中已经比较全面的介绍了数据的文件存储格式、倒排索引存储实现以及数据写入流程,本篇文章重点介绍InfluxDB中时序数据的读取流程。 InfluxDB支持类SQL查询,称为InfluxQL。InfluxQL支持基本的DDL操作和DML操作语句,详见 InfluxQL_Spec ,比如Select语句: select_stmt = "SELECT" fields from_clause [ into_clause ] [ where_clause ] [ group_by_clause ] [ order_by_clause ] [ limit_clause ] [ offset_clause ] [ slimit_clause ] [ soffset_clause ] . 使用InfluxQL可以非常方便、人性化地对InfluxDB中的时序数据进行多维聚合分析

[转帖]时序数据库技术体系 – InfluxDB TSM存储引擎之数据写入

女生的网名这么多〃 提交于 2019-12-01 10:19:34
时序数据库技术体系 – InfluxDB TSM存储引擎之数据写入 http://hbasefly.com/2018/03/27/timeseries-database-6/ 2018年3月27日 范欣欣 时序数据库 之前两篇文章笔者分别从TSM File文件存储格式、倒排索引文件存储格式这两个方面对InfluxDB最基础、最底层也最核心的存储模块进行了介绍,接下来笔者会再用两篇文章在存储文件的基础上分别介绍InfluxDB是如何处理用户的写入(删除)请求和读取请求的。在阅读这两篇文章之前,强烈建议看官先行阅读之前的多篇文章,不然可能会有一定的阅读障碍。 InfluxDB写入总体框架 InfluxDB提供了多种接口协议供外部应用写入,比如可以使用collected采集数据上传,可以使用opentsdb作为输入,也可以使用http协议以及udp协议批量写入数据。批量数据进入到InfluxDB之后总体会经过三个步骤的处理,如下图所示: 批量时序数据shard路由:InfluxDB首先会将这些数据根据shard的不同分成不同的分组,每个分组的时序数据会发送到对应的shard。每个shard相当于HBase中region的概念,是InfluxDB中处理用户读写请求的单机引擎。 倒排索引引擎构建倒排索引:InfluxDB中shard由两个LSM引擎构成 – 倒排索引引擎和TSM引擎

[转帖]时间序列数据库 (TSDB)

。_饼干妹妹 提交于 2019-12-01 07:13:46
时间序列数据库 (TSDB) https://www.jianshu.com/p/31afb8492eff 0.3392019.01.28 10:51:33字数 5598阅读 4030 背景 2017年时序数据库忽然火了起来。开年2月Facebook开源了beringei时序数据库;到了4月基于PostgreSQL打造的时序数据库TimeScaleDB也开源了,而早在2016年7月,百度云在其天工物联网平台上发布了国内首个多租户的分布式时序数据库产品TSDB,成为支持其发展制造,交通,能源,智慧城市等产业领域的核心产品,同时也成为百度战略发展产业物联网的标志性事件。 例如: 时间序列数据库 Time Series Database (TSDB) 随着分布式系统监控、物联网的发展,TSDB开始受到更多的关注。 维基百科上对于时间序列的定义是‘一系列数据点按照时间顺序排列’ 时间序列数据就是历史烙印,具有不变性,、唯一性、时间排序性 时间序列数据跟关系型数据库有太多不同,但是很多公司并不想放弃关系型数据库。 于是就产生了一些特殊的用法,比如用 MySQL 的 VividCortex , 用 Postgres 的 Timescale 。 很多人觉得特殊的问题需要特殊的解决方法,于是很多时间序列数据库从头写起,不依赖任何现有的数据库, 比如 Graphite , InfluxDB 。

go监控方案(1) -- 概述

血红的双手。 提交于 2019-12-01 06:26:35
概述 为什么需要监控 在编写应用程序的时候,通常会记录日志以便事后分析,在很多情况下是产生了问题之后,再去查看日志,是一种事后的静态分析。 在很多时候,我们可能需要了解整个系统在当前,或者某一时刻运行的情况,比如当前系统中对外提供了多少次服务,这些服务的响应时间是多少, 随时间变化的情况是什么样的,系统出错的频率是多少。这些动态的准实时信息对于监控整个系统的运行健康状况来说很重要。 由于业务系统数量大,每天都会产生大量的系统日志和业务日志,单流式业务的一台服务器产生的日志达400M 想直接查看内容打开可能几分钟, 而且内容之多根本无法查看,给开发和运维带来诸多不便,现业务都是分布式的,日志也是分布在每台服务器上, 所以查看日志和统计更是效率低下。实时收集分布在不同节点或机器上的日志,供离线或在线查阅及分析来提升工作效率的需求异常迫切, 这些动态的准实时信息对于监控整个系统的运行健康状况来说很重要。 Profiling特别重要。如果能有一个特别强大的Profiling系统,就知道整个系统在哪个地方,哪台机器上,花了多少CPU、内存、磁盘IO或者网络带宽等资源,才能知道优化什么地方效益最大。 监控需要的信息从哪里获得? 这些信息需要数据作为基础直接获得或者计算获得,那么实时数据怎么去获取,什么标准来作为测量标准。也就是信息采集的时候,怎么去获得。如下面这些实时数据如何获得 响应时间

go监控方案(7) -- 实现

我的未来我决定 提交于 2019-12-01 06:26:22
metrics 客户端 数据采集使用 go-metrics 传输使用UDP, 仿StatsD上传采集数据, InfluxDB进行数据存储, Grafana进行展示。 实现github 地址 https://github.com/solate/metrics 该地址有已经改好的配置文件可以直接使用。 使用的all-in-one : git docker-statsd-influxdb-grafana docker hub 地址 数据封装 //挂载配置文件,已修改statsd模版 docker run --ulimit nofile=66000:66000 -v /root/telegraf.conf:/etc/telegraf/telegraf.conf -d --name docker-statsd-influxdb-grafana -p 3003:3003 -p 3004:8888 -p 8086:8086 -p 8125:8125/udp samuelebistoletti/docker-statsd-influxdb-grafana:latest register register 使用的name 必须是不同的 telegraf 配置修改 将 [[inputs.statsd]] 部分配置打开, 修改templates为: templates = [ "*

Insert line in InfluxDB using CURL

别来无恙 提交于 2019-12-01 00:31:46
I have the following POST request which is done from C#: POST http://192.168.123.27:8086/write?db=HWDB HTTP/1.1 Content-Type: text/plain; charset=utf-8 Host: 192.168.123.27:8086 Content-Length: 97 Expect: 100-continue Connection: Keep-Alive HARDWARE,CPU=1 count=91i 1456298998307783936 HARDWARE,CPU=2 count=92i 1456298998307783936 I want to do the same request using CURL. I'm using the following command: curl -i -XPOST http://192.168.123.27:8086/write?db=HWDB --data-binary "HARDWARE,CPU="1" value=91, CPU="2" value=92 1422568543702900257" This will return the error: {"error":"unable to parse