概述
安装influxDB时需要root用户或者管理员权限。

端口
默认情况下,InfluxDB会使用如下的端口:
* TCP8086端口是服务器监听端口,对HTTP API响应
* TCP8088端口是RPC服务端口,用于数据备份和保存
更多的端口使用细节和配置方式可以在配置文件/etc/influxdb/influxdb.conf进行了解和设置。

网络时间协议(Network Time Protocol, NTP)
InfluxDB使用主机的本地UTC时间来分配时间戳,并用于协调。InfluxDB使用NTP协议来同步不同主机之间的时间,如果不同主机的时钟没有同步,那么写入数据库中的数据的时间戳有可能是不准确的。

安装
安装包地址InfluxDB download,安装

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.5.3.x86_64.rpm
sudo yum localinstall influxdb-1.5.3.x86_64.rpm

sudo service influxdb start

systemctl start influxdb

influx

CREATE DATABASE "Tw.InfluxDB"

CREATE USER littlewrong WITH PASSWORD 'littlewrong' WITH ALL PRIVILEGES

exit

修改influxdb.conf配置文件:

[http]

  bind-address= ":8086"

  auth-enable=true

启动

sudo service influxdb start

systemctl start influxdb

常用:

> select * from test_table (查询语句,类似sql语句)
>select * from test_table where cpu = 22 ( where用法,类似sql)
>select * from test_table where host = 'web1' (同上)
>select * from test_table order by time [desc] (按时间排序,默认为顺序,加上desc为倒序)

>show users (查看用户)
>create user "username" with password 'password' (创建普通用户)
>create user "username" with password 'password' with all privileges (创建管理员用户)
>drop user "username" (删除用户)
>auth (用户认证,用于设置了密码后,登陆influxdb的认证)
username: username
password: password

重启:
/usr/bin/influxd -config /etc/influxdb/influxdb.conf
service influxdb restart
systemctl start influxdb
systemctl stop influxdb
systemctl restart influxdb
管理员用户管理:

创建一个新的管理员用户
CREATE USER <username> WITH PASSWORD '<password>' WITH ALL PRIVILEGES

CREATE USER littlewrong WITH PASSWORD 'littlewrong' WITH ALL PRIVILEGES

为一个已有用户授权管理员权限
GRANT ALL PRIVILEGES TO <username>

取消用户权限
REVOKE ALL PRIVILEGES FROM <username>

展示用户及其权限
SHOW USERS

基础语句

create database “db_name” 创建数据库
drop database “db_name” 删除数据库
show databases; 查询几个数据库
use database_name; 使用数据库
show measurements; 显示该数据库中的表
创建表,直接在插入数据的时候指定表名(weather就是表名)
insert weather,altitude=1000,area=北 temperature=11,humidity=-4
drop measurement “measurement_name” 删除表
建立保留策略(retention policy)
create retention policy rp_collectd on collectd duration 1w replication 1 default
duration: 1h, 90m, 12h, 7d, 4w, INF 最小1h, 最大INF
通过http添加数据
curl -i -XPOST ‘http://localhost:8086/write?db=testDB’ –data-binary ‘weather,altitude=1000,area=北 temperature=11,humidity=-4’

用户管理

show users ; 显示用户

相关配置文件

/etc/influxdb/influxdb.conf 默认的配置文件
/var/log/influxdb/influxd.log 日志文件
/var/lib/influxdb/data 数据文件
/usr/lib/influxdb/scripts 初始化脚本文件夹
/usr/bin/influx 启动数据库

从InfluxDB看时序数据的处理

以时间维度数据分析
###### 时序数据库的关键特性
以时间维度的高效查询
方便的down sampling (采样)
自动高效的处理过期时间
###### 使用场景
监控
lot
measurement
tag/tagset(被索引)
series
field
timestamp
continuous queries
retention policy

influxdb案例
grafana 的安装使用

rpm -ivh grafana-3.1.1-1470047149.x86_64.rpm
sudo /sbin/chkconfig –add grafana-server 添加到启动项
sudo service grafana-server start 启动 grafana
/etc/grafana 启动的命令
/usr/share/grafana
访问http://youIp:3333 or 3000

Package details

Installs binary to /usr/sbin/grafana-server
Copies init.d script to /etc/init.d/grafana-server
Installs default file (environment vars) to /etc/sysconfig/grafana-server
Copies configuration file to /etc/grafana/grafana.ini
Installs systemd service (if systemd is available) name grafana-server.service
The default configuration uses a log file at /var/log/grafana/grafana.log
The default configuration specifies an sqlite3 database at /var/lib/grafana/grafana.db

 grafana 的插件

Grafana plugin directory
/var/lib/grafana/plugins
Grafana-cli commands
展示所有可用的插件
grafana-cli plugins list-remote
Install a plugin type
grafana-cli plugins install
List installed plugins
grafana-cli plugins ls
Update all installed plugins
grafana-cli plugins update-all
Update one plugin
grafana-cli plugins update
Remove one plugin
grafana-cli plugins remove

