[转帖]InfluxDB 1.2.0安装及新旧版本的注意事项

InfluxDB 1.2.0安装及新旧版本的注意事项

http://haibing.org/245?zwlqby=npztq3

挺好的文章 很好的解决了  上一个文档里面 关于 web admin 的问题

 

更多好文章见做者电子书集《Linux运维入门指南:生产运维须要掌握的技能》php


随着大数据的爆发,系统数量也是直线上升,监控系统,收集系统运行状态成了保障业务正常运行中的重要一个环节。web

针对这种产生频率快、带时间标签、测点多、信息量大的数据,时序数据库(Time Series Database,简称TSDB)应运而生。而其中InfluxDB是比较应用普遍的其中一个。数据库

InfluxDB是用Go语言写的,专为时间序列数据持久化所开发的,因为使用Go语言,因此各平台基本都支持。相似的时间序列数据库还有OpenTSDB,Prometheus等。
转载本站文章请注明出处:黄海兵haibing.orgvim

InfluxDB的Cluster功能收费,单机功能无偿使用。less

一、安装
能够直接rpm安装
到http://repos.influxdata.com下载相应的版本运维

1
2
#wget https: //repos.influxdata.com/rhel/6Server/x86_64/stable/influxdb-1.2.0.x86_64.rpm
#rpm -ivh influxdb-1.2.0.x86_64.rpm

或者
添加yum 源安装ide

1
2
3
4
5
6
7
8
#cat << EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \ $releasever
baseurl = https: //repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https: //repos.influxdata.com/influxdb.key
EOF
1
2
3
4
5
6
7
8
# cat influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL $releasever
baseurl = https: //repos.influxdata.com/rhel/$releasever/$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https: //repos.influxdata.com/influxdb.key
#yum install influxdb -y

二、配置
InfluxDB 1.1开始WEB管理默认是禁用的,因此装完并无启用8083端口了,须要到配置文件里启用。
转载本站文章请注明出处:黄海兵haibing.org大数据

1
2
3
vim /etc/influxdb/influxdb.conf
[admin]
enabled = true ​​​​

InfluxDB 1.3以及以后的版本已经取消在InfluxDB中启用web管理了,取而代之的是使用Chronograf。
官方说明:
In version 1.3, the web admin interface is no longer available in InfluxDB. The interface does not run on port 8083 and InfluxDB ignores the [admin] section in the configuration file if that section is present. Chronograf replaces the web admin interface with improved tooling for querying data, writing data, and database management. See Chronograf’s transition guide for more information.ui

三、启动 InfluxDB
# service influxdb starturl

启动后打开 web 管理界面 http://本机IP:8083/

InfluxDB 的 Web 管理界面端口是 8083,HTTP API 监听端口是 8086,若是须要更改这些默认设定,修改 InfluxDB 的配置文件 /etc/influxdb/influxdb.conf 后重启 InfluxDB 就能够了

四、基本用法

1
2
3
4
5
6
7
#influx
>help    #查看基本用法
>show databases
name: databases
name
----
_internal

新旧版本要注意的事项:
一、是否启用web管理
1.1版本开始是默认没有启用web管理的,因此新版装完以后,启动服务,8083端口是没有的。要么经过命令直接管理,要么经过API管理。
不过仍是能够手动开起来的。

1
2
3
vim /etc/influxdb/influxdb.conf
[admin]
enabled = true ​​​​

官网说明
The built-in web administration GUI is deprecated in InfluxDB 1.1 and is disabled by default. We recommend using the HTTP API or the Command Line Interface to interact with InfluxDB.
InfluxDB 1.3以及以后的版本已经取消在InfluxDB中启用web管理了,取而代之的是使用Chronograf。
转载本站文章请注明出处:黄海兵haibing.org

二、默认管理帐号
0.8及之前版本安装完后,是有一个帐号为root、密码为root的管理帐号。可做为一个默认管理权限的帐号。
0.9版本及之后版本是没有默认帐号的,都要本身建立。

三、HTTP API接口的不一样
0.9开始跟之前的版本彻底不同,因此若是是从老版本升级到0.9或者更高版本,要注意了,接口文件要彻底从新写过。
0.8之前是相似这样的请求:
http://localhost:8086/db/mydb/
而新版的是这样的:
http://localhost:8086/query?db=test&pretty=true
新版基本上都是用/query来执行,而旧版是没有的。
网上不少都是旧版代码,若是用来查询新版的,是得不到数据的。
转载本站文章请注明出处:黄海兵haibing.org

这是官网的一段说明,说明0.8跟0.9版本的不一样
InfluxDB 0.8 has multiple endpoints for the API, often encoding concepts such as the database and shard space in the HTTP endpoint. InfluxDB 0.9 simplifies the common API interactions, using a common endpoint /query for all queries, and /write for all writes, regardless of database or retention policy. The database and retention policy are passed as query string parameters in InfluxDB 0.9. This makes the API easier to incorporate into libraries and other code, as it does not require any knowledge of the data structure to make valid calls to the API endpoints.

还有其它不少不一样的地方,慢慢更新吧

相关文章
相关标签/搜索