본문 바로가기

리눅스

우분투에서 influxdb를 설치하는 방법

반응형

우분투에서 influxdb(influxdb 2.x)를 설치하는 방법

테스트 환경

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

influxdb 설치

influxdb 저장소를 시스템에 추가

echo "deb https://repos.influxdata.com/ubuntu focal stable" | tee /etc/apt/sources.list.d/influxdb.list

또는

export DISTRIB_ID=$(lsb_release -si);
export DISTRIB_CODENAME=$(lsb_release -sc);
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null

GPG 키를 저장소에 추가

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

APT 저장소 업데이트

apt update

influxdb 패키지 설치

apt install -y influxdb2

influxdb 서비스 시작 및 활성화

systemctl enable --now influxdb

influxdb 프로세스 확인

ps -ef | grep -v grep | grep influxdb
$ ps -ef | grep -v grep | grep influxdb           
influxdb    2192       1  0 05:36 ?        00:00:00 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

influxdb 서비스 포트 확인

netstat -nlpt | grep influxdb
$ netstat -nlpt | grep influxdb
tcp        0      0 127.0.0.1:8088          0.0.0.0:*               LISTEN      2192/influxd        
tcp6       0      0 :::8086                 :::*                    LISTEN      2192/influxd

influxdb version 정보 확인

influxd version
$ influxd version
InfluxDB v2.3.0+SNAPSHOT.090f681737 (git: 090f681737) build_date: 2022-06-16T19:34:04Z
influx version
$ influx version
Influx CLI 2.3.0 (git: 88ba346) build_date: 2022-04-06T19:30:53
728x90

influxdb 설정(CLI)

org 생성

influx org create -n org-scbyun
$ influx org create -n org-scbyun
ID                      Name
ddd100a11142bea2        org-scbyun

 

influx org list
$ influx org list
ID                      Name
ddd100a11142bea2        org-scbyun

user 생성

  • Password는 8자 이상 사용
influx user create -n admin -p password1! -o org-scbyun
$ influx user create -n admin -p password1! -o org-scbyun
ID                      Name
09a6b6404d9db000        admin

 

influx user list
$ influx user list
ID                      Name
09a6b6404d9db000        admin

bucket 생성

influx bucket create -n bucket-telegraf -o org-scbyun -r 72h
$ influx bucket create -n bucket-telegraf -o org-scbyun -r 72h
ID                      Name            Retention       Shard group duration    Organization ID         Schema Type
14a98213ac5b4181        bucket-telegraf 72h0m0s         24h0m0s                 ddd100a11142bea2        implicit

 

influx bucket list
$ influx bucket list -o org-scbyun
ID                      Name            Retention       Shard group duration    Organization ID         Schema Type
f7f52e123c69685f        _monitoring     168h0m0s        24h0m0s                 ddd100a11142bea2        implicit
c1398b275069367a        _tasks          72h0m0s         24h0m0s                 ddd100a11142bea2        implicit
14a98213ac5b4181        bucket-telegraf 72h0m0s         24h0m0s                 ddd100a11142bea2        implicit

token 생성

influx auth create -o org-scbyun --all-access
$ influx auth create -o org-scbyun --all-access
ID                      Description     Token                                                                                          User Name        User ID                 Permissions
09a6bfd5ff9db000                        554dt0NVvu3Rj63NXjo9tFt-Qf8Rn1E5gj7sGuIsclk1og0OvO3NLzqHJjJmNpsl3U3EXg19GfVeRNcHS2ggMQ==       tadmin           09a6b50112ddb000        [read:orgs/ddd100a11142bea2/authorizations write:orgs/ddd100a11142bea2/authorizations read:orgs/ddd100a11142bea2/buckets write:orgs/ddd100a11142bea2/buckets read:orgs/ddd100a11142bea2/dashboards write:orgs/ddd100a11142bea2/dashboards read:/orgs/ddd100a11142bea2 read:orgs/ddd100a11142bea2/sources write:orgs/ddd100a11142bea2/sources read:orgs/ddd100a11142bea2/tasks write:orgs/ddd100a11142bea2/tasks read:orgs/ddd100a11142bea2/telegrafs write:orgs/ddd100a11142bea2/telegrafs read:/users/09a6b50112ddb000 write:/users/09a6b50112ddb000 read:orgs/ddd100a11142bea2/variables write:orgs/ddd100a11142bea2/variables read:orgs/ddd100a11142bea2/scrapers write:orgs/ddd100a11142bea2/scrapers read:orgs/ddd100a11142bea2/secrets write:orgs/ddd100a11142bea2/secrets read:orgs/ddd100a11142bea2/labels write:orgs/ddd100a11142bea2/labels read:orgs/ddd100a11142bea2/views write:orgs/ddd100a11142bea2/views read:orgs/ddd100a11142bea2/documents write:orgs/ddd100a11142bea2/documents read:orgs/ddd100a11142bea2/notificationRules write:orgs/ddd100a11142bea2/notificationRules read:orgs/ddd100a11142bea2/notificationEndpoints write:orgs/ddd100a11142bea2/notificationEndpoints read:orgs/ddd100a11142bea2/checks write:orgs/ddd100a11142bea2/checks read:orgs/ddd100a11142bea2/dbrp write:orgs/ddd100a11142bea2/dbrp read:orgs/ddd100a11142bea2/notebooks write:orgs/ddd100a11142bea2/notebooks read:orgs/ddd100a11142bea2/annotations write:orgs/ddd100a11142bea2/annotations read:orgs/ddd100a11142bea2/remotes write:orgs/ddd100a11142bea2/remotes read:orgs/ddd100a11142bea2/replications write:orgs/ddd100a11142bea2/replications]

 

