Influxdb基本概念及mac安装上手

influxdb 基本概念

参考:https://docs.influxdata.com/influxdb/v1.4/concepts/key_concepts

基本概念图:

mac安装influxdb

brew update
brew install influxdb
ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents

# 配置文件在/etc/influxdb/influxdb.conf ,如果没有就将/usr/local/etc/influxdb.conf 拷一个过去
配置缓存:cache-max-memory-size

#启动服务
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist

#停止服务
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist

#前台启动
influxd -config /usr/local/etc/influxdb.conf

查看influxdb运行配置
influxd config

启动客户端

influx -precision rfc3339

基本操作

参考:http://docs.influxdata.com/influxdb/v1.3/query_language/data_exploration/#the-group-by-clause

数据库操作

数据插入

查询

where 中对字符串的过滤必须用单引号,tag默认为字符串类型

select * from temperature where type='assembly'