Centos系统安装InfluxDB
概述
安装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的更多相关文章
- Centos系统安装
Centos系统安装 安装系统前的注意事项 1) 硬件CPU必须支持虚拟化技术,在支持虚拟化的前提下我们还要去把虚拟 的功能打开否则在安装的时候会报错,开启虚拟化需要在BIOS中开启 2)创建虚拟机的 ...
- 布衣之路(一):VMware虚拟机+CentOS系统安装
前言:布衣博主乃苦逼的Java程序猿一枚,虽然工作中不会涉及系统运维,但是开发的项目总还是要部署到服务器做一些负载均衡.系统兼容性测试.系统集成等等骚操作,而这些测试性的操作不可能直接SSH远程运维的 ...
- Linux centos系统安装后的基本配置,Linux命令
一.centos系统安装后的基本配置 .常用软件安装 yum install -y bash-completion vim lrzsz wget expect net-tools nc nmap tr ...
- VMware与Centos系统安装
Linux介绍 1. Linux Linux和windows一样都是操作系统,Linux是开源的.免费的.自由传播的类Unix操作系统软件. 是一个基于POSIX和UNIX的多用户.多任务.支持多线程 ...
- VMware与Centos系统安装、重置root密码
VMware与Centos系统安装 今日任务 .Linux发行版的选择 .vmware创建一个虚拟机(centos) .安装配置centos7 .xshell配置连接虚拟机(centos) 选择性 ...
- VMware与Centos系统安装 和重置root密码
VMware与Centos系统安装 今日任务 1.Linux发行版的选择 2.vmware创建一个虚拟机(centos) 3.安装配置centos7 4.xshell配置连接虚拟机(centos) ...
- Docker01 centos系统安装、centos安装docker、docker安装mongoDB
1 centos系统安装 本博文是基于 centos6.5 的,利用VMware 虚拟机搭建 centos6.5 系统 1.1 centos6.5资源获取 1.2 安装 1.2.1 新建虚拟机 1.2 ...
- Linux 及 CentOS系统安装
VMware与Centos系统安装 今日任务 .Linux发行版的选择 .vmware创建一个虚拟机(centos) .安装配置centos7 .xshell配置连接虚拟机(centos) 选择性 ...
- 运维01 VMware与Centos系统安装
VMware与Centos系统安装 今日任务 1.Linux发行版的选择 2.vmware创建一个虚拟机(centos) 3.安装配置centos7 4.xshell配置连接虚拟机(centos) ...
随机推荐
- 计算机系统的通信PPT版本
通信方式 并行传送:一次8位,需要保持各路信号同时到达,距离和速度受限制,成本较高 串行传送:一次1位,距离较远.速率更高,成本较低. {在单片机的通信中,使用的是串行传送,但是数据寄存器里面的是8位 ...
- springcloud-知识点总结(一):Eureka
1.Spring Cloud简介 Spring Cloud是一系列框架的有序集合.它利用Spring Boot的开发便利性巧妙地简化了分布式系统基础设施的开发,如服务发现注册.配置中心.消息总线.负载 ...
- 人人开源框架使用 renren fast
参考地址人人开源官网: https://www.renren.io/guide/ 1.介绍 1.1.项目描述 renren-fast 是一个轻量级的 Spring Boot 快速开发平台,能快速开发项 ...
- 移动端的1px边框问题
最近在做一个移动端项目,涉及到1像素问题 其实质就是移动端的css里写1px,看起来比1px粗,这就是物理像素和逻辑像素的区别.物理像素和逻辑像素之间存在一个比例关系,在Javascript中可以用w ...
- python动态模块导入
首先创建一个模块目录lib,然后在目录内创建一个模块为:aa.py 官方推荐: import importlib aa = importlib.import_module('lib.aa') c = ...
- 2018 ICPC青岛网络赛 B. Red Black Tree(倍增lca好题)
BaoBao has just found a rooted tree with n vertices and (n-1) weighted edges in his backyard. Among ...
- 大数据OLAP引擎对比
Presto:内存计算,mpp架构 PB级别数据 presto适合pb级的海量数据查询分析,不是说把pb的数据放进内存,比如一张pb表,查询count,vag这种有个特点,虽然数据很多,但是最终的 ...
- 在java项目中使用umeditor
之前有介绍了ueditor的用法,可看这篇:https://www.cnblogs.com/roy-blog/p/7250668.html umeditor是ueditor的简化版,不仅在功能,容量上 ...
- springcloud ConfigServer的工作原理
前话 根据前文得知,bootstrapContext引入了PropertySourceLocator接口供外部源加载配置,但作用是应用于子级ApplicationContext的环境变量Environ ...
- git回滚远程仓库
关于远程仓库回滚 首先,必须要明白的一件事,任何普通用户不能擅自做有关远程仓库回退的操作,如果你擅自回滚了远程仓库,会对项目团队其他人造成不可预知的影响.如果需要回退版本,先联系项目的仓库管理员,在团 ...