1 介绍
InfluxDB 是一个开源分布式时序、事件和指标数据库。使用Go语言编写,无需外部依赖。其设计目标是实现分布式和水平伸缩扩展。
2 下载
[root@pa-dev-47 opt]# wget https://dl.influxdata.com/influxdb/releases/influxdb-0.13.0.x86_64.rpm
3 安装
[root@pa-dev-47 opt]# rpm -ivh influxdb-0.13.0.x86_64.rpm4 检查安装是否成功
[root@pa-dev-47 opt]# service influxdb start
Starting the process influxdb [ OK ]
influxdb process was started [ OK ]
[root@pa-dev-47 opt]# service influxdb status
influxdb Process is running [ OK ][root@pa-dev-47 opt]# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.13.0
InfluxDB shell version: 0.13.0
>
5 创建数据库并检查数据库创建是否成功
> create database mydb
> show databases
name: databases
---------------
name
_internal
mydb
6 插入并查询数据
注:InfluxDB中有如下几个名词,
database,即数据库
measurement,类似于传统数据库中的表
points,类似于表里面的一行数据;points由时间戳(time)、数据(filed)、标签(tags)组成。
> use mydb
Using database mydb
> INSERT cpu,host=serverA,region=us_west value=0.64
> SELECT host, region, value FROM cpu
name: cpu
---------
time host region value
1472825493018479422 serverA us_west 0.647 Web UI
450

被折叠的 条评论
为什么被折叠?



