influxDB的安装和简单使用

单机的influxdb免费,集群的是收费的

1、安装,参考官方文档 https://portal.influxdata.com/downloads

RedHat & CentOS:

  wget https://dl.influxdata.com/influxdb/releases/influxdb-1.5.1.x86_64.rpm

  sudo yum localinstall influxdb-1.5.1.x86_64.rpm

Mac:

brew update

brew install influxdb

更新mac已经存在的influxdb到最新版本:brew upgrade influxdb

安装成功后的提示:

To have launchd start influxdb now and restart at login:
  brew services start influxdb

  brew services restart influxdb


Or, if you don't want/need a background service you can just run:
  influxd -config /usr/local/etc/influxdb.conf

2、启动:

默认是随机启动的

sudo service influxdb start

influxd -config influxdb.conf根据配置文件启动

 

3、配置:/etc/influxdb/influxdb.conf

配置说明:https://docs.influxdata.com/influxdb/v1.5/

 

4、使用:

自带客户端,命令 influx

5、python客户端:pip install influxdb

 

6、influxdb支持sql语法,一些sql语句是可以直接使用的;管理的web界面,最新版本已经废弃不能用了;

7、与传统数据库中的名词做比较

InfluxDB中的名词

传统数据库中的概念

database

数据库

measurement

数据库中的表

points

表里面的一行数据

 

8、InfluxDB中特有的概念:Point

Point由时间戳(time)、数据(field)、标签(tags)组成。

Point相当于传统数据库里的一行数据,如下表所示:

Point属性

传统数据库中的概念

time

每个数据记录时间,是数据库中的主索引(会自动生成)

fields

各种记录值(没有索引的属性)也就是记录的值:温度,   湿度

tags

各种有索引的属性:地区,海拔

参考:

1、http://dbaplus.cn/news-73-1291-1.html

2、https://www.linuxdaxue.com/influxdb-basic-operation.html

3、https://docs.influxdata.com/influxdb/v1.5/

4、https://blog.csdn.net/qq_33326449/article/details/79787081

5、http://flacro.me/influxdb/

6、http://www.cnblogs.com/MikeZhang/p/InfluxDBInstall20170206.html

 
原文地址:https://www.cnblogs.com/shengulong/p/8821219.html