一、概述
InfluxDB 是一个开源分布式时序、事件和指标数据库。使用 Go 语言编写,无需外部依赖。其设计目标是实现分布式和水平伸缩扩展。
它有三大特性:
1. Time Series (时间序列):你可以使用与时间有关的相关函数(如最大,最小,求和等)
2. Metrics(度量):你可以实时对大量数据进行计算
3. Eevents(事件):它支持任意的事件数据
特点:
schemaless(无结构),可以是任意数量的列
Scalable
min, max, sum, count, mean, median 一系列函数,方便统计
Native HTTP API, 内置http支持,使用http读写
Powerful Query Language 类似sql
Built-in Explorer 自带管理工具
二、安装及配置InfluxDB
1、配置YUM源
cat <<EOF| sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository- RHEL\$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF
2、yum安装
yum install influxdb -y
systemctl start influxdb
influx -host '127.0.0.1' -port '8086'
[root@zabbix-grafana ~]# influx -host '127.0.0.1' -port '8086'
Connected to http://127.0.0.1:8086 version 1.2.2
InfluxDB shell version: 1.2.2
> show databases;
name: databases
name
----
_internal
> create database grafana
> use grafana
> show databases;
name: databases
name
----
_internal
grafana
> create user "grafana" with password 'grafana' with all privileges
>
