问题标签 [influxdb]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
time-series - 时间序列数据库 - 指标与标签
我是 TSDB 的新手,我有很多温度传感器以每秒一个点的速度存储在我的数据库中。每个传感器使用一个独特的指标,还是仅使用一个指标(例如温度)与不同的标签取决于传感器更好?
我在互联网上搜索最佳实践是什么,但我没有找到一个好的答案......
谢谢!:-)
编辑:我将有来自 2500 个来源的 8 种类型的测量值(温度、设定点、能量、功率……)
database - InfluxDB 0.8.8 服务器启动无响应
所以我试图设置一个在与 grafana 服务器相同的 CentOS 机器上运行的 influxdb 服务器。目前,当我启动 influxDB 服务器时,没有返回任何数据。所以这就是我得到的所有输出:
[07/21/15 17:12:21] [INFO] Loading configuration file config.sample.toml
+---------------------------------------------+
| _____ __ _ _____ ____ |
| |_ _| / _| | | __ \| _ \ |
| | | _ __ | |_| |_ ___ _| | | | |_) | |
| | | | '_ \| _| | | | \ \/ / | | | _ < |
| _| |_| | | | | | | |_| |> <| |__| | |_) | |
| |_____|_| |_|_| |_|\__,_/_/\_\_____/|____/ |
+---------------------------------------------+
我想知道为什么它不运行服务器。它似乎退出了,但没有给出错误输出......这是我的配置文件的重要部分:
关于为什么服务不启动服务器的任何想法?编辑:我正在运行 Influxdb v0.8.8
编辑(log.txt):
[2015/07/22 15:06:31 UTC] [INFO] (main.setupLogging:69) Redirectoring logging to /opt/influxdb/shared/log.txt
[2015/07/22 15:06:31 UTC] [INFO] (main.start:164) Starting Influx Server 0.8.8 bound to 0.0.0.0...
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/server.NewServer:43) Opening database at /opt/influxdb/shared/data/db
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/wal.NewWAL:40) Opening wal in /opt/influxdb/shared/data/wal
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/api/http.(*HttpServer).EnableSsl:74) Ssl will be disabled since the ssl port or certificate path weren't set
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).Serve:566) Initializing Raft HTTP server
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).Serve:576) Raft Server Listening at 0.0.0.0:8090
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).startRaft:384) Initializing Raft Server: http://denlabapp0020.int.hidux.com:8090
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*InfluxJoinCommand).Apply:252) Adding new server to the cluster config d41518a27d24777
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:291) Added server to cluster config: 1, http://denlabapp0020.int.hidux.com:8090, denlabapp0020.int.hidux.com:8099
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:292) Checking whether this is the local server local: denlabapp0020.int.hidux.com:8099, new: denlabapp0020.int.hidux.com:8099
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).AddPotentialServer:301) Added the local server
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).startRaft:409) Recovered from log
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:96) Waiting for local server to be added
[2015/07/22 15:06:31 UTC] [INFO] (github.com/influxdb/influxdb/wal.(*WAL).SetServerId:109) Setting server id to 1 and recovering
[2015/07/22 15:06:32 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*RaftServer).raftEventHandler:448) (raft:d41518a27d24777) Selected as leader. Starting leader loop.
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:128) Recovering from log...
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/cluster.NewWriteBuffer:30) local: Initializing write buffer with buffer size of 10000
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/cluster.(*ClusterConfiguration).RecoverFromWAL:1203) Waiting for servers to recover
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*ProtobufServer).ListenAndServe:66) ProtobufServer listening on 0.0.0.0:8099
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/cluster.func·005:1185) Recovering local server
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:133) recovered
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/coordinator.(*Coordinator).ConnectToProtobufServers:898) Connecting to other nodes in the cluster
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:139) Starting admin interface on port 8083
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:156) Graphite input plugins is disabled
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:178) Collectd input plugins is disabled
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:187) UDP server is disabled
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:187) UDP server is disabled
[2015/07/22 15:06:36 UTC] [INFO] (github.com/influxdb/influxdb/server.(*Server).ListenAndServe:216) Starting Http Api server on port 8086
Edit2:似乎服务运行了一秒钟,然后关闭:
-bash-4.1$ sudo service influxdb status
Setting ulimit -n 65536
influxdb Process is running [ OK ]
-bash-4.1$ sudo service influxdb status
Setting ulimit -n 65536
influxdb Process is not running [ FAILED ]
mysql - 如何存储历史时间序列数据
我们正在存储来自多个测量设备的一堆时间序列数据。所有设备都可以提供不同的维度(能量、温度等)
目前我们正在使用 MySQL 以 idDevice、DateTime、val1、val2、val3 格式将所有这些数据存储在不同的表中(根据维度)
每次插入新数据时,我们还会从 min -> Hour -> Day -> Month -> Year 聚合这些数据
这运行得很好,但是随着我们的增长,我们的磁盘空间已经用完了,总的来说,我怀疑 RDBMS 是否是保存存档数据的正确答案。
所以我们正在考虑在 Amazon S3 上移动旧/冷数据,并编写一些可以接收这些数据的奇特 getter。
所以我的问题来了:什么是支持以下需求的好数据格式:
数据必须是可扩展的:一旦设备将提供更多数据,然后在过去 -> 行数可以增长/增加
必须更新数据。当客户提供历史数据时,我们需要能够更新过去的数据。
我们正在使用 PHP -> 有连接器/类会很好:)
我看过 HDF5,但似乎没有 PHP 库。我们也愿意看看基于云的时间序列数据库。
先感谢您!乙
influxdb - 如何在 influxdb 选择查询中格式化时间
我是 InfluxDB 的新手。我正在管理 ui 中查询数据。我将时间视为时间戳。是否可以看到它被格式化为日期和时间?
rrdtool - 如何将rrd文件存储到influxdb
我ganglia
用于监控。ganglia
将其数据存储为rrd
文件。
它是rrd
存储度量数据的文件gmetad
。通常默认路径是/var/lib/ganglia/rrds/<cluster-name>/<node-name>/
每个指标存储在单个rrd
文件中的位置,例如bytes_in.rrd
.
有什么方法可以使用这些rrd
数据influxdb
吗?
influxdb - 查询给定列表中的标签值
influxdb 中是否有任何简写语法来查询列表中的成员资格?我在想一些类似的事情
OR
现在我可以使用ed将它们串在一起=
,但这似乎非常低效。有更好的方法吗?我查看了语言规范,我认为这在表达式制作中是不可能的。
我在想的另一个选择是使用正则表达式方法,但这对我来说似乎是一种更糟糕的方法。
influxdb - influxdb 中的临时表
有没有办法在 influxdb 中为特定查询创建临时表?(这样他们的范围就是那个查询,而不是创建和插入一个新的测量)。
我考虑过编写一个连续查询,但是 where 子句(即时间)有限制,CQ 不允许并且我需要。无论如何,CQ 的语义并不是我真正想要的。
我的用例:我主要处理历史时间序列数据。我有一个昂贵的查询来检索特定时间段内一组股票代码的值。我想将这些用作中间结果,然后计算不同时间粒度(每天/每周等)的聚合。
python - 如何使用时间字段将指标数据添加到流入数据库?
我正在使用以下代码行在 influxDB 中添加指标数据。
当我将它与 Grafana 集成时,数据没有出现,但是当我在127.0.0.1:8083上检查它时,它显示时间是1970-01-01T00:00:00Z。可能,它需要开始时间为默认。我想采用"2015-8-19T07:15:00Z"形式的时间。如何在 influxdb(python 客户端)中获取时间字段以及 timePrecision 是什么?
python - 将 JSON 文件导入 InfluxDB
我想使用 Python 将 JSON 导入 InfluxDB。我编写了将数据写入 JSON 的代码
使用 open('outfile.json', 'a') 作为输出文件: json.dump(data, outfile,indent=4, sort_keys=True)
然后,当我将此 JSON 作为db.write_points(json_data)导入到 InfluxDB 时,它会引发如下错误:
raise ValueError("没有 JSON 对象可以被解码")
ValueError:无法解码任何 JSON 对象
我的 JSON 缩进有问题吗?
如果是,那我该如何解决?
JSON 的大小相当大(超过 20mB)
influxdb - 在 fluentd 和 influxdb 之间丢失数据
我正在努力解决 fluentd 和 influxdb 之间的数据丢失问题。
将 fluent-plugin-influxdb 插件与此配置一起使用:
在比较文件输出和 influxdb 中的数据时,我发现:
日志中有 2355 行,但数据库中只有 582 条记录。
我已经启用了来自 influxdb 和 fluentd 的调试/跟踪日志记录,但到目前为止日志中没有什么有趣的。
有任何想法吗?