Influxdb 安装

简介: 本文将引导您安装、配置并开始使用InfluxDB.准备安装 InfluxDB 需要 root 权限(Linux系统)或Administrator权限(Windows系统)网络默认情况下,InfluxDB开放如下端口:TCP 8086 用于 HTTP APITCP 8088 用于RPC服务(主要用于备份还原)除此以外,InfluxDB还提供了多个端口. 供一些插件使用,如Graphite、OpenTSDB、 Collectd。

本文将引导您安装、配置并开始使用InfluxDB.

准备

安装 InfluxDB 需要 root 权限(Linux系统)或Administrator权限(Windows系统)

网络

默认情况下,InfluxDB开放如下端口:

  • TCP 8086 用于 HTTP API
  • TCP 8088 用于RPC服务(主要用于备份还原)

除此以外,InfluxDB还提供了多个端口. 供一些插件使用,如GraphiteOpenTSDBCollectd
所有的端口都可以通过配置文件进行修改。配置文件的默认位置为/etc/influxdb/influxdb.conf.

网络时间协议(NTP)

InfluxDB使用本地UTC时间来为数据分配时间戳并用于协调。使用网络时间协议(NTP)在服务器之间同步时间;如果某台服务器的时钟不与NTP同步,写入InfluxDB的数据的时间戳可能不准确。

安装

对于不想安装任何软件的用户,可以选择托管的InfluxDB服务.

1、Ubuntu & Debian

添加软件源

For Ubuntu

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

For Debian

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
test $VERSION_ID = "7" && echo "deb https://repos.influxdata.com/debian wheezy stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "8" && echo "deb https://repos.influxdata.com/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "9" && echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

使用apt-get 安装并启动

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

PS: 在Ubuntu 15.04+, Debian 8+,可以使用sydtemd启动服务

sudo apt-get update && sudo apt-get install influxdb
sudo systemctl start influxdb

2、CentOS & RHEL

通过yum软件包管理器安装

添加源

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

安装并启动

sudo yum install influxdb
sudo service influxdb start

CentOS 7+, RHEL 7+使用systemd启动

sudo yum install influxdb
sudo systemctl start influxdb

配置

安装好后的系统,采用了默认的配置项,通过invluxd config查看配置情况。

img_90d8607fa251b2179ade84d2988fa174.png
influxd

我们打开/etc/influxdb/influxdb.conf,可以看到绝大部分都是被注释掉的内容,这些配置项将采用默认值(即注释掉的配置等号后的值)。当我们要自定义配置时,去掉#号注释,修改配置,重启服务即可生效。

当我们编写了另一个配置文件时,我们可以通过- config选项让它生效。

    influxd -config /etc/influxdb/influxdb.conf

或者将路径设置给环境变量 INFLUXDB_CONFIG_PATH并重启服务。

    echo $INFLUXDB_CONFIG_PATH
    /etc/influxdb/influxdb.conf


    influxd

InfluxDB 启动时, -config 选项优先,若没有此选项,再读取环境变量 INFLUXDB_CONFIG_PATH

更多内容,请参见 官方配置文档

相关文章
|
11天前
|
网络协议 API 数据库
InfluxDB集群
InfluxDB集群
29 0
|
Prometheus 监控 Cloud Native
Prometheus VS InfluxDB
前言 除了传统的监控系统如 Nagios,Zabbix,Sensu 以外,基于时间序列数据库的监控系统随着微服务的兴起越来越受欢迎,比如 Prometheus,比如 InfluxDB。gtt 也尝试了一下这两个系统,希望能找到两者的差别,为以后选型提供一些帮助。
8541 0
|
11天前
|
存储 监控 物联网
InfluxDB简介与场景
InfluxDB简介与场景
16 1
|
26天前
|
存储 监控 Java
InfluxDB时序数据库安装和使用
InfluxDB时序数据库安装和使用
44 2
|
10月前
|
存储 Prometheus 监控
Prometheus+Grafana普罗米修斯搭建+监控MySQL
​ `Prometheus` 是 `Cloud Native Computing Foundation` 的一个监控系统项目, 集采集、监控、报警等特点于一体。 ​ `Prometheus`主要受启发于`Google`的`Brogmon`监控系统, 从`2012`年开始由前`Google`工程师在`Soundcloud`以开源软件的形式进行研发,`2017`年底发布了基于全新存储层的`2.0`版本,当前最新版本是`2.44.0`版本。
928 0
|
网络安全 时序数据库
influxdb2.0版本部署+自启
influxdb2.0版本部署+自启
influxdb2.0版本部署+自启
|
Prometheus Cloud Native Docker
ClickHouse Exporter
ClickHouse Exporter
363 2
|
数据可视化 数据库 时序数据库
Garfana配置influxdb可视化
数据查看influxdb可视化界面
212 0
Garfana配置influxdb可视化
|
Kubernetes 网络协议 安全
InfluxDB Cluster - InfluxDB Enterprise 集群的开源替代方案
InfluxDB Cluster - 一个开源分布式时间序列数据库,InfluxDB Enterprise 集群的开源替代方案。完全依照 InfluxDB Enterprise 实现,基于 InfluxDB v1.8.10 开发,支持集群(数据分片)、高可用(容错)、数据一致性(Raft,Hinted Handoff)、配套工具(扩缩容、数据同步等)等特性,Telegraf、Chronograf、Kapacitor 也完全支持,生产环境已就绪
1252 0
InfluxDB Cluster - InfluxDB Enterprise 集群的开源替代方案
|
存储 监控 Kubernetes
阿里云InfluxDB的正确使用姿势
阿里云InfluxDB介绍 阿里云InfluxDB®专注于处理高写入和查询负载的时序数据,用于存储大规模的时序数据并进行实时分析,包括来自DevOps监控、车联网、智慧交通、金融和IOT传感器数据采集,目前可以在阿里云官网开通购买基础版和高可用版实例。
5872 0
阿里云InfluxDB的正确使用姿势

热门文章

最新文章