相关的分析

Telegraf
Time-Series Data Collector
InfluxDB
Time-Series Data Storage
Chronograf
Time-Series Data Visualization
Kapacitor
Time-Series Data Processing

Centos系统安装InfluxDB的更多相关文章

  1. Centos系统安装

    Centos系统安装 安装系统前的注意事项 1) 硬件CPU必须支持虚拟化技术,在支持虚拟化的前提下我们还要去把虚拟 的功能打开否则在安装的时候会报错,开启虚拟化需要在BIOS中开启 2)创建虚拟机的 ...

  2. 布衣之路(一):VMware虚拟机+CentOS系统安装

    前言:布衣博主乃苦逼的Java程序猿一枚,虽然工作中不会涉及系统运维,但是开发的项目总还是要部署到服务器做一些负载均衡.系统兼容性测试.系统集成等等骚操作,而这些测试性的操作不可能直接SSH远程运维的 ...

  3. Linux centos系统安装后的基本配置,Linux命令

    一.centos系统安装后的基本配置 .常用软件安装 yum install -y bash-completion vim lrzsz wget expect net-tools nc nmap tr ...

  4. VMware与Centos系统安装

    Linux介绍 1. Linux Linux和windows一样都是操作系统,Linux是开源的.免费的.自由传播的类Unix操作系统软件. 是一个基于POSIX和UNIX的多用户.多任务.支持多线程 ...

  5. VMware与Centos系统安装、重置root密码

    VMware与Centos系统安装   今日任务 .Linux发行版的选择 .vmware创建一个虚拟机(centos) .安装配置centos7 .xshell配置连接虚拟机(centos) 选择性 ...

  6. VMware与Centos系统安装 和重置root密码

    VMware与Centos系统安装   今日任务 1.Linux发行版的选择 2.vmware创建一个虚拟机(centos) 3.安装配置centos7 4.xshell配置连接虚拟机(centos) ...

  7. Docker01 centos系统安装、centos安装docker、docker安装mongoDB

    1 centos系统安装 本博文是基于 centos6.5 的,利用VMware 虚拟机搭建 centos6.5 系统 1.1 centos6.5资源获取 1.2 安装 1.2.1 新建虚拟机 1.2 ...

  8. Linux 及 CentOS系统安装

    VMware与Centos系统安装   今日任务 .Linux发行版的选择 .vmware创建一个虚拟机(centos) .安装配置centos7 .xshell配置连接虚拟机(centos) 选择性 ...

  9. 运维01 VMware与Centos系统安装

    VMware与Centos系统安装   今日任务 1.Linux发行版的选择 2.vmware创建一个虚拟机(centos) 3.安装配置centos7 4.xshell配置连接虚拟机(centos) ...

随机推荐

  1. Spring MVC 之 ContentNegotiatingViewResolver

    我们已经知道 对于 RequestMappingInfoHandlerMapping, 它在对带有后缀的http 请求进行匹配的时候,如果找不到精确的pattern, 那么就会 pattern+.* ...

  2. 31_NavLink组件包装优化

    简单理解为自定义一个组件并自带样式 import React, {Component} from 'react' import {Switch, Route, Redirect} from 'reac ...

  3. Fragment的粗浅理解

    Fragment: 1.它是对于Activity界面实现的一种途径,相对于已经绑定的Layout,他更轻便,更灵活,更具有自由度和可设计性. 2.Fragment的功能正如他的正文意思所言,他是一个片 ...

  4. 远程桌面 把explorer关掉了

    用Ctrl+Alt+End调出远程桌面的任务管理器.然后,运行explorer.exe即可重启该服务.

  5. spring cloud 总结

    Finchley版本Spring Cloud Finchley; Spring Boot 2.0.3 史上最简单的 SpringCloud 教程 | 第一篇: 服务的注册与发现(Eureka)(Fin ...

  6. Django REST framework的分页

    DRF分页组件 为什么要使用分页 我们数据表中可能会有成千上万条数据,当我们访问某张表的所有数据时,我们不太可能需要一次把所有的数据都展示出来,因为数据量很大,对服务端的内存压力比较大还有就是网络传输 ...

  7. IPV4/IPV6双协议栈配置案例

    拓扑: XRV1配置: =================================================================== hostname XRV1! ipv6 ...

  8. The Moon and Sixpence摘抄

    I had not yet learnt how contradictory is human nature; I did not know how much pose there is in the ...

  9. 3.Redis高级功能

    3.Redis高级功能3.1 慢查询分析3.1.1 慢查询的两个配置参数3.1.2 最佳实践3.1.3 单线程架构3.2 Redis Shell3.2.1 redis-cli 详解3.2.2 redi ...

  10. MySQL终章

    视图 什么是视图 是一个虚拟表,其内容由查询定义.同真实的表一样,视图包含一系列带有名称的列和行数据 视图的特点 . 视图的列可以来自不同的表,是表的抽象和逻辑意义上建立的新关系. . 视图是由基本表 ...