首页  

influxdb使用简介     所属分类 influxdb 浏览量 1167
下载解压
influxdb-1.8.3_darwin_amd64.tar.gz
tar xzf influxdb-1.8.3_darwin_amd64.tar.gz

修改配置文件 etc/influxdb/influxdb.conf
# Bind address to use for the RPC service for backup and restore.
bind-address = "127.0.0.1:8088"
# Where the metadata/raft database is stored
dir = "/Users/dugang/soft/influxdb/influxdb-1.8.3-1/data/meta"
# The directory where the TSM storage engine stores TSM files.
dir = "/Users/dugang/soft/influxdb/influxdb-1.8.3-1/data/data"

# The directory where the TSM storage engine stores WAL files.
wal-dir = "/Users/dugang/soft/influxdb/influxdb-1.8.3-1/data/wal"
  
# Determines whether HTTP endpoint is enabled.
enabled = true

# Determines whether the Flux query endpoint is enabled.
flux-enabled = false

# Determines whether the Flux query logging is enabled.
flux-log-enabled = false

# The bind address used by the HTTP service.
bind-address = ":8086"
  
  
nohup ./usr/bin/influxd --config ./etc/influxdb/influxdb.conf &

打开两个端口
8088 8086 
http://localhost:8086/query
http://127.0.0.1:8086/query?q=show%20databases

命令行客户端
usr/bin/influx
show databases

help

connect $host:port    connects to another node specified by host:port
auth                  prompts for username and password
pretty                toggles pretty print for the json format
chunked               turns on chunked responses from server
chunk size $size      sets the size of the chunked responses.  Set to 0 to reset to the default chunked size
use $db_name          sets current database
format $format        specifies the format of the server responses: json, csv, or column
precision $format     specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns
consistency $level    sets write consistency level: any, one, quorum, or all
history               displays command history
settings              outputs the current settings for the shell
clear                 clears settings such as database or retention policy.  run 'clear' for help
exit/quit/ctrl+d      quits the influx shell

show databases        show database names
show series           show series information
show measurements     show measurement information
show tag keys         show tag key information
show field keys       show field key information

A full list of influxql commands can be found at:
https://docs.influxdata.com/influxdb/latest/query_language/spec/
        
        
多种操作方式
客户端命令行方式
HTTP API接口
各语言API
基于WEB管理页面操作



show databases create database mydb1 use mydb1; SHOW MEASUREMENTS insert mytable1,host=dyyx load1=4.61,load5=3.52,load15=3.47 insert 自动建表 不带时间戳 默认取 系统当前时间戳(纳秒) select * from mytable1 time host load1 load15 load5 ---- ---- ----- ------ ----- 1601624212631551000 dyyx 4.61 3.47 3.52 precision rfc3339 time host load1 load15 load5 ---- ---- ----- ------ ----- 2020-10-02T07:36:52.631551Z dyyx 4.61 3.47 3.52 insert mytable1,host=dyyx load1=3.62,load5=3.51,load15=3.46 ame: mytable1 time host load1 load15 load5 ---- ---- ----- ------ ----- 2020-10-02T07:36:52.631551Z dyyx 4.61 3.47 3.52 2020-10-02T07:39:05.198641Z dyyx 3.62 3.46 3.51 drop measurement xxx 1601624212631551000 纳秒 1601624525054 毫秒 1601624525054000000 指定时间戳 insert mytable1,host=dyyx load1=3.32,load5=3.50,load15=3.44 1601624525054000000 time host load1 load15 load5 ---- ---- ----- ------ ----- 2020-10-02T07:36:52.631551Z dyyx 4.61 3.47 3.52 2020-10-02T07:39:05.198641Z dyyx 3.62 3.46 3.51 2020-10-02T07:42:05.054Z dyyx 3.32 3.44 3.5 数据保存策略(Retention Policies) show retention policies on "mydb1" create retention policy "rp_name" on "db_name" duration 3w replication 1 default h 小时 d 天 w 星期 alter retention policy "rp_name" on "db_name" duration 30d default drop retention policy "rp_name" on "db_name" 连续查询(Continuous Queries) 自动定时启动的一组语句,语句中必须包含 SELECT 和 GROUP BY time 将查询结果放在指定的数据表中 降低采样率 统计不同精度的数据 CREATE CONTINUOUS QUERY cq1 ON mytable1 BEGIN SELECT mean(load1), MEDIAN(load1), MAX(load1), MIN(load1) INTO destxxx FROM srcxxx GROUP BY host,time(60m) END SHOW CONTINUOUS QUERIES DROP CONTINUOUS QUERY cq_name ON database_name

上一篇     下一篇
elasticsearch的几个特色功能

常用时序数据库比较

Influxdb概念及原理简介

influxdb 连续查询

influxDB HTTP API使用

Lucene6索引文件格式