zoukankan      html  css  js  c++  java
  • [Go] 时序数据库influxdb的安装

    日志类的数据时候存储在时序数据库中,下面就是时序数据库influxdb的安装

    curl -sL https://repos.influxdata.com/influxdb.key | apt-key add -
    source /etc/lsb-release
    echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | tee /etc/apt/sources.list.d/influxdb.list

    apt-get update
    apt-get install influxdb
    service influxdb start

    输入influx进入管理终端
    influx
    create database sinamail
    use sinamail
    select * from webmail_log

    这个sql语句这样理解,空格分割开,空格前面的叫tag,后面的叫field
    tag有索引 field没有索引,如果查询比较多就把要查的定义成tag
    多个tag用逗号分割 ,多个field也要逗号分割

    插入和查询,注意引号的使用,使用不对插不进去,查不出来
    insert webmail_log,ip=111.222.333.444,username=taoshihan method="/index.php",ua="ios"

    select * from webmail_log where ip='111.222.333.444'

  • 相关阅读:
    【NOIP2017】奶酪
    【NOIP2017】时间复杂度
    【NOIP2005】过河
    【洛谷习题】垃圾陷阱
    dfs序
    bzoj2441 小W的问题
    彩色迷宫
    蛋糕与蛋挞
    树上倍增
    因数个数定理
  • 原文地址:https://www.cnblogs.com/taoshihan/p/11954920.html
Copyright © 2011-2022 走看看