时序数据库influxDB存储数据grafana展示数据
一、influxDB简介
InfluxDB是一款用Go语言编写的开源分布式时序、事件和指标数据库,无需外部依赖。该数据库现在主要用于存储涉及大量的时间戳数据,如DevOps监控数据,APP metrics, loT传感器数据和实时分析数据。
二、安装
(py3) [root@zabbix_server src]# wget https://dl.influxdata.com/influxdb/releases/influxdb-1.1.0.x86_64.rpm
---- ::-- https://dl.influxdata.com/influxdb/releases/influxdb-1.1.0.x86_64.rpm
正在解析主机 dl.influxdata.com... 13.226.77.23, 13.226.77.76, 13.226.77.125, ...
正在连接 dl.influxdata.com|13.226.77.23|:... 已连接。
已发出 HTTP 请求,正在等待回应... OK
长度: (15M) [application/x-redhat-package-manager]
正在保存至: “influxdb-1.1..x86_64.rpm” % [=============================> ] ,, 1.77M/s eta(英国中部时42% [================================> ] ,, 1.80M/s eta(英国中部时51% [=======================================> ] ,, 2.01M/s eta(英国中部时57% [============================================> ] ,, 2.00M/s eta(英国中部时60% [===============================================> ] ,, 2.10M/s eta(英国中部时63% [=================================================> ] ,, 2.18M/s eta(英国中部时71% [=======================================================> ] ,, 2.58M/s eta(英国中部时74% [=========================================================> ] ,, 2.62M/s eta(英国中部时77% [============================================================> ] ,, 2.71M/s eta(英国中部时83% [================================================================> ] ,, 2.71M/s eta(英国中部时86% [===================================================================> ] ,, 2.81M/s eta(英国中部时90% [======================================================================> ] ,, 2.75M/s eta(英国中部时94% [=========================================================================> ] ,, 2.63M/s eta(英国中部时100%[==============================================================================>] ,, 2.77M/s in .7s -- :: (2.18 MB/s) - 已保存 “influxdb-1.1..x86_64.rpm” [/]) (py3) [root@zabbix_server src]# yum localinstall influxdb-1.1..x86_64.rpm
已加载插件:fastestmirror, security
设置本地安装进程
诊断 influxdb-1.1..x86_64.rpm: influxdb-1.1.-.x86_64
influxdb-1.1..x86_64.rpm 将被安装
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
base | 3.7 kB :
dell-system-update_dependent | 2.3 kB :
dell-system-update_independent | 2.3 kB :
extras | 3.4 kB :
mysql-connectors-community | 2.5 kB :
mysql-tools-community | 2.5 kB :
mysql57-community | 2.5 kB :
nginx | 2.9 kB :
updates | 3.4 kB :
webtatic | 3.6 kB :
解决依赖关系
--> 执行事务检查
---> Package influxdb.x86_64 :1.1.- will be 安装
--> 完成依赖关系计算 依赖关系解决 ========================================================================================================================
软件包 架构 版本 仓库 大小
========================================================================================================================
正在安装:
influxdb x86_64 1.1.- /influxdb-1.1..x86_64 M 事务概要
========================================================================================================================
Install Package(s) 总文件大小: M
Installed size: M
确定吗?[y/N]:y
下载软件包:
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : influxdb-1.1.-.x86_64 /
Verifying : influxdb-1.1.-.x86_64 / 已安装:
influxdb.x86_64 :1.1.- 完毕!
三、文件说明
在/usr/bin目录下有如下文件
(py3) [root@zabbix_server bin]# ll inf*
-rwxr-xr-x root root 11月 influx
-rwxr-xr-x root root 11月 influxd
-rwxr-xr-x root root 11月 influx_inspect
-rwxr-xr-x root root 11月 influx_stress
-rwxr-xr-x root root 11月 influx_tsm
-rwxr-xr-x. root root 8月 info
-rwxr-xr-x. root root 3月 infocmp
-rwxr-xr-x. root root 8月 infokey
lrwxrwxrwx. root root 11月 infotocap -> tic
influxd:服务器 influx:客户端 数据文件存放在 /var/lib/influxdb/目录下
四、数据库操作
启动服务器
(py3) [root@zabbix_server influxdb]# influxd
.d888 8888888b. 888888b.
d88P" 888 888 "Y88b "88b
.88P
88888b. 8888888K.
"88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
X88K
Y88b .d8""8b. .d88P d88P
"Y88888 888 888 8888888P" 8888888P"
[run] // :: InfluxDB starting, version 1.1., branch master, commit 800da5732b91c816b0a097acf8887fa2af1efa1a
[run] // :: Go version go1.7.3, GOMAXPROCS set to
[run] // :: Using configuration at: /etc/influxdb/influxdb.conf
[store] // :: Using data dir: /var/lib/influxdb/data
[subscriber] // :: opened service
[monitor] // :: Starting monitor system
[monitor] // :: 'build' registered for diagnostics monitoring
[monitor] // :: 'runtime' registered for diagnostics monitoring
[monitor] // :: 'network' registered for diagnostics monitoring
[monitor] // :: 'system' registered for diagnostics monitoring
[shard-precreation] // :: Starting precreation service with check interval of 10m0s, advance period of 30m0s
[snapshot] // :: Starting snapshot service
[continuous_querier] // :: Starting continuous query service
[httpd] // :: Starting HTTP service
[httpd] // :: Authentication enabled: false
[httpd] // :: Listening on HTTP: [::]:
[retention] // :: Starting retention policy enforcement service with check interval of 30m0s
[monitor] // :: Storing statistics in database '_internal' retention policy 'monitor', at interval 10s
// :: Sending usage statistics to usage.influxdata.com
[run] // :: Listening for signals
启动客户端
(py3) [root@zabbix_server dianwang]# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 1.1.0
InfluxDB shell version: 1.1.
>
创建数据库
> create database test;
> show databases;
name: databases
name
----
_internal
test
打开数据库
> use test
Using database test
>
创建表,InfluxDB没有提供单独的建表语句,可以通过并添加数据的方式建表
> insert test,province=安徽 count=
> show measurements
name: measurements
name
----
test > select * from test
name: test
time count province
---- ----- --------
安徽
添加数据
> insert test,province=广东 count=
> select * From test
name: test
time count province
---- ----- --------
安徽
广东
删除表
> drop measurement test
> show measurements
>
五、grafana添加influxdb数据源

添加表格插件,设置如下:

选择展示字段:count,按province分组,按时间排序

这样就完成了数据的展示。
六、安装grafana的worldsmap插件
[root@zabbix_server bin]# ./grafana-cli plugins install grafana-worldmap-panel
installing grafana-worldmap-panel @ 0.2.
from url: https://grafana.com/api/plugins/grafana-worldmap-panel/versions/0.2.1/download
into: ../data/plugins ? Installed grafana-worldmap-panel successfully Restart grafana after installing plugins . <service grafana-server restart>
七、重启grafana服务
root@zabbix_server bin]# ./grafana-server start
查看面板

地图插件已经安装上了
八、创建地图数据表(坐标模式)
时序数据库influxDB存储数据grafana展示数据的更多相关文章
- SQLite数据库如何存储和读取二进制数据
SQLite数据库如何存储和读取二进制数据 1. 存储二进制数据 SQLite提供的绑定二进制参数接口函数为: int sqlite3_bind_blob(sqlite3_stmt*, int, co ...
- Spring Boot中使用时序数据库InfluxDB
除了最常用的关系数据库和缓存之外,之前我们已经介绍了在Spring Boot中如何配置和使用MongoDB.LDAP这些存储的案例.接下来,我们继续介绍另一种特殊的数据库:时序数据库InfluxDB在 ...
- 时序数据库InfluxDB安装及使用
时序数据库InfluxDB安装及使用 1 安装配置 安装 wget https://dl.influxdata.com/influxdb/releases/influxdb-1.3.1.x86_64. ...
- 时序数据库InfluxDB
在系统服务部署过后,线上运行服务的稳定性是系统好坏的重要体现,监控系统状态至关重要,经过调研了解,时序数据库influxDB在此方面表现优异. influxDB介绍 时间序列数据是以时间字段为每行数据 ...
- 时序数据库InfluxDB(I)- 搭建与采集信息demo操作
搭建环境:vmware workstation pro15.5.0, ubuntu18.04.3 实践时间:2019.10.12-10.27 (一)时序数据库InfluxDB准备 (1)安装 曾出现问 ...
- [Go] 时序数据库influxdb的安装
日志类的数据时候存储在时序数据库中,下面就是时序数据库influxdb的安装 curl -sL https://repos.influxdata.com/influxdb.key | apt-key ...
- 简析时序数据库 InfluxDB
时序数据基础 时序数据特点 时序数据TimeSeries是一连串随时间推移而发生变化的相关事件. 以下图的 CPU 监控数据为例,同个 IP 的相关监控数据组成了一条时序数据,不相关数据则分布在不同的 ...
- 分布式时序数据库InfluxDB
我们内部的监控系统用到分布式时序数据库InfluxDB http://www.ttlsa.com/monitor-safe/monitor/distributed-time-series-databa ...
- 【时序数据库InfluxDB】Windows环境下配置InfluxDB+数据可视化,以及使用 C#进行简单操作的代码实例
前言:如题.直接上手撸,附带各种截图,就不做介绍了. 1.influxDB的官网下载地址 https://portal.influxdata.com/downloads/ 打开以后,如下图所示,可以 ...
随机推荐
- 七十九:flask.Restful之flask-Restful标准化返回参数示例
接上一篇的代码和数据 对于复杂结构的数据如果只是定义单一结构的话返回的数据就没意义了,此时定义的数据结构需精确到所有数据的每一个字段有时候要返回的数据结构中,会有比较复杂的数据结构,证实后可以使用一些 ...
- 使用 QQ 邮箱发送邮件报错:java.net.SocketTimeoutException: Read timed out. Failed messages: javax.mail.MessagingException: Exception reading response
使用 QQ 邮箱发送邮件报错:java.net.SocketTimeoutException: Read timed out. Failed messages: javax.mail.Messagin ...
- spring boot系列(一)spring boot 初识
什么是spring boot Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员 ...
- 人性化的Requests模块(响应与编码、header处理、cookie处理、重定向与历史记录、代理设置)
Requests库是第三方模块,需要额外进行安装.Requests是一个开源库 pip install requests 去GitHub下载回来,进入解压文件,运行setup.py 比urllib2实 ...
- 使用robotframework做接口测试三——保持登录状态
调用登录接口登录了,其他的接口怎么保持登录状态呢? 首先来看一看,web端或者说客户端是怎么样用cookie/token等保持登录状态的.一般来说,cookie都会在登录接口由服务端返回,而且会是在 ...
- sql 死锁查看
--每秒死锁数量 SELECT * FROM sys.dm_os_performance_counters WHERE counter_name LIKE 'Number of Deadlocksc% ...
- linux如何使用QQmail实现网络邮件报警?
环境:CentOS7 目的:考虑到实现服务的高可用性.使用电子邮件通知服务,可以快速的通知维护人员.提高服务的可靠性,而通过 smtp.qq.com 实现脚本邮件报警 一.设置并取得 smtp.qq. ...
- cisco路由的ip路由(一)
路由Corp配置Corp#sh run Building configuration... Current configuration : 1652 bytes ! version 12.4 no s ...
- Asp.NetCore应用--部署到 ubuntu 进行托管
准备过程 netcore linux发布包(本人是通过vs2017发布) ubuntu 16.0.4虚机 进行托管 ubuntu netcore发布文件路径 服务器设置为将对 http://< ...
- (5.7)mysql高可用系列——MySQL中的GTID复制(理论篇)【转】
转自:https://blog.csdn.net/wmq880204/article/details/53160078 一.GTID的概述: 1.全局事物标识:global transaction i ...