1、安装influxdb
yum localinstall influxdb-0.13.0.x86_64.rpm
2、启动influxdb
service influxdb start
localhost:8083 即可进入web管理页面
3、influxdb交互命令行
influx
show databases
CREATE DATABASE "testDB"
use testDB
查询当前数据库下所有表的第一行记录
SELECT * FROM /.*/ LIMIT 1
查询当前数据库中含有的表
SHOW MEASUREMENTS
查看当前数据库所有表的字段
SHOW FIELD KEYS
删除表所有数据,则表就不存在了
delete from "query1"
mean-平均值
sum-总和
min-最小值
max-最大值
count-总个数
select * from pay order by time desc limit 2
4、安装grafana
yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.0-1468321182.x86_64.rpm
5、启动grafana
service grafana-server start
6、grafana界面
localhost:8080
curl -G 'http://127.0.0.1:8086/query?db=test' --data-urlencode "q=select * from cpu"
curl -G 'http://127.0.0.1:8086/query?q=select+*+from+cpu&db=test'
curl -i -X POST 'http://127.0.0.1:8086/write?db=test' --data-binary 'cpu,host=serverA,region=us-west value=200'
curl -i -X POST 'http://127.0.0.1:8086/write?db=test' --data-binary 'cpu1,host=serverA,region=us-west value=200 1468796611505586362'