博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
InfluxDB系列之一安装及简单运维(未完成,需要继续写)
阅读量:6909 次
发布时间:2019-06-27

本文共 2962 字,大约阅读时间需要 9 分钟。

 是一个开源分布式时序、事件和指标数据库。使用 Go 语言编写,无需外部依赖。其设计目标是实现分布式和水平伸缩扩展。

它有三大特性:

1. Time Series (时间序列):你可以使用与时间有关的相关函数(如最大,最小,求和等)

2. Metrics(度量):你可以实时对大量数据进行计算
3. Eevents(事件):它支持任意的事件数据

特点

  • schemaless(无结构),可以是任意数量的列
  • Scalable
  • min, max, sum, count, mean, median 一系列函数,方便统计
  • Native HTTP API, 内置http支持,使用http读写
  • Powerful Query Language 类似sql
  • Built-in Explorer 自带管理工具

一、安装

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.1.1.x86_64.rpmsudo yum localinstall influxdb-1.1.1.x86_64.rpm

二、简单操作

一、CRUD [root@OEL6-38 influxdb]# lsinflux  influxd  init.sh  versions[root@OEL6-38 influxdb]# /opt/influxdb/influxConnected to http://localhost:8086 version 0.9.3InfluxDB shell 0.9.3> helpUsage:        connect 
connect to another node auth prompt for username and password pretty toggle pretty print use
set current databases format
set the output format: json, csv, or column settings output the current settings for the shell exit quit 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 tag values show tag value information a full list of influxql commands can be found at: https://influxdb.com/docs/v0.9/query_language/spec.html

> show databases;

name: databases
---------------
name
db
yy
testDB

> use yy

Using database yy

> INSERT cpu_load_short,host=server01,region=us-west value=0.64,value2=0.86 1434055562000000000

> INSERT cpu_load_short,host=server02,region=us-west value=0.64,value2=0.86 1434055562000000000
> INSERT cpu_load_short,host=server02,region=us-west value3=0.84,value4=0.96 1434055562000008888

> SHOW MEASUREMENTS      #显示所有表

name: measurements

------------------
name
cpu_load_short

> SHOW FIELD KEYS

name: cpu_load_short
--------------------
fieldKey
value
value2
value3
value4

> SHOW series from cpu_load_short

name: cpu_load_short
--------------------
_key host region
cpu_load_short,host=server01,region=us-west server01 us-west
cpu_load_short,host=server02,region=us-west server02 us-west

> SHOW TAG KEYS FROM cpu_load_short

name: cpu_load_short
--------------------
tagKey
host
region

> SHOW TAG VALUES FROM cpu_load_short with key = "host"

name: hostTagValues
-------------------
host
server01
server02

> SHOW TAG VALUES FROM cpu_load_short WITH KEY IN ("region", "host")

name: hostTagValues
-------------------
host
server01
server02

name: regionTagValues

---------------------
region
us-west

二、查询数据

> SELECT * FROM /.*/ LIMIT 1

name: cpu_load_short
--------------------
time host region value value2 value3 value4
2015-06-11T20:46:02Z server01 us-west 0.64 0.86

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

参考链接:

https://www.influxdata.com/downloads/

http://www.cnblogs.com/liujianzuo888/articles/6017943.html

 

你可能感兴趣的文章
iOS NSMutableDictionary中UIImage的存储和读取
查看>>
二叉堆
查看>>
使用cssQuery选择器语法来查找元素
查看>>
Linux IPC实践(7) --Posix消息队列
查看>>
使用python创建cocos2d-x项目
查看>>
上网管理 一些主流的视频网站
查看>>
python -- 字符串和编码
查看>>
Java中的Enum的继承
查看>>
[Android]RecyclerView的简单演示样例
查看>>
怎样在Java中运行Hive命令或HiveQL
查看>>
使用enca进行字符集转码
查看>>
Ubuntu下安装Oracle JRE运行环境
查看>>
Go语言标准包之用io包模拟curl
查看>>
Bootstrap输入框组
查看>>
Linux下使用tcpdump进行抓包(转)
查看>>
docker 标记和推送镜像
查看>>
在弱网传输的情况下,是怎么做到节约流量的(面试小问题,Android篇)
查看>>
【转】Spring Boot特性
查看>>
Linux用户管理之使用/bin/false和/usr/sbin/nologin拒绝用户登录及其功能分析(转)...
查看>>
位置与地图(三)给地图加入覆盖层
查看>>