码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2019-08-03 14:45:34      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:too   dex   下载   查看   ansi   解决   功能   poi   监控系统   

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

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

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

 

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


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

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

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

InfluxDB的Cluster功能收费,单机功能免费使用。

1、安装
可以直接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 源安装

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

2、配置
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.

3、启动 InfluxDB
# service influxdb start

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

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

4、基本用法

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

新旧版本要注意的事项:
1、是否启用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

2、默认管理账号
0.8及以前版本安装完后,是有一个账号为root、密码为root的管理账号。可作为一个默认管理权限的账号。
0.9版本及以后版本是没有默认账号的,都要自己创建。

3、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.

还有其它很多不同的地方,慢慢更新吧

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

标签:too   dex   下载   查看   ansi   解决   功能   poi   监控系统   

原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/11277345.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!