본문으로 바로가기

Telegraf + InfluxDB 1.8.x 설치

category Development/Cloud, Openstack 2024. 11. 26. 15:09

Telegraf 설치

# curl -sL https://repos.influxdata.com/influxdata-archive_compat.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
# sudo apt-get update && sudo apt-get install telegraf

or

# wget -q https://repos.influxdata.com/influxdata-archive_compat.key 
# echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null 
# echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list 
# sudo apt-get update && sudo apt-get install telegraf

[모듈 설정]
# systemctl enable telegraf
# systemctl start telegraf

InfluxDB 1.8.x 설치

[모듈 설치] 
# dpkg -i influxdb_1.8.1_amd64.deb 

[wget이 설치 되어 있지 않은 경우]
# dnf install wget  - 먼저 실행 설치 후 진행

[wget 설치하는 경우] - 각 환경에 맞는 버전 확인 후 버전 설치

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

# Ubuntu 
# wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.1_amd64.deb 
# sudo dpkg -i influxdb_1.8.1_amd64.deb 

[모듈 설정] 
# systemctl enable influxdb
# systemctl start influxdb
-> 한줄로 정리 # systemctl enable --now influxdb

[데이터베이스 및 계정생성]
# influx
   > CREATE DATABASE mydatabase; 
   > CREATE RETENTION POLICY mydatabase_rp_365d ON mydatabase DURATION 365d REPLICATION 1 default; 
   > CREATE USER influxuser WITH PASSWORD 'influxpassword' WITH ALL PRIVILEGES;
   > GRANT ALL PRIVILEGES TO mydatabase;
   > exit
728x90