influx auth list
$ influx auth list
ID                      Description     Token                                                                                          User Name        User ID                 Permissions
09a6bfd5ff9db000                        554dt0NVvu3Rj63NXjo9tFt-Qf8Rn1E5gj7sGuIsclk1og0OvO3NLzqHJjJmNpsl3U3EXg19GfVeRNcHS2ggMQ==       tadmin           09a6b50112ddb000        [read:orgs/ddd100a11142bea2/authorizations write:orgs/ddd100a11142bea2/authorizations read:orgs/ddd100a11142bea2/buckets write:orgs/ddd100a11142bea2/buckets read:orgs/ddd100a11142bea2/dashboards write:orgs/ddd100a11142bea2/dashboards read:/orgs/ddd100a11142bea2 read:orgs/ddd100a11142bea2/sources write:orgs/ddd100a11142bea2/sources read:orgs/ddd100a11142bea2/tasks write:orgs/ddd100a11142bea2/tasks read:orgs/ddd100a11142bea2/telegrafs write:orgs/ddd100a11142bea2/telegrafs read:/users/09a6b50112ddb000 write:/users/09a6b50112ddb000 read:orgs/ddd100a11142bea2/variables write:orgs/ddd100a11142bea2/variables read:orgs/ddd100a11142bea2/scrapers write:orgs/ddd100a11142bea2/scrapers read:orgs/ddd100a11142bea2/secrets write:orgs/ddd100a11142bea2/secrets read:orgs/ddd100a11142bea2/labels write:orgs/ddd100a11142bea2/labels read:orgs/ddd100a11142bea2/views write:orgs/ddd100a11142bea2/views read:orgs/ddd100a11142bea2/documents write:orgs/ddd100a11142bea2/documents read:orgs/ddd100a11142bea2/notificationRules write:orgs/ddd100a11142bea2/notificationRules read:orgs/ddd100a11142bea2/notificationEndpoints write:orgs/ddd100a11142bea2/notificationEndpoints read:orgs/ddd100a11142bea2/checks write:orgs/ddd100a11142bea2/checks read:orgs/ddd100a11142bea2/dbrp write:orgs/ddd100a11142bea2/dbrp read:orgs/ddd100a11142bea2/notebooks write:orgs/ddd100a11142bea2/notebooks read:orgs/ddd100a11142bea2/annotations write:orgs/ddd100a11142bea2/annotations read:orgs/ddd100a11142bea2/remotes write:orgs/ddd100a11142bea2/remotes read:orgs/ddd100a11142bea2/replications write:orgs/ddd100a11142bea2/replications]

 

influx setup --username tadmin --password 'admin12#$' --org scbyun.com --bucket telegraf --retention 1w --force
$ influx setup --username tadmin --password 'admin12#$' --org scbyun.com --bucket telegraf --retention 1w --force
User    Organization    Bucket
tadmin  scbyun.com      telegraf

 

influx auth list
$ influx auth list
ID                      Description     Token                                                                                           User Name       User ID                 Permissions
09a6b5012a5db000        tadmin's Token  BozErr0Oxxq4H4_sRfSDilgT7VDVfJgKWS3TkNxbnZYS0SblCY3LUoji3l637dlqRmley4seXqMTMi7dmnF3iA==        tadmin          09a6b50112ddb000        [read:/authorizations write:/authorizations read:/buckets write:/buckets read:/dashboards write:/dashboards read:/orgs write:/orgs read:/sources write:/sources read:/tasks write:/tasks read:/telegrafs write:/telegrafs read:/users write:/users read:/variables write:/variables read:/scrapers write:/scrapers read:/secrets write:/secrets read:/labels write:/labels read:/views write:/views read:/documents write:/documents read:/notificationRules write:/notificationRules read:/notificationEndpoints write:/notificationEndpoints read:/checks write:/checks read:/dbrp write:/dbrp read:/notebooks write:/notebooks read:/annotations write:/annotations read:/remotes write:/remotes read:/replications write:/replications]

influxdb 웹 인터페이스 액세스

http://{Server-IP}:8086

i1
i2
i3
i4

 

참고URL

- https://docs.influxdata.com/influxdb/v2.3/install/

 

728x90
반응형